📄 colorbutton.h
字号:
#if !defined(AFX_COLORBUTTON_H__2C9F073E_4D6A_11D6_AC5A_5254AB2BBDFC__INCLUDED_)
#define AFX_COLORBUTTON_H__2C9F073E_4D6A_11D6_AC5A_5254AB2BBDFC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ColorButton.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CColorButton window
class ColorButton : public CButton
{
// Construction
public:
ColorButton();
// Attributes
public:
// BOOL Attach(const UINT nID, CWnd* pParent,
// const COLORREF BGColor = RGB(192, 192, 192), // gray button
// const COLORREF FGColor = RGB(1, 1, 1), // black text
// const COLORREF DisabledColor = RGB(128, 128, 128), // dark gray disabled text
// const UINT nBevel = 2
// );
BOOL Attach(const UINT nID, CWnd* pParent,
const COLORREF BGColor, // gray button
const COLORREF FGColor, // black text
const COLORREF DisabledColor, // dark gray disabled text
const UINT nBevel
);
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CColorButton)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~ColorButton();
// Generated message map functions
protected:
//{{AFX_MSG(CColorButton)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
virtual void DrawItem(LPDRAWITEMSTRUCT lpDIS);
void DrawFrame(CDC *DC, CRect R, int Inset);
void DrawFilledRect(CDC *DC, CRect R, COLORREF color);
void DrawLine(CDC *DC, CRect EndPoints, COLORREF color);
void DrawLine(CDC *DC, long left, long top, long right, long bottom, COLORREF color);
void DrawButtonText(CDC *DC, CRect R, const char *Buf, COLORREF TextColor);
COLORREF GetFGColor() { return m_fg; }
COLORREF GetBGColor() { return m_bg; }
COLORREF GetDisabledColor() { return m_disabled; }
UINT GetBevel() { return m_bevel; }
private:
//以下三种颜色分别为文字,背景,失效时
COLORREF m_fg, m_bg, m_disabled;
UINT m_bevel;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_COLORBUTTON_H__2C9F073E_4D6A_11D6_AC5A_5254AB2BBDFC__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -