SavvyUI C++ UI Library
Loading...
Searching...
No Matches
Theme.h
Go to the documentation of this file.
1#pragma once
2
3#include "Common.h"
4
11class Theme
12{
13 HBRUSH _hBackgroundBrush;
14 HBRUSH _hLabelBrush;
15 HBRUSH _hInputFieldBrush;
16 HBRUSH _hBtnBrush;
17
18 HFONT _hDefaultFont;
19
20 wstring _currentTheme;
21
22 wstring _savedThemeFilePath;
23
24public:
29
33 virtual ~Theme();
34
40 static Theme* GetInstance();
41
49
57
65
73
82
84
85 void saveTheme();
86 void loadTheme();
87
88 void ButtonTypeToColors(const ButtonType& btnType, COLORREF& startBkColor, COLORREF& endBkColor, COLORREF& color);
89
96
108 HFONT setFont(WinHandle hWnd, long fontSize, BOOL isBold = FALSE, BOOL isItalic = FALSE, BOOL isUnderlined = FALSE, const wstring& fontName = L"Arial");
109
110public:
111 static COLORREF BackgroundColor;
112 static COLORREF ForegroundColor;
115 static COLORREF CaptionForegroundColor;
116 static COLORREF ComponentBackgroundColor;
117 static COLORREF ComponentForegroundColor;
118 static COLORREF DisabledForegroundColor;
119 static COLORREF SelectionBackgroundColor;
120 static COLORREF SelectionForegroundColor;
123 static COLORREF IconBackgroundColor;
124 static COLORREF IconForegroundColor;
125
127 static COLORREF ButtonBackgroundEndColor;
128 static COLORREF ButtonForegroundColor;
129
133
137
141
145
149
153
157
161
165
169
173
177
181
185
189
193
196 static COLORREF ButtonRedForegroundColor;
197
199 static COLORREF HeaderBackgroundEndColor;
200 static COLORREF HeaderForegroundColor;
201
202 static COLORREF LinkColor;
203 static COLORREF LineColor;
204 static COLORREF DangerColor;
205 static COLORREF ShadowColor;
206};
HWND WinHandle
Definition Common.h:16
HDC DCHandle
Definition Common.h:17
ButtonType
Definition Common.h:159
static COLORREF ButtonOrangeBackgroundStartColor
Definition Theme.h:182
static COLORREF BackgroundColor
Definition Theme.h:111
static COLORREF ButtonGrayForegroundColor
Definition Theme.h:152
static COLORREF ComponentForegroundColor
Definition Theme.h:117
static COLORREF ButtonDangerBackgroundStartColor
Definition Theme.h:138
void loadTheme()
void setDarkTheme()
static COLORREF ButtonBackgroundEndColor
Definition Theme.h:127
static COLORREF ButtonRedBackgroundStartColor
Definition Theme.h:194
static COLORREF CaptionForegroundColor
Definition Theme.h:115
static COLORREF ComponentBackgroundColor
Definition Theme.h:116
static COLORREF CaptionBackgroundEndColor
Definition Theme.h:114
static COLORREF ButtonRedBackgroundEndColor
Definition Theme.h:195
static COLORREF ButtonSilverForegroundColor
Definition Theme.h:192
static COLORREF ButtonBrownForegroundColor
Definition Theme.h:188
static COLORREF ButtonBlueBackgroundEndColor
Definition Theme.h:159
static COLORREF ButtonSuccessBackgroundEndColor
Definition Theme.h:143
static COLORREF ButtonRedForegroundColor
Definition Theme.h:196
static COLORREF ForegroundColor
Definition Theme.h:112
static COLORREF ButtonInfoBackgroundEndColor
Definition Theme.h:135
static COLORREF ButtonOrangeBackgroundEndColor
Definition Theme.h:183
static COLORREF ButtonLightBlueBackgroundEndColor
Definition Theme.h:163
void saveTheme()
static COLORREF GridAlternateForegroundColor
Definition Theme.h:122
void setSilverTheme()
static COLORREF ButtonIndigoBackgroundStartColor
Definition Theme.h:178
static COLORREF ButtonLightBlueBackgroundStartColor
Definition Theme.h:162
static COLORREF IconBackgroundColor
Definition Theme.h:123
static COLORREF ButtonTealBackgroundEndColor
Definition Theme.h:167
static COLORREF ButtonWarnBackgroundStartColor
Definition Theme.h:146
static COLORREF ButtonPrimaryForegroundColor
Definition Theme.h:132
static COLORREF ButtonSilverBackgroundStartColor
Definition Theme.h:190
static COLORREF ButtonLightGrayBackgroundEndColor
Definition Theme.h:155
static COLORREF ButtonSilverBackgroundEndColor
Definition Theme.h:191
HBRUSH createLabelBrush(DCHandle hDC)
Creates or retrieves a label brush.
static COLORREF ButtonDangerForegroundColor
Definition Theme.h:140
static COLORREF ButtonOrangeForegroundColor
Definition Theme.h:184
static COLORREF ButtonPinkForegroundColor
Definition Theme.h:176
static COLORREF DangerColor
Definition Theme.h:204
void ButtonTypeToColors(const ButtonType &btnType, COLORREF &startBkColor, COLORREF &endBkColor, COLORREF &color)
static COLORREF ButtonSuccessBackgroundStartColor
Definition Theme.h:142
static COLORREF ButtonBrownBackgroundEndColor
Definition Theme.h:187
static COLORREF HeaderBackgroundEndColor
Definition Theme.h:199
HBRUSH createInputFieldBrush(DCHandle hDC)
Creates or retrieves an input field brush.
static COLORREF ButtonBlueBackgroundStartColor
Definition Theme.h:158
static COLORREF ButtonGrayBackgroundStartColor
Definition Theme.h:150
static COLORREF ButtonTealBackgroundStartColor
Definition Theme.h:166
Theme()
Constructs a new Theme object.
static COLORREF ButtonBrownBackgroundStartColor
Definition Theme.h:186
static COLORREF ButtonGrayBackgroundEndColor
Definition Theme.h:151
void setDefaultFont(WinHandle hWnd)
Sets the default font for a window.
static COLORREF ButtonIndigoBackgroundEndColor
Definition Theme.h:179
static COLORREF ButtonCyanForegroundColor
Definition Theme.h:172
static COLORREF HeaderBackgroundStartColor
Definition Theme.h:198
static COLORREF ButtonSuccessForegroundColor
Definition Theme.h:144
HBRUSH createButtonBrush(DCHandle hDC)
Creates or retrieves a button brush.
void setGoldTheme()
static COLORREF ButtonLightBlueForegroundColor
Definition Theme.h:164
static COLORREF SelectionForegroundColor
Definition Theme.h:120
static COLORREF ButtonForegroundColor
Definition Theme.h:128
static COLORREF ButtonCyanBackgroundStartColor
Definition Theme.h:170
static COLORREF ButtonDangerBackgroundEndColor
Definition Theme.h:139
static COLORREF DisabledForegroundColor
Definition Theme.h:118
void setDefaultTheme()
These functions are used to set the application theme - Must be called from the constructor of the Fr...
static COLORREF ButtonPrimaryBackgroundStartColor
Definition Theme.h:130
static COLORREF LinkColor
Definition Theme.h:202
static COLORREF ButtonCyanBackgroundEndColor
Definition Theme.h:171
static COLORREF LineColor
Definition Theme.h:203
static COLORREF ButtonPinkBackgroundEndColor
Definition Theme.h:175
static COLORREF ButtonWarnForegroundColor
Definition Theme.h:148
static COLORREF GridAlternateBackgroundColor
Definition Theme.h:121
static COLORREF ButtonIndigoForegroundColor
Definition Theme.h:180
virtual ~Theme()
Destructor.
static Theme * GetInstance()
Returns a singleton instance of Theme.
static COLORREF ButtonInfoBackgroundStartColor
Definition Theme.h:134
void setTaupeTheme()
static COLORREF ButtonBackgroundStartColor
Definition Theme.h:126
static COLORREF ShadowColor
Definition Theme.h:205
static COLORREF HeaderForegroundColor
Definition Theme.h:200
static COLORREF ButtonTealForegroundColor
Definition Theme.h:168
static COLORREF SelectionBackgroundColor
Definition Theme.h:119
static COLORREF ButtonPrimaryBackgroundEndColor
Definition Theme.h:131
static COLORREF CaptionBackgroundStartColor
Definition Theme.h:113
static COLORREF ButtonLightGrayForegroundColor
Definition Theme.h:156
HFONT setFont(WinHandle hWnd, long fontSize, BOOL isBold=FALSE, BOOL isItalic=FALSE, BOOL isUnderlined=FALSE, const wstring &fontName=L"Arial")
Sets the font for a window with specified properties.
static COLORREF IconForegroundColor
Definition Theme.h:124
static COLORREF ButtonBlueForegroundColor
Definition Theme.h:160
static COLORREF ButtonWarnBackgroundEndColor
Definition Theme.h:147
static COLORREF ButtonPinkBackgroundStartColor
Definition Theme.h:174
static COLORREF ButtonInfoForegroundColor
Definition Theme.h:136
HBRUSH createBackgroundBrush(DCHandle hDC)
Creates or retrieves a background brush.
static COLORREF ButtonLightGrayBackgroundStartColor
Definition Theme.h:154
void toggleTheme()