📄 color.h
字号:
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////// cololine.h /////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
#ifndef _COLOR_H_
#define _COLOR_H_
#define WM_BUTTONSELCOLOR WM_USER+500
#define UPSTATE 0x01
#define DOWNSTATE 0x02
#define FOCUSSTATE 0x04
#define WINDOW_WIDTH 145
//#define WINDOW_FULLHEIGHT 185
#define WINDOW_NORMALHEIGHT 100 //没有展开的时候窗口的高度
// it can't be portable to high version of windows
#define DLGC_WANTENTERKEY 0x8000
class CColorButton: public CButton
{
DECLARE_DYNAMIC(CColorButton)
protected:
BOOL m_bShowPopWndFlag ; //show if the popupwindow is shown on screen
BOOL m_bInPopUp;
protected:
BYTE m_byState;
public:
COLORREF m_color;
CColorButton( ){
m_color = RGB( 0,0,0 );
m_byState = NULL;
m_bShowPopWndFlag = FALSE;
m_bInPopUp = FALSE;
}
~CColorButton()
{
}
protected:
void DrawRectOnButton( HDC );
virtual void DrawItem( LPDRAWITEMSTRUCT );
virtual void DrawFrame( LPDRAWITEMSTRUCT );
virtual void DrawItemUp( LPDRAWITEMSTRUCT );
//show the up state button
virtual void DrawItemDown( LPDRAWITEMSTRUCT );
//show the down state button
virtual void DrawItemTabFocus( LPDRAWITEMSTRUCT );
virtual void DrawItemDisabled( LPDRAWITEMSTRUCT );
virtual void DrawOtherOnButton( LPDRAWITEMSTRUCT );
virtual void OnDown( void );
virtual void OnUp( void );
public:
BOOL Create(LPCSTR lpszCaption, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID);
// this class call Parent class CButton's Create funtion
virtual BOOL CreatePopUpWindow (
LPCSTR lpszWindowName,
const RECT& rect,
CWnd* pParentWnd );
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
DECLARE_MESSAGE_MAP()
};
#endif //_COLOR_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -