![]() |
Gorgon Game Engine
|
This registry contains preset templates. More...
Public Member Functions | |
void | Add (TemplateType type, UI::Template &temp) |
Add the given template to the registry, transferring ownership. More... | |
virtual int | GetEmSize () const override |
virtual int | GetSpacing () const override |
void | SetEmSize (const int size) |
void | SetSpacing (const int tspacing) |
![]() | |
Registry (bool activate=false) | |
Default constructor. More... | |
virtual | ~Registry () |
Destroys all stored templates. More... | |
void | Activate () |
Activates this registry to be used to provide templates. More... | |
const UI::Template & | operator[] (TemplateType type) |
Returns the template for the requested type. More... | |
Protected Member Functions | |
virtual UI::Template & | generate (Gorgon::Widgets::Registry::TemplateType) override |
This function should return a template for the given type. More... | |
Protected Attributes | |
int | emsize |
int | spacing |
![]() | |
std::array< UI::Template *, Max > | templates |
Stores the templates. Mutable to allow late loading. More... | |
Additional Inherited Members | |
![]() | |
enum | TemplateType { Button_Regular, Button_Icon, Label_Regular, Label_Error, Checkbox_Regular, Checkbox_Button, Radio_Regular, Inputbox_Regular, Panel_Regular, Panel_Blank, Panel_Top, Panel_Left, Panel_Bottom, Panel_Right, Progress_Regular, Layerbox_Regular, Layerbox_Blank, Scrollbar_Horizontal, Scrollbar_Vertical, Listbox_Regular, Dropdown_Regular, Max } |
This enum lists all possible template types. More... | |
![]() | |
static Registry & | Active () |
This registry contains preset templates.
You are required to set all the templates otherwise, missing templates will be generated completely empty.
void Add | ( | TemplateType | type, |
UI::Template & | temp | ||
) |
Add the given template to the registry, transferring ownership.
If a template with the same type exists, it will be deleted.
|
overrideprotectedvirtual |
This function should return a template for the given type.
Due to being used in constructors you are not allowed to reject template type. If the generator is capable of generating a similar template, simply return that one instead of throwing (ie. return Panel_Regular instead of Panel_Top if Panel_Top is not supported). If that is not possible as well, return a template with a fixed error image/text.
Implements Registry.
|
overridevirtual |
Implements Registry.
References PresetRegistry::emsize.
|
overridevirtual |
Implements Registry.
References PresetRegistry::spacing.
void SetEmSize | ( | const int | size | ) |
References PresetRegistry::emsize.
void SetSpacing | ( | const int | tspacing | ) |
References PresetRegistry::spacing.
|
protected |
|
protected |