numericedit.h

来自「一个通过USB->UART读取C8051F060的程序」· C头文件 代码 · 共 78 行

H
78
字号
#if !defined(AFX_NUMERICEDIT_H__89755D18_F5EC_4DE0_92B2_806E9BD897A7__INCLUDED_)
#define AFX_NUMERICEDIT_H__89755D18_F5EC_4DE0_92B2_806E9BD897A7__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// NumericEdit.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CNumericEdit window
union   InnerVal
{
		int    nIVal;
		float  nFVal;
};


class CNumericEdit : public CEdit
{
// Construction
public:
	CNumericEdit();

// Attributes
public:
	int   m_nDotNum;
	int   m_nNegTag;

	void  SetRange(float fMinVal, float fMaxVal);
	void  SetRange(int  nMinVal, int  nMaxVal);

private:
	struct _tagInnerStruct
	{
			union   InnerVal  m_RngVal_Max;	//最大范围值
			union   InnerVal  m_RngVal_Min;	//最小范围值
			union   InnerVal  m_RngVal_Act;	//实际值
			short   sType;
	}m_sInnerObj;
	
	void   CheckRange();
// Operations
public:
    void  SetEnbl(BOOL bEnable = TRUE);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CNumericEdit)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CNumericEdit();

	// Generated message map functions
protected:
	//{{AFX_MSG(CNumericEdit)
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	afx_msg void OnKillFocus(CWnd* pNewWnd);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
	BOOL    m_bEnable;
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_NUMERICEDIT_H__89755D18_F5EC_4DE0_92B2_806E9BD897A7__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?