Gorgon Game Engine
Generator Class Referenceabstract

Generators create templates for widgets. More...

Inheritance diagram for Generator:
[legend]

Public Member Functions

 Generator (bool activate=true)
 
virtual ~Generator ()
 
virtual UI::Template BlankLayerbox ()=0
 
virtual UI::Template BlankPanel ()=0
 
virtual UI::Template BottomPanel ()=0
 
virtual UI::Template Button ()=0
 Generates a button template. More...
 
virtual UI::Template Checkbox ()=0
 
virtual UI::Template CheckboxButton ()=0
 
virtual UI::Template Dropdown ()=0
 
virtual UI::Template ErrorLabel ()=0
 
virtual UI::Template HScrollbar ()=0
 
virtual UI::Template IconButton (Geometry::Size iconsize={-1, -1})=0
 Generates a button template with the given default size. More...
 
virtual UI::Template Inputbox ()=0
 
virtual UI::Template Label ()=0
 
virtual UI::Template Layerbox ()=0
 
virtual UI::Template LeftPanel ()=0
 
virtual UI::Template Listbox ()=0
 
virtual UI::Template Panel ()=0
 
virtual UI::Template Progressbar ()=0
 
virtual UI::Template RadioButton ()=0
 
virtual UI::Template RightPanel ()=0
 
virtual UI::Template TopPanel ()=0
 
virtual UI::Template VScrollbar ()=0
 
- Public Member Functions inherited from Registry
 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...
 
virtual int GetEmSize () const =0
 
virtual int GetSpacing () const =0
 
const UI::Templateoperator[] (TemplateType type)
 Returns the template for the requested type. More...
 

Protected Member Functions

virtual UI::Templategenerate (Gorgon::Widgets::Registry::TemplateType type) override
 This function should return a template for the given type. More...
 

Additional Inherited Members

- Public Types inherited from Registry
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 Public Member Functions inherited from Registry
static RegistryActive ()
 
- Protected Attributes inherited from Registry
std::array< UI::Template *, Maxtemplates
 Stores the templates. Mutable to allow late loading. More...
 

Detailed Description

Generators create templates for widgets.

First setup a generator, then call specific generation functions.

Constructor & Destructor Documentation

◆ ~Generator()

virtual ~Generator ( )
virtual

◆ Generator()

Generator ( bool  activate = true)

Member Function Documentation

◆ BlankLayerbox()

virtual UI::Template BlankLayerbox ( )
pure virtual

Implemented in SimpleGenerator.

◆ BlankPanel()

virtual UI::Template BlankPanel ( )
pure virtual

Implemented in SimpleGenerator.

◆ BottomPanel()

virtual UI::Template BottomPanel ( )
pure virtual

Implemented in SimpleGenerator.

◆ Button()

virtual UI::Template Button ( )
pure virtual

Generates a button template.

Implemented in SimpleGenerator.

◆ Checkbox()

virtual UI::Template Checkbox ( )
pure virtual

Implemented in SimpleGenerator.

◆ CheckboxButton()

virtual UI::Template CheckboxButton ( )
pure virtual

Implemented in SimpleGenerator.

◆ Dropdown()

virtual UI::Template Dropdown ( )
pure virtual

Implemented in SimpleGenerator.

◆ ErrorLabel()

virtual UI::Template ErrorLabel ( )
pure virtual

Implemented in SimpleGenerator.

◆ generate()

virtual UI::Template& generate ( Gorgon::Widgets::Registry::TemplateType  type)
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.

◆ HScrollbar()

virtual UI::Template HScrollbar ( )
pure virtual

Implemented in SimpleGenerator.

◆ IconButton()

virtual UI::Template IconButton ( Geometry::Size  iconsize = {-1, -1})
pure virtual

Generates a button template with the given default size.

Implemented in SimpleGenerator.

◆ Inputbox()

virtual UI::Template Inputbox ( )
pure virtual

Implemented in SimpleGenerator.

◆ Label()

virtual UI::Template Label ( )
pure virtual

Implemented in SimpleGenerator.

◆ Layerbox()

virtual UI::Template Layerbox ( )
pure virtual

Implemented in SimpleGenerator.

◆ LeftPanel()

virtual UI::Template LeftPanel ( )
pure virtual

Implemented in SimpleGenerator.

◆ Listbox()

virtual UI::Template Listbox ( )
pure virtual

Implemented in SimpleGenerator.

◆ Panel()

virtual UI::Template Panel ( )
pure virtual

Implemented in SimpleGenerator.

◆ Progressbar()

virtual UI::Template Progressbar ( )
pure virtual

Implemented in SimpleGenerator.

◆ RadioButton()

virtual UI::Template RadioButton ( )
pure virtual

Implemented in SimpleGenerator.

◆ RightPanel()

virtual UI::Template RightPanel ( )
pure virtual

Implemented in SimpleGenerator.

◆ TopPanel()

virtual UI::Template TopPanel ( )
pure virtual

Implemented in SimpleGenerator.

◆ VScrollbar()

virtual UI::Template VScrollbar ( )
pure virtual

Implemented in SimpleGenerator.


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