📄 buttonbt.h
字号:
#if !defined(AFX_BUTTONBT_H__998ADFDB_0E45_431D_AD62_98B88462D162__INCLUDED_)
#define AFX_BUTTONBT_H__998ADFDB_0E45_431D_AD62_98B88462D162__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ButtonBT.h : header file
//
#define AL_LEFT 0
#define AL_TOP 1
// the state to draw
#define ST_MOVEIN 0
#define ST_MOVEOUT 1
#define ST_MOUSEUP 2
#define ST_MOUSEDOWN 3
/////////////////////////////////////////////////////////////////////////////
// CButtonBT window
class CButtonBT : public CButton
{
// Construction
public:
CButtonBT();
enum {ST_ALIGN_HORIZ, ST_ALIGN_VERT};
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CButtonBT)
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
protected:
virtual void PreSubclassWindow();
//}}AFX_VIRTUAL
// Implementation
public:
bool m_bText;
CString m_strText;
void SetTextModel(bool bModel=false,CString str=_T(""));
void SetModel(COLORREF color,UINT nNormal, UINT nMouseIn);
void SetBKColor(COLORREF bkColor,BOOL bRepaint);
void SetIconPos(int x,int y);
void SetTextYPos(int y);
void SetTextXPos(int x);
void SetStyle(bool bIsflat=false);
void SetNormalTextColor(COLORREF color);
void SetMouseDownTextColor(COLORREF color);
void SetIconYPos(int y);
void SetIconXPos(int x);
void SetIcon(HICON hNormal,HICON hMouseIn);
void SetIcon(UINT nNormal,UINT nMouseIn);
BOOL SetCursor(UINT nCursorID);
void SetBkMode(bool bTransparent);
void SetAlign(int nAlign);
void SetActiveTextColor(COLORREF color);
void DrawText();
void DrawIcon(HICON hIcon,BOOL bDisabled=FALSE);
void DrawIcon();
void Refresh();
void DrawBorders();
void Draw();
CDC memDC;
bool m_bDCStored;
bool m_bMove;
virtual ~CButtonBT();
// Generated message map functions
protected:
int m_nIconX;
//{{AFX_MSG(CButtonBT)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
bool m_bIsEnabled;
HCURSOR m_hCursor;
bool m_bHasFocus;
bool m_bIsFlat;
bool m_bBkTransparent;
COLORREF m_clText;
COLORREF m_clMouseDownText;
COLORREF m_clActiveText;
COLORREF m_clNormalText;
bool m_bUseIcon;
int m_IconYPos;
int m_IconXPos;
int m_DrawState;
int m_IconAlign;
HICON m_hMouseInIcon;
HICON m_hNormalIcon;
DECLARE_MESSAGE_MAP()
int m_nIconY;
int m_cyText;
int m_cxText;
private:
private:
COLORREF m_bkColor;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BUTTONBT_H__998ADFDB_0E45_431D_AD62_98B88462D162__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -