FLImaging 6.5.8.1
GUIVisualManager.h
1#pragma once
2#include <afxvisualmanagerwindows7.h>
3class CGUIVisualManager : public CMFCVisualManagerWindows7
4{
5 DECLARE_DYNCREATE(CGUIVisualManager)
6
7public:
8 CGUIVisualManager();
9 virtual ~CGUIVisualManager();
10
11 virtual void SetAppTheme(UINT nTheme);
12 virtual UINT GetAppTheme();
13
14
15 // MDI Client area background color
16 COLORREF GetClrMDIClientArea();
17 void SetClrMDIClientArea(COLORREF val);
18 COLORREF GetClrMDIClientLightArea();
19 void SetClrMDIClientLightArea(COLORREF val);
20 BOOL GetCustomMDIClientAreaClr();
21 void SetCustomMDIClientAreaClr(BOOL val);
22
23 // BarBackground color
24 COLORREF GetClrBarBkDefault() const;
25 void SetClrBarBkDefault(COLORREF val);
26
27 // MenuBarBackground color
28 COLORREF GetClrMenuBarBackground() const;
29 void SetClrMenuBarBackground(COLORREF val);
30
31 // PaneDivider color
32 COLORREF GetClrPaneDivider() const;
33 void SetClrPaneDivider(COLORREF val);
34
35 // PaneBase color
36 COLORREF GetClrPaneBase() const;
37 void SetClrPaneBase(COLORREF val);
38
39 // MiniFrame color
40 COLORREF GetClrMiniFrameBkDefault() const;
41 void SetClrMiniFrameBkDefault(COLORREF val);
42 COLORREF GetClrMiniFrameBkInactive() const;
43 void SetClrMiniFrameBkInactive(COLORREF val);
44 COLORREF GetClrMiniFrameBorder() const;
45 void SetClrMiniFrameBorder(COLORREF val);
46
47 // Text color
48 COLORREF GetClrTextDefault() const;
49 void SetClrTextDefault(COLORREF val);
50 COLORREF GetClrTextHighlighted() const;
51 void SetClrTextHighlighted(COLORREF val);
52 COLORREF GetClrTextDisabled() const;
53 void SetClrTextDisabled(COLORREF val);
54
55 // Caption Text color
56 COLORREF GetClrCaptionTextDefault() const;
57 void SetClrCaptionTextDefault(COLORREF val);
58 COLORREF GetClrCaptionTextHighlighted() const;
59 void SetClrCaptionTextHighlighted(COLORREF val);
60 COLORREF GetClrCaptionTextInactive() const;
61 void SetClrCaptionTextInactive(COLORREF val);
62 COLORREF GetClrCaptionTextDisabled() const;
63 void SetClrCaptionTextDisabled(COLORREF val);
64
65
66
67
68 COLORREF GetClrToolBarColorHover() const;
69 void SetClrToolBarColorHover(COLORREF crColor);
70 COLORREF GetClrToolBarColorChecked() const;
71 void SetClrToolBarColorChecked(COLORREF crColor);
72 COLORREF GetClrToolBarColorHoverEdge() const;
73 void SetClrToolBarColorHoverEdge(COLORREF crColor);
74
75 COLORREF GetClrTabsArea() const;
76 void SetClrTabsArea(COLORREF clr);
77
78 void SetClrPropertyFace(COLORREF clr);
79 COLORREF GetClrPropertyFace();
80
81 void SetClrPropertyGroupBackground(COLORREF clr);
82 COLORREF GetClrPropertyGroupBackground();
83
84
85
86 // MDI Client area background
87 virtual BOOL OnEraseMDIClientArea(CDC* pDC, CRect rectClient);
88
89 // BarBackground
90 virtual void OnFillBarBackground(CDC* pDC, CBasePane* pBar, CRect rectClient, CRect rectClip, BOOL bNCArea = FALSE);
91
92 // MiniFrame
93 virtual COLORREF OnFillMiniFrameCaption(CDC* pDC, CRect rectCaption, CPaneFrameWnd* pFrameWnd, BOOL bActive);
94 virtual void OnDrawMiniFrameBorder(CDC* pDC, CPaneFrameWnd* pFrameWnd, CRect rectBorder, CRect rectBorderSize);
95 virtual COLORREF OnDrawPaneCaption(CDC* pDC, CDockablePane* pBar, BOOL bActive, CRect rectCaption, CRect rectButtons);
96 virtual void OnDrawCaptionButton(CDC* pDC, CMFCCaptionButton* pButton, BOOL bActive, BOOL bHorz, BOOL bMaximized, BOOL bDisabled, int nImageID = -1);
97 virtual void GetTabFrameColors(const CMFCBaseTabCtrl* pTabWnd, COLORREF& clrDark, COLORREF& clrBlack, COLORREF& clrHighlight,
98 COLORREF& clrFace, COLORREF& clrDarkShadow, COLORREF& clrLight, CBrush*& pbrFace, CBrush*& pbrBlack);
99 virtual void OnFillButtonInterior(CDC* pDC, CMFCToolBarButton* pButton, CRect rect, CMFCVisualManager::AFX_BUTTON_STATE state);
100
101 virtual void OnDrawExpandingBox(CDC* pDC, CRect rect, BOOL bOpened, COLORREF colorBox)override;
102 virtual void OnFillMenuImageRect(CDC* pDC, CMFCToolBarButton* pButton, CRect rect, CMFCVisualManager::AFX_BUTTON_STATE state);
103 virtual void OnDrawMenuCheck(CDC* pDC, CMFCToolBarMenuButton* pButton, CRect rect, BOOL bHighlight, BOOL bRadio);
104
105 // Tab
106 virtual void OnEraseTabsArea(CDC* pDC, CRect rect, const CMFCBaseTabCtrl* pTabWnd) override;
107
108 virtual BOOL IsHighlightWholeMenuItem() override;
109 virtual void OnHighlightMenuItem(CDC* pDC, CMFCToolBarMenuButton* pButton, CRect rect, COLORREF& clrText) override;
110 static bool DrawCustomCheckBox(CDC* pDC, CRect& rtRect, COLORREF crColor, bool bWithBox = false, COLORREF crFillColor = 0);
111
112 // pane properties
113 static void OnDrawCheckBoxEx(CDC* pDC, CRect rect, int nState, BOOL bHighlighted, BOOL bPressed, BOOL bEnabled);
114 static void OnDrawRadioButton(CDC* pDC, CRect rect, BOOL bOn, BOOL bHighlighted, BOOL bPressed, BOOL bEnabled);
115
116 // Auto-hide buttons:
117 virtual void OnFillAutoHideButtonBackground(CDC* pDC, CRect rect, CMFCAutoHideButton* pButton) override;
118 virtual void OnDrawAutoHideButtonBorder(CDC* pDC, CRect rectBounds, CRect rectBorderSize, CMFCAutoHideButton* pButton) override;
119 virtual COLORREF GetAutoHideButtonTextColor(CMFCAutoHideButton* pButton) override;
120
121 // System menu button
122 virtual void OnDrawMenuSystemButton(CDC* pDC, CRect rect, UINT uiSystemCommand, UINT nStyle, BOOL bHighlight) override;
123
124 virtual void OnDrawSpinButtons(CDC* pDC, CRect rectSpin, int nState, BOOL bOrientation, CMFCSpinButtonCtrl* pSpinCtrl)override;
125 virtual void OnDrawSpinButtons(CDC* pDC, CRect rectSpinUp, CRect rectSpinDown, int nState, BOOL bOrientation, CMFCSpinButtonCtrl* pSpinCtrl);
126
127 // Utility fns to lighten or darken colour
128 static COLORREF LightenColor(long lScale, COLORREF lColor);
129 static COLORREF DarkenColor(long lScale, COLORREF lColor);
130
131private:
132 static CGUIVisualManager* GetObject();
133
134protected:
135 UINT m_nAppTheme;
136
137 // MDI background color
138 BOOL m_bCustomMDIClientAreaClr;
139 COLORREF m_clrMDIClientArea;
140 COLORREF m_clrMDIClientLightArea;
141
142 // Bar background color
143 COLORREF m_clrBarBackgroundDefault;
144
145 // Menu bar background color
146 COLORREF m_clrMenuBarBackground;
147
148 // Pane divider color
149 COLORREF m_clrPaneDivider;
150
151 // Pane base color
152 COLORREF m_clrPaneBase;
153
154 // MiniFrame color
155 COLORREF m_clrMiniFrameBackgroundDefault;
156 COLORREF m_clrMiniFrameBackgroundInactive;
157 COLORREF m_clrMiniFrameBorder;
158
159 // Text color
160 COLORREF m_clrTextDefault;
161 COLORREF m_clrTextHighlighted;
162 COLORREF m_clrTextDisabled;
163
164 // Caption Text color
165 COLORREF m_clrCaptionTextDefault;
166 COLORREF m_clrCaptionTextHighlighted;
167 COLORREF m_clrCaptionTextInactive;
168 COLORREF m_clrCaptionTextDisabled;
169
170
172 // color values of system colors used for CToolBar
173 COLORREF m_clrBtnFace, m_clrBtnShadow, m_clrBtnHilite;
174 COLORREF m_clrBtnText, m_clrWindowFrame;
175 COLORREF m_clrBtnDkShadow, m_clrBtnLight;
176 COLORREF m_clrGrayedText;
177 COLORREF m_clrHilite;
178 COLORREF m_clrTextHilite;
179 COLORREF m_clrHotLinkNormalText;
180 COLORREF m_clrHotLinkHoveredText;
181 COLORREF m_clrHotLinkVisitedText;
182
183 COLORREF m_clrBarWindow;
184 COLORREF m_clrBarFace;
185 COLORREF m_clrBarShadow, m_clrBarHilite;
186 COLORREF m_clrBarDkShadow, m_clrBarLight;
187 COLORREF m_clrBarText;
188
189 COLORREF m_clrWindow;
190 COLORREF m_clrWindowText;
191
192 COLORREF m_clrCaptionText;
193 COLORREF m_clrMenuText;
194 COLORREF m_clrActiveCaption;
195 COLORREF m_clrInactiveCaption;
196 COLORREF m_clrInactiveCaptionText;
199 COLORREF m_clrActiveCaptionGradient;
202 COLORREF m_clrInactiveCaptionGradient;
203
204 COLORREF m_clrActiveBorder;
205 COLORREF m_clrInactiveBorder;
206
207 COLORREF m_clrToolBarColorHover;
208 COLORREF m_clrToolBarColorChecked;
209 COLORREF m_clrToolBarColorHoverEdge;
210
211 COLORREF m_clrTabsArea;
212
213 COLORREF m_clrPropertyFace;
214 COLORREF m_clrPropertyGroupBackground;
215
216
217 // Auto-hide buttons:
218 COLORREF m_clrAutoHideButtonBackground;
219 COLORREF m_clrAutoHideButtonBorder;
220 COLORREF m_clrAutoHideButtonTextColor;
221
222 // System menu button
223 int32_t m_i32SystemMenuButtonNormal;
224 int32_t m_i32SystemMenuButtonHighlighted;
225};
226
227