📄 buttons.h
字号:
#if !defined(AFX_COLORBUTTON_H__8F5D3640_C215_4413_9CEC_6824EF066149__INCLUDED_)#define AFX_COLORBUTTON_H__8F5D3640_C215_4413_9CEC_6824EF066149__INCLUDED_#if _MSC_VER > 1000#pragma once#endif // _MSC_VER > 1000// Buttons.h : header file//#define BTN_RIGHT_CLICKED 0x0002#define BC_TEXTN 0x0000L#define BC_TEXTS 0x0001L#define BC_TEXTD 0x0002L#define BC_FACEN 0x0004L#define BC_FACES 0x0008L#define BC_FACED 0x0010L#define BC_LEFTN 0x0020L#define BC_LEFTS 0x0040L#define BC_LEFTD 0x0080L#define BC_RIGHTN 0x0100L#define BC_RIGHTS 0x0200L#define BC_RIGHTD 0x0400L#define BC_ALL 0xFFFFLtypedef struct{ COLORREF crText; COLORREF crFace; COLORREF crLeft; COLORREF crRight;} BUTTONCOLOR;typedef struct{ UINT nMask; COLORREF crTextNormal, crTextSelect, crTextDisable; // 咆胶飘 祸惑 COLORREF crFaceNormal, crFaceSelect, crFaceDisable; // 官帕 祸惑 COLORREF crLeftNormal, crLeftSelect, crLeftDisable; // 哭率 困 抛滴府 祸惑 COLORREF crRightNormal, crRightSelect, crRightDisable; // 坷弗率 酒贰 抛滴府 祸惑} BUTTONCOLORS;/////////////////////////////////////////////////////////////////////////////// RxButton class/////////////////////////////////////////////////////////////////////////////class RxButton : public CButton{// Constructionpublic: RxButton();// Attributespublic: UINT m_nButtonStyle; // 滚瓢 胶鸥老捞 PreSubclassWindow俊辑 历厘登哥 OwnerDraw屈怕肺 官诧促. int m_nCheck; // Uncheck : 0, Check : 1, Normal : 2// Operationspublic: // 滚瓢狼 惑怕 包府 void SetCheck(int nCheck, BOOL bRedraw = TRUE); int GetCheck(); void SetToggle();// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(RxButton) protected: virtual void PreSubclassWindow(); //}}AFX_VIRTUAL// Implementationpublic: virtual ~RxButton(); // Generated message map functionsprotected: //{{AFX_MSG(RxButton) afx_msg void OnRButtonUp(UINT nFlags, CPoint point); afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); //}}AFX_MSG DECLARE_MESSAGE_MAP()};/////////////////////////////////////////////////////////////////////////////// RxPushButton class/////////////////////////////////////////////////////////////////////////////class RxPushButton : public RxButton{// Constructionpublic: RxPushButton();// Attributespublic: BUTTONCOLORS m_crInfo; // 滚瓢狼 惑怕俊 秦寸窍绰 拿矾 蔼// Operationspublic: void GetColorPushStyle(UINT nState, BUTTONCOLOR *crInfo); void GetColorRadioStyle(UINT nState, BUTTONCOLOR *crInfo); void GetColorCheckStyle(UINT nState, BUTTONCOLOR *crInfo); void DrawButtonText(CDC *pDC, CRect rect, BUTTONCOLOR *crInfo); // 拿矾 沥焊 汲沥. void SetColors(BUTTONCOLORS *crInfo); BUTTONCOLORS* GetColors();// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(RxPushButton) public: virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); //}}AFX_VIRTUAL// Implementationpublic: virtual ~RxPushButton(); // Generated message map functionsprotected: //{{AFX_MSG(RxPushButton) afx_msg BOOL OnEraseBkgnd(CDC* pDC); //}}AFX_MSG DECLARE_MESSAGE_MAP()};/////////////////////////////////////////////////////////////////////////////// RxRadioButton class/////////////////////////////////////////////////////////////////////////////class RxRadioButton : public RxButton{// Constructionpublic: RxRadioButton();// Attributespublic: COLORREF m_crBkgnd; COLORREF m_crText; COLORREF m_crRadioFace; COLORREF m_crRadioPoint; COLORREF m_crRadioEdge; COLORREF m_crRadio1; COLORREF m_crRadio2; COLORREF m_crRadio3; COLORREF m_crRadio4; COLORREF m_crRadio5;// Operationspublic: void DrawRadio(CDC *pDC, CRect rect, UINT nState); void DrawButtonText(CDC *pDC, CRect rect); // 滚瓢狼 农扁甫 臂磊农扁俊 嘎苗霖促. void RecalcLayout();// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(RxRadioButton) public: virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); //}}AFX_VIRTUAL// Implementationpublic: virtual ~RxRadioButton(); // Generated message map functionsprotected: //{{AFX_MSG(RxRadioButton) afx_msg BOOL OnEraseBkgnd(CDC* pDC); //}}AFX_MSG DECLARE_MESSAGE_MAP()};/////////////////////////////////////////////////////////////////////////////// RxCheckButton Class/////////////////////////////////////////////////////////////////////////////class RxCheckButton : public RxButton{// Constructionpublic: RxCheckButton();// Attributespublic: COLORREF m_crBkgnd; COLORREF m_crBoxEdge; COLORREF m_crBoxFace; COLORREF m_crBoxLeftTop; COLORREF m_crBoxRightBottom; COLORREF m_crCheck1; COLORREF m_crCheck2; COLORREF m_crCheck3; COLORREF m_crText;// Operationspublic: void DrawCheckBox(CDC *pDC, CRect rect, UINT nState); void DrawButtonText(CDC *pDC, CRect rect); void RecalcLayout();// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(RxCheckButton) public: virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); //}}AFX_VIRTUAL// Implementationpublic: virtual ~RxCheckButton(); // Generated message map functionsprotected: //{{AFX_MSG(RxCheckButton) afx_msg BOOL OnEraseBkgnd(CDC* pDC); //}}AFX_MSG DECLARE_MESSAGE_MAP()};/////////////////////////////////////////////////////////////////////////////// RxBitmapButton class/////////////////////////////////////////////////////////////////////////////#define BM_NORMAL 0x0001L // 肺靛登绢柳 厚飘甘阑 唱鸥辰促.#define BM_SELECT 0x0002L#define BM_FOCUS 0x0004L#define BM_DISABLED 0x0008L#define BM_ALL 0xFFFFLclass RxBitmapButton : public RxButton{// Constructionpublic: RxBitmapButton();// Attributespublic: CBitmap m_bmpResource; // Resource Normal, down, focus, disabled images UINT m_nLoadBitmap; // 肺靛登绢瘤绰 厚飘甘狼 辆幅甫 唱鸥辰促. CSize m_szBitmap; // Size of resource Bitmaps, must have same size all bitmaps// Operationspublic: BOOL LoadBitmaps(UINT nIDBmpResource, CSize szBitmap, UINT nLoadBitmap = BM_ALL);// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(RxBitmapButton) public: virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); //}}AFX_VIRTUAL// Implementationpublic: virtual ~RxBitmapButton(); // Generated message map functionsprotected: //{{AFX_MSG(RxBitmapButton) afx_msg BOOL OnEraseBkgnd(CDC* pDC); //}}AFX_MSG DECLARE_MESSAGE_MAP()};///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}}// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_COLORBUTTON_H__8F5D3640_C215_4413_9CEC_6824EF066149__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -