SavvyUI C++ UI Library
Loading...
Searching...
No Matches
Theme Class Reference

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 ThemeGetInstance ()
 Returns a singleton instance of Theme.

Static Public Attributes

static COLORREF BackgroundColor
static COLORREF ForegroundColor
static COLORREF ComponentBackgroundColor
static COLORREF ComponentForegroundColor
static COLORREF DisabledForegroundColor
static COLORREF SelectionBackgroundColor
static COLORREF SelectionForegroundColor
static COLORREF GridAlternateBackgroundColor
static COLORREF GridAlternateForegroundColor
static COLORREF ButtonBackgroundStartColor
static COLORREF ButtonBackgroundEndColor
static COLORREF ButtonForegroundColor
static COLORREF ButtonPrimaryBackgroundStartColor
static COLORREF ButtonPrimaryBackgroundEndColor
static COLORREF ButtonPrimaryForegroundColor
static COLORREF ButtonInfoBackgroundStartColor
static COLORREF ButtonInfoBackgroundEndColor
static COLORREF ButtonInfoForegroundColor
static COLORREF ButtonDangerBackgroundStartColor
static COLORREF ButtonDangerBackgroundEndColor
static COLORREF ButtonDangerForegroundColor
static COLORREF ButtonSuccessBackgroundStartColor
static COLORREF ButtonSuccessBackgroundEndColor
static COLORREF ButtonSuccessForegroundColor
static COLORREF ButtonWarnBackgroundStartColor
static COLORREF ButtonWarnBackgroundEndColor
static COLORREF ButtonWarnForegroundColor
static COLORREF ButtonGrayBackgroundStartColor
static COLORREF ButtonGrayBackgroundEndColor
static COLORREF ButtonGrayForegroundColor
static COLORREF ButtonLightGrayBackgroundStartColor
static COLORREF ButtonLightGrayBackgroundEndColor
static COLORREF ButtonLightGrayForegroundColor
static COLORREF ButtonBlueBackgroundStartColor
static COLORREF ButtonBlueBackgroundEndColor
static COLORREF ButtonBlueForegroundColor
static COLORREF ButtonLightBlueBackgroundStartColor
static COLORREF ButtonLightBlueBackgroundEndColor
static COLORREF ButtonLightBlueForegroundColor
static COLORREF ButtonTealBackgroundStartColor
static COLORREF ButtonTealBackgroundEndColor
static COLORREF ButtonTealForegroundColor
static COLORREF ButtonCyanBackgroundStartColor
static COLORREF ButtonCyanBackgroundEndColor
static COLORREF ButtonCyanForegroundColor
static COLORREF ButtonPinkBackgroundStartColor
static COLORREF ButtonPinkBackgroundEndColor
static COLORREF ButtonPinkForegroundColor
static COLORREF ButtonIndigoBackgroundStartColor
static COLORREF ButtonIndigoBackgroundEndColor
static COLORREF ButtonIndigoForegroundColor
static COLORREF ButtonOrangeBackgroundStartColor
static COLORREF ButtonOrangeBackgroundEndColor
static COLORREF ButtonOrangeForegroundColor
static COLORREF ButtonBrownBackgroundStartColor
static COLORREF ButtonBrownBackgroundEndColor
static COLORREF ButtonBrownForegroundColor
static COLORREF ButtonSilverBackgroundStartColor
static COLORREF ButtonSilverBackgroundEndColor
static COLORREF ButtonSilverForegroundColor
static COLORREF ButtonRedBackgroundStartColor
static COLORREF ButtonRedBackgroundEndColor
static COLORREF ButtonRedForegroundColor
static COLORREF HeaderBackgroundStartColor
static COLORREF HeaderBackgroundEndColor
static COLORREF HeaderForegroundColor
static COLORREF LinkColor
static COLORREF LineColor
static COLORREF DangerColor
static COLORREF ShadowColor

Detailed Description

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.

Constructor & Destructor Documentation

◆ Theme()

Theme::Theme ( )

Constructs a new Theme object.

◆ ~Theme()

virtual Theme::~Theme ( )
virtual

Destructor.

Member Function Documentation

◆ ButtonTypeToColors()

void Theme::ButtonTypeToColors ( const ButtonType & btnType,
COLORREF & startBkColor,
COLORREF & endBkColor,
COLORREF & color )

◆ createBackgroundBrush()

HBRUSH Theme::createBackgroundBrush ( DCHandle hDC)

Creates or retrieves a background brush.

Parameters
hDCHandle to device context.
Returns
Handle to the background brush.

◆ createButtonBrush()

HBRUSH Theme::createButtonBrush ( DCHandle hDC)

Creates or retrieves a button brush.

Parameters
hDCHandle to device context.
Returns
Handle to the button brush.

◆ createInputFieldBrush()

HBRUSH Theme::createInputFieldBrush ( DCHandle hDC)

Creates or retrieves an input field brush.

Parameters
hDCHandle to device context.
Returns
Handle to the input field brush.

◆ createLabelBrush()

HBRUSH Theme::createLabelBrush ( DCHandle hDC)

Creates or retrieves a label brush.

Parameters
hDCHandle to device context.
Returns
Handle to the label brush.

◆ GetInstance()

Theme * Theme::GetInstance ( )
static

Returns a singleton instance of Theme.

Returns
Pointer to the Theme instance.

◆ setDarkTheme()

void Theme::setDarkTheme ( )

◆ setDefaultFont()

void Theme::setDefaultFont ( WinHandle hWnd)

Sets the default font for a window.

Parameters
hWndHandle to the window.

◆ setDefaultTheme()

void Theme::setDefaultTheme ( )

These functions are used to set the application theme - Must be called from the constructor of the Frame class.

◆ setFont()

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.

Parameters
hWndHandle to the window.
fontSizeDesired font size.
isBoldTRUE to use bold font, default FALSE.
isItalicTRUE to use italic font, default FALSE.
isUnderlinedTRUE to use underlined font, default FALSE.
fontNameName of the font face, default "Arial".
Returns
Handle to the created font.

◆ setSilverTheme()

void Theme::setSilverTheme ( )

◆ toggleTheme()

void Theme::toggleTheme ( )

Member Data Documentation

◆ BackgroundColor

COLORREF Theme::BackgroundColor
static

General background color

◆ ButtonBackgroundEndColor

COLORREF Theme::ButtonBackgroundEndColor
static

Button background gradient end

◆ ButtonBackgroundStartColor

COLORREF Theme::ButtonBackgroundStartColor
static

Button background gradient start

◆ ButtonBlueBackgroundEndColor

COLORREF Theme::ButtonBlueBackgroundEndColor
static

Blue button background gradient end

◆ ButtonBlueBackgroundStartColor

COLORREF Theme::ButtonBlueBackgroundStartColor
static

Blue button background gradient start

◆ ButtonBlueForegroundColor

COLORREF Theme::ButtonBlueForegroundColor
static

Blue button foreground color

◆ ButtonBrownBackgroundEndColor

COLORREF Theme::ButtonBrownBackgroundEndColor
static

Brown button background gradient end

◆ ButtonBrownBackgroundStartColor

COLORREF Theme::ButtonBrownBackgroundStartColor
static

Brown button background gradient start

◆ ButtonBrownForegroundColor

COLORREF Theme::ButtonBrownForegroundColor
static

Brown button foreground color

◆ ButtonCyanBackgroundEndColor

COLORREF Theme::ButtonCyanBackgroundEndColor
static

Cyan button background gradient end

◆ ButtonCyanBackgroundStartColor

COLORREF Theme::ButtonCyanBackgroundStartColor
static

Cyan button background gradient start

◆ ButtonCyanForegroundColor

COLORREF Theme::ButtonCyanForegroundColor
static

Cyan button foreground color

◆ ButtonDangerBackgroundEndColor

COLORREF Theme::ButtonDangerBackgroundEndColor
static

Danger button background gradient end

◆ ButtonDangerBackgroundStartColor

COLORREF Theme::ButtonDangerBackgroundStartColor
static

Danger button background gradient start

◆ ButtonDangerForegroundColor

COLORREF Theme::ButtonDangerForegroundColor
static

Danger button foreground color

◆ ButtonForegroundColor

COLORREF Theme::ButtonForegroundColor
static

Button foreground color

◆ ButtonGrayBackgroundEndColor

COLORREF Theme::ButtonGrayBackgroundEndColor
static

Gray button background gradient end

◆ ButtonGrayBackgroundStartColor

COLORREF Theme::ButtonGrayBackgroundStartColor
static

Gray button background gradient start

◆ ButtonGrayForegroundColor

COLORREF Theme::ButtonGrayForegroundColor
static

Gray button foreground color

◆ ButtonIndigoBackgroundEndColor

COLORREF Theme::ButtonIndigoBackgroundEndColor
static

Indigo button background gradient end

◆ ButtonIndigoBackgroundStartColor

COLORREF Theme::ButtonIndigoBackgroundStartColor
static

Indigo button background gradient start

◆ ButtonIndigoForegroundColor

COLORREF Theme::ButtonIndigoForegroundColor
static

Indigo button foreground color

◆ ButtonInfoBackgroundEndColor

COLORREF Theme::ButtonInfoBackgroundEndColor
static

Info button background gradient end

◆ ButtonInfoBackgroundStartColor

COLORREF Theme::ButtonInfoBackgroundStartColor
static

Info button background gradient start

◆ ButtonInfoForegroundColor

COLORREF Theme::ButtonInfoForegroundColor
static

Info button foreground color

◆ ButtonLightBlueBackgroundEndColor

COLORREF Theme::ButtonLightBlueBackgroundEndColor
static

LightBlue button background gradient end

◆ ButtonLightBlueBackgroundStartColor

COLORREF Theme::ButtonLightBlueBackgroundStartColor
static

LightBlue button background gradient start

◆ ButtonLightBlueForegroundColor

COLORREF Theme::ButtonLightBlueForegroundColor
static

LightBlue button foreground color

◆ ButtonLightGrayBackgroundEndColor

COLORREF Theme::ButtonLightGrayBackgroundEndColor
static

LightGray button background gradient end

◆ ButtonLightGrayBackgroundStartColor

COLORREF Theme::ButtonLightGrayBackgroundStartColor
static

LightGray button background gradient start

◆ ButtonLightGrayForegroundColor

COLORREF Theme::ButtonLightGrayForegroundColor
static

LightGray button foreground color

◆ ButtonOrangeBackgroundEndColor

COLORREF Theme::ButtonOrangeBackgroundEndColor
static

Orange button background gradient end

◆ ButtonOrangeBackgroundStartColor

COLORREF Theme::ButtonOrangeBackgroundStartColor
static

Orange button background gradient start

◆ ButtonOrangeForegroundColor

COLORREF Theme::ButtonOrangeForegroundColor
static

Orange button foreground color

◆ ButtonPinkBackgroundEndColor

COLORREF Theme::ButtonPinkBackgroundEndColor
static

Pink button background gradient end

◆ ButtonPinkBackgroundStartColor

COLORREF Theme::ButtonPinkBackgroundStartColor
static

Pink button background gradient start

◆ ButtonPinkForegroundColor

COLORREF Theme::ButtonPinkForegroundColor
static

Pink button foreground color

◆ ButtonPrimaryBackgroundEndColor

COLORREF Theme::ButtonPrimaryBackgroundEndColor
static

Primary button background gradient end

◆ ButtonPrimaryBackgroundStartColor

