📄 cnumedit.h
字号:
#ifndef CNumEdit_h
#define CNumEdit_h 1
// afxwin
#include "afxwin.h"
// Edit control that only accepts and displays numeric
// input.
// The SetWindowText operation still works, so it is
// posible to place text in the control, it can just not be
// inputted by the user.
class CNumEdit : public CEdit
{
DECLARE_DYNAMIC(CNumEdit)
public:
CNumEdit ();
// set number of trailing digits after zero. i.e. set the
// presision of the values show.
void SetDigits (int noOfDigitsAfterZero);
// get Number of digits after zero
int GetDigits ();
// get the value of the edit control - assumes its a float,
// not just text.
virtual float GetValue ();
// set value in edit control, the input is validated first
virtual void SetValue (float x);
protected:
// responds to user input from keyboard
virtual void OnChar (UINT nChar, UINT nRepCnt, UINT nFlags);
// check to see that we only inpu x digits after zero.
virtual bool CheckInput (UINT nChar);
// Data Members for Class Attributes
int m_digits;
//{{AFX_MSG(CNumEdit)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -