| 18 | }; |
| 19 | |
| 20 | class CColorBox |
| 21 | :public CWindowImpl<CColorBox> { |
| 22 | public: |
| 23 | DECLARE_WND_CLASS_EX(L"ColorBox", CS_GLOBALCLASS, NULL); |
| 24 | |
| 25 | BEGIN_MSG_MAP(CColorBox) |
| 26 | MESSAGE_HANDLER(WM_CREATE,OnCreate) |
| 27 | MESSAGE_HANDLER(WM_DESTROY, OnDestroy) |
| 28 | MESSAGE_HANDLER(WM_PAINT,OnPaint) |
| 29 | MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground) |
| 30 | MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove) |
| 31 | MESSAGE_HANDLER(WM_MOUSELEAVE,OnMouseLeave) |
| 32 | MESSAGE_HANDLER(WM_LBUTTONDOWN,OnLBtnDown) |
| 33 | MESSAGE_HANDLER(WM_SETFOCUS,OnSetFocus) |
| 34 | MESSAGE_HANDLER(WM_KILLFOCUS,OnKillFocus) |
| 35 | MESSAGE_HANDLER(WM_GETDLGCODE, OnGetDlgCode) |
| 36 | MESSAGE_HANDLER(WM_KEYDOWN, OnKeyDown) |
| 37 | END_MSG_MAP() |
| 38 | |
| 39 | LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); |
| 40 | LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lparam, BOOL& /*bHandled*/); |
| 41 | LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); |
| 42 | LRESULT OnEraseBackground(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); |
| 43 | LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); |
| 44 | LRESULT OnMouseLeave(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); |
| 45 | LRESULT OnLBtnDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); |
| 46 | LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); |
| 47 | LRESULT OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); |
| 48 | LRESULT OnGetDlgCode(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); |
| 49 | LRESULT OnKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/); |
| 50 | |
| 51 | void SetColor(COLORREF color); |
| 52 | COLORREF GetColor(); |
| 53 | void EnableThemeSupport(bool support); |
| 54 | |
| 55 | private: |
| 56 | COLORREF MakeColorBrighter(COLORREF Color,UCHAR increment); |
| 57 | void SelectColor(); |
| 58 | |
| 59 | ColorBoxContext _context{ 0 }; |
| 60 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected