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
22public:
27
31 virtual ~Theme();
32
38 static Theme* GetInstance();
39
47
55
63
71
79
80 void ButtonTypeToColors(const ButtonType& btnType, COLORREF& startBkColor, COLORREF& endBkColor, COLORREF& color);
81
88
100 HFONT setFont(WinHandle hWnd, long fontSize, BOOL isBold = FALSE, BOOL isItalic = FALSE, BOOL isUnderlined = FALSE, const wstring& fontName = L"Arial");
101
102public:
103 static COLORREF BackgroundColor;
104 static COLORREF ForegroundColor;
105 static COLORREF ComponentBackgroundColor;
106 static COLORREF ComponentForegroundColor;
107 static COLORREF DisabledForegroundColor;
108 static COLORREF SelectionBackgroundColor;
109 static COLORREF SelectionForegroundColor;
112
114 static COLORREF ButtonBackgroundEndColor;
115 static COLORREF ButtonForegroundColor;
116
120
124
128
132
136
140
144
148
152
156
160
164
168
172
176
180
183 static COLORREF ButtonRedForegroundColor;
184
186 static COLORREF HeaderBackgroundEndColor;
187 static COLORREF HeaderForegroundColor;
188
189 static COLORREF LinkColor;
190 static COLORREF LineColor;
191 static COLORREF DangerColor;
192 static COLORREF ShadowColor;
193};
HWND WinHandle
Definition Common.h:16
HDC DCHandle
Definition Common.h:17
ButtonType
Definition Common.h:151
static COLORREF ButtonOrangeBackgroundStartColor
Definition Theme.h:169
static COLORREF BackgroundColor
Definition Theme.h:103
static COLORREF ButtonGrayForegroundColor
Definition Theme.h:139
static COLORREF ComponentForegroundColor
Definition Theme.h:106
static COLORREF ButtonDangerBackgroundStartColor
Definition Theme.h:125
void setDarkTheme()
static COLORREF ButtonBackgroundEndColor
Definition Theme.h:114
static COLORREF ButtonRedBackgroundStartColor
Definition Theme.h:181
static COLORREF ComponentBackgroundColor
Definition Theme.h:105
static COLORREF ButtonRedBackgroundEndColor
Definition Theme.h:182
static COLORREF ButtonSilverForegroundColor
Definition Theme.h:179
static COLORREF ButtonBrownForegroundColor
Definition Theme.h:175
static COLORREF ButtonBlueBackgroundEndColor
Definition Theme.h:146
static COLORREF ButtonSuccessBackgroundEndColor
Definition Theme.h:130
static COLORREF ButtonRedForegroundColor
Definition Theme.h:183
static COLORREF ForegroundColor
Definition Theme.h:104
static COLORREF ButtonInfoBackgroundEndColor
Definition Theme.h:122
static COLORREF ButtonOrangeBackgroundEndColor
Definition Theme.h:170
static COLORREF ButtonLightBlueBackgroundEndColor
Definition Theme.h:150
static COLORREF GridAlternateForegroundColor
Definition Theme.h:111
void setSilverTheme()
static COLORREF ButtonIndigoBackgroundStartColor
Definition Theme.h:165
static COLORREF ButtonLightBlueBackgroundStartColor
Definition Theme.h:149
static COLORREF ButtonTealBackgroundEndColor
Definition Theme.h:154
static COLORREF ButtonWarnBackgroundStartColor
Definition Theme.h:133
static COLORREF ButtonPrimaryForegroundColor
Definition Theme.h:119
static COLORREF ButtonSilverBackgroundStartColor
Definition Theme.h:177
static COLORREF ButtonLightGrayBackgroundEndColor
Definition Theme.h:142
static COLORREF ButtonSilverBackgroundEndColor
Definition Theme.h:178
HBRUSH createLabelBrush(DCHandle hDC)
Creates or retrieves a label brush.
static COLORREF ButtonDangerForegroundColor
Definition Theme.h:127
static COLORREF ButtonOrangeForegroundColor
Definition Theme.h:171
static COLORREF ButtonPinkForegroundColor
Definition Theme.h:163
static COLORREF DangerColor
Definition Theme.h:191
void ButtonTypeToColors(const ButtonType &btnType, COLORREF &startBkColor, COLORREF &endBkColor, COLORREF &color)
static COLORREF ButtonSuccessBackgroundStartColor
Definition Theme.h:129
static COLORREF ButtonBrownBackgroundEndColor
Definition Theme.h:174
static COLORREF HeaderBackgroundEndColor
Definition Theme.h:186
HBRUSH createInputFieldBrush(DCHandle hDC)
Creates or retrieves an input field brush.
static COLORREF ButtonBlueBackgroundStartColor
Definition Theme.h:145
static COLORREF ButtonGrayBackgroundStartColor
Definition Theme.h:137
static COLORREF ButtonTealBackgroundStartColor
Definition Theme.h:153
Theme()
Constructs a new Theme object.
static COLORREF ButtonBrownBackgroundStartColor
Definition Theme.h:173
static COLORREF ButtonGrayBackgroundEndColor
Definition Theme.h:138
void setDefaultFont(WinHandle hWnd)
Sets the default font for a window.
static COLORREF ButtonIndigoBackgroundEndColor
Definition Theme.h:166
static COLORREF ButtonCyanForegroundColor
Definition Theme.h:159
static COLORREF HeaderBackgroundStartColor
Definition Theme.h:185
static COLORREF ButtonSuccessForegroundColor
Definition Theme.h:131
HBRUSH createButtonBrush(DCHandle hDC)
Creates or retrieves a button brush.
static COLORREF ButtonLightBlueForegroundColor
Definition Theme.h:151
static COLORREF SelectionForegroundColor
Definition Theme.h:109
static COLORREF ButtonForegroundColor
Definition Theme.h:115
static COLORREF ButtonCyanBackgroundStartColor
Definition Theme.h:157
static COLORREF ButtonDangerBackgroundEndColor
Definition Theme.h:126
static COLORREF DisabledForegroundColor
Definition Theme.h:107
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:117
static COLORREF LinkColor
Definition Theme.h:189
static COLORREF ButtonCyanBackgroundEndColor
Definition Theme.h:158
static COLORREF LineColor
Definition Theme.h:190
static COLORREF ButtonPinkBackgroundEndColor
Definition Theme.h:162
static COLORREF ButtonWarnForegroundColor
Definition Theme.h:135
static COLORREF GridAlternateBackgroundColor
Definition Theme.h:110
static COLORREF ButtonIndigoForegroundColor
Definition Theme.h:167
virtual ~Theme()
Destructor.
static Theme * GetInstance()
Returns a singleton instance of Theme.
static COLORREF ButtonInfoBackgroundStartColor
Definition Theme.h:121
static COLORREF ButtonBackgroundStartColor
Definition Theme.h:113
static COLORREF ShadowColor
Definition Theme.h:192
static COLORREF HeaderForegroundColor
Definition Theme.h:187
static COLORREF ButtonTealForegroundColor
Definition Theme.h:155
static COLORREF SelectionBackgroundColor
Definition Theme.h:108
static COLORREF ButtonPrimaryBackgroundEndColor
Definition Theme.h:118
static COLORREF ButtonLightGrayForegroundColor
Definition Theme.h:143
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 ButtonBlueForegroundColor
Definition Theme.h:147
static COLORREF ButtonWarnBackgroundEndColor
Definition Theme.h:134
static COLORREF ButtonPinkBackgroundStartColor
Definition Theme.h:161
static COLORREF ButtonInfoForegroundColor
Definition Theme.h:123
HBRUSH createBackgroundBrush(DCHandle hDC)
Creates or retrieves a background brush.
static COLORREF ButtonLightGrayBackgroundStartColor
Definition Theme.h:141
void toggleTheme()