82 lines
2.2 KiB
C++
Executable File
82 lines
2.2 KiB
C++
Executable File
#if !defined(AFX_BMPTXTBUTTON_H__10973F7C_8C2C_4866_BA86_28D467F6F838__INCLUDED_)
|
|
#define AFX_BMPTXTBUTTON_H__10973F7C_8C2C_4866_BA86_28D467F6F838__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
// BmpTxtButton.h : header file
|
|
//
|
|
// 定义按钮状态
|
|
#define TBS_NORMAL 0 // 普通
|
|
#define TBS_DOWN 1 // 按下
|
|
#define TBS_FOUCSED 2 // 具有焦点
|
|
#define TBS_DISABLE 3 // 禁用
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CBmpTxtButton window
|
|
|
|
class CBmpTxtButton : public CButton
|
|
{
|
|
private:
|
|
CString m_Title; // 按钮标题
|
|
int m_State; // 按钮状态
|
|
COLORREF m_TitleColor; // 标题颜色
|
|
UINT m_NormalID; // 按钮背景图像资源ID号 正常状态
|
|
UINT m_DownID; // 按钮背景图像资源ID号 按下
|
|
UINT m_FoucsedID; // 按钮背景图像资源ID号 具有焦点
|
|
UINT m_DisableID; // 按钮背景图像资源ID号 禁用
|
|
|
|
CDC m_NormalDC;
|
|
CDC m_DownDC;
|
|
CFont m_txtFont;
|
|
|
|
bool m_butDown;
|
|
int m_butStyle;
|
|
// Construction
|
|
public:
|
|
CBmpTxtButton();
|
|
|
|
// Attributes
|
|
public:
|
|
|
|
// Operations
|
|
public:
|
|
|
|
// Overrides
|
|
// ClassWizard generated virtual function overrides
|
|
//{{AFX_VIRTUAL(CBmpTxtButton)
|
|
public:
|
|
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
|
|
protected:
|
|
virtual void PreSubclassWindow();
|
|
//}}AFX_VIRTUAL
|
|
|
|
// Implementation
|
|
public:
|
|
void SetTitleStyle(int iStyle);
|
|
void SetButtonDown(bool bDown);
|
|
bool IsButtonDown(void);
|
|
CString GetButtonTitle(void);
|
|
int GetButtonState(void);
|
|
void SetButtonState(int iState);
|
|
void SetButtonTitle(CString iTitle);
|
|
void LoadBitmaps(UINT nIDBitmapResource,UINT nIDBitmapResourceSel = 0,UINT nIDBitmapResourceFocus = 0,UINT nIDBitmapResourceDisabled = 0 );
|
|
virtual ~CBmpTxtButton();
|
|
|
|
// Generated message map functions
|
|
protected:
|
|
//{{AFX_MSG(CBmpTxtButton)
|
|
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
|
afx_msg void OnPaint();
|
|
//}}AFX_MSG
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
};
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
//{{AFX_INSERT_LOCATION}}
|
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
|
|
|
#endif // !defined(AFX_BMPTXTBUTTON_H__10973F7C_8C2C_4866_BA86_28D467F6F838__INCLUDED_)
|