COLORREF Theme::ButtonPrimaryBackgroundStartColor
static

Primary button background gradient start

◆ ButtonPrimaryForegroundColor

COLORREF Theme::ButtonPrimaryForegroundColor
static

Primary button foreground color

◆ ButtonRedBackgroundEndColor

COLORREF Theme::ButtonRedBackgroundEndColor
static

Red button background gradient end

◆ ButtonRedBackgroundStartColor

COLORREF Theme::ButtonRedBackgroundStartColor
static

Red button background gradient start

◆ ButtonRedForegroundColor

COLORREF Theme::ButtonRedForegroundColor
static

Red button foreground color

◆ ButtonSilverBackgroundEndColor

COLORREF Theme::ButtonSilverBackgroundEndColor
static

Silver button background gradient end

◆ ButtonSilverBackgroundStartColor

COLORREF Theme::ButtonSilverBackgroundStartColor
static

Silver button background gradient start

◆ ButtonSilverForegroundColor

COLORREF Theme::ButtonSilverForegroundColor
static

Silver button foreground color

◆ ButtonSuccessBackgroundEndColor

COLORREF Theme::ButtonSuccessBackgroundEndColor
static

Success button background gradient end

◆ ButtonSuccessBackgroundStartColor

COLORREF Theme::ButtonSuccessBackgroundStartColor
static

Success button background gradient start

◆ ButtonSuccessForegroundColor

COLORREF Theme::ButtonSuccessForegroundColor
static

Success button foreground color

◆ ButtonTealBackgroundEndColor

COLORREF Theme::ButtonTealBackgroundEndColor
static

Teal button background gradient end

◆ ButtonTealBackgroundStartColor

COLORREF Theme::ButtonTealBackgroundStartColor
static

Teal button background gradient start

◆ ButtonTealForegroundColor

COLORREF Theme::ButtonTealForegroundColor
static

Teal button foreground color

◆ ButtonWarnBackgroundEndColor

COLORREF Theme::ButtonWarnBackgroundEndColor
static

Warn button background gradient end

◆ ButtonWarnBackgroundStartColor

COLORREF Theme::ButtonWarnBackgroundStartColor
static

Warn button background gradient start

◆ ButtonWarnForegroundColor

COLORREF Theme::ButtonWarnForegroundColor
static

Warn button foreground color

◆ ComponentBackgroundColor

COLORREF Theme::ComponentBackgroundColor
static

Component background color

◆ ComponentForegroundColor

COLORREF Theme::ComponentForegroundColor
static

Component foreground color

◆ DangerColor

COLORREF Theme::DangerColor
static

Color used for error/danger states

◆ DisabledForegroundColor

COLORREF Theme::DisabledForegroundColor
static

Disabled text color

◆ ForegroundColor

COLORREF Theme::ForegroundColor
static

General foreground color

◆ GridAlternateBackgroundColor

COLORREF Theme::GridAlternateBackgroundColor
static

◆ GridAlternateForegroundColor

COLORREF Theme::GridAlternateForegroundColor
static

◆ HeaderBackgroundEndColor

COLORREF Theme::HeaderBackgroundEndColor
static

Header background gradient end

◆ HeaderBackgroundStartColor

COLORREF Theme::HeaderBackgroundStartColor
static

Header background gradient start

◆ HeaderForegroundColor

COLORREF Theme::HeaderForegroundColor
static

Header foreground color

◆ LineColor

COLORREF Theme::LineColor
static

Color used for lines and borders

◆ LinkColor

COLORREF Theme::LinkColor
static

Color used for hyperlinks

◆ SelectionBackgroundColor

COLORREF Theme::SelectionBackgroundColor
static

Selection background color

◆ SelectionForegroundColor

COLORREF Theme::SelectionForegroundColor
static

Selection foreground color

◆ ShadowColor

COLORREF Theme::ShadowColor
static

Color used for shadow background color


The documentation for this class was generated from the following file: