TGUI  v0.7.5

Base class for the Theme classes. More...

#include <Theme.hpp>

Inheritance diagram for tgui::BaseTheme:
tgui::Theme

Public Member Functions

virtual ~BaseTheme ()=default
 Virtual destructor.
 
virtual void widgetAttached (Widget *widget)
 Virtual function that gets called when a widget is connected to this theme. More...
 
virtual void widgetDetached (Widget *widget)
 Virtual function that gets called when a widget is disconnected from this theme. More...
 
virtual WidgetConverter internalLoad (const std::string &primary, const std::string &secondary)=0
 This function can be used inside a widget to load other widgets without access to the derived theme class. More...
 
virtual void initWidget (Widget *widget, std::string primary, std::string secondary)=0
 Virtual function called by the widget to finish its initialization. More...
 

Static Public Member Functions

static void setConstructFunction (const std::string &type, const std::function< Widget::Ptr()> &constructor)
 Changes the construct function of a specific widget type. More...
 
static void setThemeLoader (const std::shared_ptr< BaseThemeLoader > &themeLoader)
 Change the function that will load the widget theme data. More...
 

Static Protected Attributes

static std::map< std::string, std::function< Widget::Ptr()> > m_constructors
 Widget creator functions.
 
static std::shared_ptr< BaseThemeLoaderm_themeLoader
 Theme loading functions, they read the theme file.
 

Detailed Description

Base class for the Theme classes.

Member Function Documentation

◆ initWidget()

virtual void tgui::BaseTheme::initWidget ( Widget widget,
std::string  primary,
std::string  secondary 
)
pure virtual

Virtual function called by the widget to finish its initialization.

Parameters
widgetThe widget that needs to be initialized
primaryPrimary parameter of the loader
secondarySecondary parameter of the loader

Implemented in tgui::Theme.

◆ internalLoad()

virtual WidgetConverter tgui::BaseTheme::internalLoad ( const std::string &  primary,
const std::string &  secondary 
)
pure virtual

This function can be used inside a widget to load other widgets without access to the derived theme class.

Parameters
primaryPrimary parameter of the loader
secondarySecondary parameter of the loader

Implemented in tgui::Theme.

◆ setConstructFunction()

static void tgui::BaseTheme::setConstructFunction ( const std::string &  type,
const std::function< Widget::Ptr()> &  constructor 
)
static

Changes the construct function of a specific widget type.

Parameters
typeType of the widget which will cause this construct function to be used
constructorNew function to be called when this type of widget is being loaded

◆ setThemeLoader()

static void tgui::BaseTheme::setThemeLoader ( const std::shared_ptr< BaseThemeLoader > &  themeLoader)
static

Change the function that will load the widget theme data.

Parameters
themeLoaderPointer to the new loader

◆ widgetAttached()

virtual void tgui::BaseTheme::widgetAttached ( Widget widget)
virtual

Virtual function that gets called when a widget is connected to this theme.

Parameters
widgetThe widget that was attached to this theme

◆ widgetDetached()

virtual void tgui::BaseTheme::widgetDetached ( Widget widget)
virtual

Virtual function that gets called when a widget is disconnected from this theme.

Parameters
widgetThe widget that was detached from this theme

Reimplemented in tgui::Theme.


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