cnumspinedit.h

来自「是一个数字编辑器」· C头文件 代码 · 共 68 行

H
68
字号
#ifndef CNumSpinEdit_h
#define CNumSpinEdit_h 1

// afxwin
#include "afxwin.h"

class CNumRangeEdit;
class CSpin;

//	edit that displays floating points and has a spinner
//	that can modify the values.

class CNumSpinEdit : public CWnd  
{
	DECLARE_DYNAMIC(CNumSpinEdit )

  public:
      //	constructor
      CNumSpinEdit ();

      virtual ~CNumSpinEdit ();

	  //	get access to the spinner in the control
      CSpin* GetSpinner ();

      //	get dircet access to the edit
      CNumRangeEdit* GetEdit ();

      //	check for page up and down and increase values
      virtual BOOL PreTranslateMessage (MSG* pMsg);

      //	set digits after zero
      void SetDigits (int no);

      //	set limits in range, min, max and indicate if the values
      //	should wrap around limits
      void SetRange (float min, float max, bool wrap);

      //	set the size of each step.
      void SetStepSize (float dx);

      
      //	set the font of the control
      void SetFont (CFont* pFont, BOOL bRedraw = TRUE);

      //SetTextColor
      void SetTextColor (int r, int b, int g);
      float GetValue ();
      void SetValue (float val);
  protected:

      int OnCreate (LPCREATESTRUCT lpCreateStruct);
      void OnSize (UINT nType, int cx, int cy);
      void OnKeyDown (UINT nChar, UINT nRepCnt, UINT flags);
      void OnSetFocus (CWnd* pOldWnd);
      HBRUSH OnCtlColor (CDC* pDC, CWnd* pWnd, UINT nCtlColor);


      CSpin *m_spin;
      CNumRangeEdit *m_edit;
	  //{{AFX_MSG(CNumSpinEdit)
	  //}}AFX_MSG
	  DECLARE_MESSAGE_MAP()
  private:
      COLORREF textColor;
};
#endif

⌨️ 快捷键说明

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