colorbutton.h

来自「开发的,食物管理软件,可以在智能家电的终端上直接应用」· C头文件 代码 · 共 63 行

H
63
字号
#if !defined(AFX_COLORBUTTON_H__45000E2E_5AB3_4F56_95F5_D56035D71910__INCLUDED_)
#define AFX_COLORBUTTON_H__45000E2E_5AB3_4F56_95F5_D56035D71910__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CColorButton window

class CColorButton : public CButton
{
// Construction
public:
	CColorButton();

// Attributes
public:
 
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CColorButton)
	public:
	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);//自动调用
	//}}AFX_VIRTUAL

// Implementation
public: 
	int strlong;//按钮文本长度;
	char buttonText[MAX_PATH + 1];
	BOOL HadSelected;
	void DrawButtonText(CDC* DC,CRect R, unsigned short Buf[],COLORREF TextColor);//填充文字
	void DrawFilledRect(CDC* DC,CRect R,COLORREF color);//填充颜色
	COLORREF GetDisabledColor();//无效色=按了以后
	COLORREF GetBGColor();//get背景色
	COLORREF GetFGColor();//get文本色
	COLORREF m_fg;//文本色
	COLORREF m_bg;//背景色
	COLORREF m_disabled;//无效色
	BOOL Attach(const UINT nID,CWnd* pParent,const COLORREF BGColor, const COLORREF FGColor,const COLORREF DisabledColor);//初始化按钮
	virtual ~CColorButton();

	// Generated message map functions
protected:
	//{{AFX_MSG(CColorButton)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}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__45000E2E_5AB3_4F56_95F5_D56035D71910__INCLUDED_)

⌨️ 快捷键说明

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