⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cnumedit.h

📁 是一个数字编辑器
💻 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 + -