SavvyUI C++ UI Library
|
Represents a UI theme, managing brushes, fonts, and colors. More...
#include <Theme.h>
Public Member Functions | |
Theme () | |
Constructs a new Theme object. | |
virtual | ~Theme () |
Destructor. | |
HBRUSH | createBackgroundBrush (DCHandle hDC) |
Creates or retrieves a background brush. | |
HBRUSH | createLabelBrush (DCHandle hDC) |
Creates or retrieves a label brush. | |
HBRUSH | createInputFieldBrush (DCHandle hDC) |
Creates or retrieves an input field brush. | |
HBRUSH | createButtonBrush (DCHandle hDC) |
Creates or retrieves a button brush. | |
void | setDefaultTheme () |
These functions are used to set the application theme - Must be called from the constructor of the Frame class. | |
void | setDarkTheme () |
void | setSilverTheme () |
void | toggleTheme () |
void | ButtonTypeToColors (const ButtonType &btnType, COLORREF &startBkColor, COLORREF &endBkColor, COLORREF &color) |
void | setDefaultFont (WinHandle hWnd) |
Sets the default font for a window. | |
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 Public Member Functions | |
static Theme * | GetInstance () |
Returns a singleton instance of Theme. |
Represents a UI theme, managing brushes, fonts, and colors.
Provides access to commonly used brushes and fonts, and manages color definitions for various UI components.
Theme::Theme | ( | ) |
Constructs a new Theme object.
|
virtual |
Destructor.
void Theme::ButtonTypeToColors | ( | const ButtonType & | btnType, |
COLORREF & | startBkColor, | ||
COLORREF & | endBkColor, | ||
COLORREF & | color ) |
HBRUSH Theme::createBackgroundBrush | ( | DCHandle | hDC | ) |
Creates or retrieves a background brush.
hDC | Handle to device context. |
HBRUSH Theme::createButtonBrush | ( | DCHandle | hDC | ) |
Creates or retrieves a button brush.
hDC | Handle to device context. |
HBRUSH Theme::createInputFieldBrush | ( | DCHandle | hDC | ) |
Creates or retrieves an input field brush.
hDC | Handle to device context. |
HBRUSH Theme::createLabelBrush | ( | DCHandle | hDC | ) |
Creates or retrieves a label brush.
hDC | Handle to device context. |
|
static |
void Theme::setDarkTheme | ( | ) |
void Theme::setDefaultFont | ( | WinHandle | hWnd | ) |
Sets the default font for a window.
hWnd | Handle to the window. |
void Theme::setDefaultTheme | ( | ) |
These functions are used to set the application theme - Must be called from the constructor of the Frame class.
HFONT Theme::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.
hWnd | Handle to the window. |
fontSize | Desired font size. |
isBold | TRUE to use bold font, default FALSE. |
isItalic | TRUE to use italic font, default FALSE. |
isUnderlined | TRUE to use underlined font, default FALSE. |
fontName | Name of the font face, default "Arial". |
void Theme::setSilverTheme | ( | ) |
void Theme::toggleTheme | ( | ) |
|
static |
General background color
|
static |
Button background gradient end
|
static |
Button background gradient start
|
static |
Blue button background gradient end
|
static |
Blue button background gradient start
|
static |
Blue button foreground color
|
static |
Brown button background gradient end
|
static |
Brown button background gradient start
|
static |
Brown button foreground color
|
static |
Cyan button background gradient end
|
static |
Cyan button background gradient start
|
static |
Cyan button foreground color
|
static |
Danger button background gradient end
|
static |
Danger button background gradient start
|
static |
Danger button foreground color
|
static |
Button foreground color
|
static |
Gray button background gradient end
|
static |
Gray button background gradient start
|
static |
Gray button foreground color
|
static |
Indigo button background gradient end
|
static |
Indigo button background gradient start
|
static |
Indigo button foreground color
|
static |
Info button background gradient end
|
static |
Info button background gradient start
|
static |
Info button foreground color
|
static |
LightBlue button background gradient end
|
static |
LightBlue button background gradient start
|
static |
LightBlue button foreground color
|
static |
LightGray button background gradient end
|
static |
LightGray button background gradient start
|
static |
LightGray button foreground color
|
static |
Orange button background gradient end
|
static |
Orange button background gradient start
|
static |
Orange button foreground color
|
static |
Pink button background gradient end
|
static |
Pink button background gradient start
|
static |
Pink button foreground color
|
static |
Primary button background gradient end
|
static |
Primary button background gradient start
|
static |
Primary button foreground color
|
static |
Red button background gradient end
|
static |
Red button background gradient start
|
static |
Red button foreground color
|
static |
Silver button background gradient end
|
static |
Silver button background gradient start
|
static |
Silver button foreground color
|
static |
Success button background gradient end
|
static |
Success button background gradient start
|
static |
Success button foreground color
|
static |
Teal button background gradient end
|
static |
Teal button background gradient start
|
static |
Teal button foreground color
|
static |
Warn button background gradient end
|
static |
Warn button background gradient start
|
static |
Warn button foreground color
|
static |
Component background color
|
static |
Component foreground color
|
static |
Color used for error/danger states
|
static |
Disabled text color
|
static |
General foreground color
|
static |
|
static |
|
static |
Header background gradient end
|
static |
Header background gradient start
|
static |
Header foreground color
|
static |
Color used for lines and borders
|
static |
Color used for hyperlinks
|
static |
Selection background color
|
static |
Selection foreground color
|
static |
Color used for shadow background color