-
Notifications
You must be signed in to change notification settings - Fork 2
/
ColorButton.h
49 lines (37 loc) · 1 KB
/
ColorButton.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#pragma once
#include "DialogFactory.h"
#include "PicCommandsCommon.h"
// CColorPickerButton
class CColorPickerButton : public CButton
{
DECLARE_DYNAMIC(CColorPickerButton)
public:
CColorPickerButton();
virtual ~CColorPickerButton();
void SetColorAndState(EGACOLOR color, BOOL bOn);
void SetDialogFactory(IDialogFactory *pFactory) { _pFactory = pFactory; }
protected:
virtual void _OnDraw(HDC hdc, RECT *prc, EGACOLOR color);
virtual void OnLButtonDown(UINT nFlags, CPoint point);
virtual void DrawItem(LPDRAWITEMSTRUCT pdis);
DECLARE_MESSAGE_MAP()
IDialogFactory *_pFactory;
EGACOLOR _color;
BOOL _bOn;
};
//
// CBrushButton
// (subclassed from CColorPickerButton due to laziness)
//
class CBrushButton : public CColorPickerButton
{
DECLARE_DYNAMIC(CBrushButton)
public:
CBrushButton();
virtual ~CBrushButton();
void SetPenStyle(const PenStyle *pPenStyle);
protected:
virtual void _OnDraw(HDC hdc, RECT *prc, EGACOLOR color);
private:
PenStyle _penStyle;
};