Gorgon Game Engine
Checkbox Class Reference
Inheritance diagram for Checkbox:
[legend]

Public Member Functions

template<class F_ >
 Checkbox (bool state, F_ changed, Registry::TemplateType type=Registry::Checkbox_Regular)
 
 Checkbox (bool state, Registry::TemplateType type=Registry::Checkbox_Regular)
 
 Checkbox (const char *text, bool state, Registry::TemplateType type=Registry::Checkbox_Regular)
 
template<class F_ >
 Checkbox (const char *text, F_ changed, Registry::TemplateType type=Registry::Checkbox_Regular)
 
 Checkbox (const char *text, Registry::TemplateType type=Registry::Checkbox_Regular)
 
 Checkbox (const Checkbox &)=delete
 
 Checkbox (const UI::Template &temp, bool state)
 
template<class F_ >
 Checkbox (const UI::Template &temp, bool state, F_ changed)
 
 Checkbox (const UI::Template &temp, const char *text)
 
 Checkbox (const UI::Template &temp, const char *text, bool state)
 
template<class F_ >
 Checkbox (const UI::Template &temp, const char *text, bool state, F_ changed)
 
template<class F_ >
 Checkbox (const UI::Template &temp, const char *text, F_ changed)
 
template<class F_ >
 Checkbox (const UI::Template &temp, F_ changed)
 
 Checkbox (const UI::Template &temp, std::string text, bool state)
 
template<class F_ >
 Checkbox (const UI::Template &temp, std::string text, bool state, F_ changed)
 
template<class F_ >
 Checkbox (const UI::Template &temp, std::string text, F_ changed)
 
 Checkbox (const UI::Template &temp, std::string text="")
 
template<class F_ >
 Checkbox (F_ changed, Registry::TemplateType type=Registry::Checkbox_Regular)
 
 Checkbox (Registry::TemplateType type=Registry::Checkbox_Regular)
 
template<class F_ >
 Checkbox (std::string text, bool state, F_ changed, Registry::TemplateType type=Registry::Checkbox_Regular)
 
 Checkbox (std::string text, bool state, Registry::TemplateType type=Registry::Checkbox_Regular)
 
template<class F_ >
 Checkbox (std::string text, F_ changed, Registry::TemplateType type=Registry::Checkbox_Regular)
 
 Checkbox (std::string text, Registry::TemplateType type=Registry::Checkbox_Regular)
 
virtual ~Checkbox ()
 
virtual bool Activate () override
 Activates the widget. More...
 
virtual bool GetState () const override
 Returns the state of the checkbox. More...
 
std::string GetText () const
 
bool KeyEvent (Input::Key key, float state) override
 This function should be called whenever a key is pressed or released. More...
 
 operator bool ()
 
Checkboxoperator= (bool value)
 
virtual bool SetState (bool value, bool force=false) override
 Changes the state of the checkbox. More...
 
void SetText (const std::string &value)
 
- Public Member Functions inherited from ComponentStackWidget
 ComponentStackWidget (ComponentStackWidget &&)=default
 
 ComponentStackWidget (const Template &temp, std::map< ComponentTemplate::Tag, std::function< Widget *(const Template &)>> generators={})
 
virtual ~ComponentStackWidget ()
 
virtual Geometry::Point GetLocation () const override
 Returns the location of the widget. More...
 
virtual Geometry::Size GetSize () const override
 Returns the size of the widget. More...
 
virtual bool IsEnabled () const override
 Returns whether the widget is enabled. More...
 
virtual void Move (const Geometry::Point &location) override
 Moves this widget to the given position. More...
 
virtual void Move (const Geometry::Point &location)=0
 Moves this widget to the given position. More...
 
void Move (int x, int y)
 Moves this widget to the given position. More...
 
virtual void Resize (const Geometry::Size &size) override
 Changes the size of the widget. More...
 
virtual void Resize (const Geometry::Size &size)=0
 Changes the size of the widget. More...
 
virtual void Resize (int w, int h)
 Changes the size of the widget. More...
 
virtual void SetEnabled (bool value) override
 Sets the enabled state of the widget. More...
 
- Public Member Functions inherited from Widget
 Widget ()
 
 Widget (Widget &&)=default
 
virtual ~Widget ()
 
bool AllowFocus () const
 If this widget can be focused currently. More...
 
virtual bool CharacterEvent (Char)
 This function should be called whenever a character is received from operating system. More...
 
bool Defocus ()
 Removes the focus from this widget if this widget is focused. More...
 
void Disable ()
 Disables the widget so that the user cannot interact with it. More...
 
virtual bool Done ()
 For widgets that supports it, this will trigger finalization the user interaction. More...
 
void Enable ()
 Enables the widget so that the user can interact with it. More...
 
bool EnsureVisible () const
 Ensures this widget is visible in its container by scrolling it into view. More...
 
bool Focus ()
 Transfers the focus to this widget. More...
 
Geometry::Bounds GetBounds () const
 Returns the bounds of the widget. More...
 
int GetHeight () const
 Returns the height of the widget. More...
 
WidgetContainerGetParent () const
 Returns the parent of this widget, throws if it does not have a parent. More...
 
int GetWidth () const
 Returns the width of the widget. More...
 
bool HasParent () const
 Returns if this widget has a parent. More...
 
void Hide ()
 Hides this widget, when hidden, widgets cannot gain focus. More...
 
bool IsFloating () const
 Returns floating status of this widget. More...
 
bool IsFocused () const
 Returns if this widget is focused. More...
 
bool IsVisible () const
 Returns if the widget is visible. More...
 
void Move (int x, int y)
 Moves this widget to the given position. More...
 
bool Remove ()
 Removes the widget from its parent. More...
 
virtual void Resize (int w, int h)
 Changes the size of the widget. More...
 
void SetHeight (int height)
 Sets the height of the widget. More...
 
virtual void SetIsFloating (bool value)
 Sets floating status of this widget. More...
 
void setname (std::string value)
 This is a debug feature. More...
 
void SetVisible (bool value)
 Changes the visibility of the widget. More...
 
void SetWidth (int width)
 Sets the width of the widget. More...
 
void Show ()
 Shows this widget, widgets are visible by default. More...
 
void ToggleEnabled ()
 Toggles enabled state of the widget. More...
 
void ToggleVisible ()
 Toggles the visibility state of the widget. More...
 
- Public Member Functions inherited from TwoStateControl
 TwoStateControl ()
 
virtual ~TwoStateControl ()
 
bool Check ()
 Changes the state of the widget. More...
 
bool Clear ()
 Changes the state of the checkbox. More...
 
bool ForceCheck ()
 Changes the state of the widget. More...
 
bool ForceClear ()
 Changes the state of the checkbox. More...
 
 operator bool () const
 Returns the state of the checkbox. More...
 
bool operator! () const
 Returns the inverse state of the checkbox. More...
 
TwoStateControloperator= (bool value)
 
bool Toggle ()
 Changes the state of the checkbox. More...
 

Public Attributes

Event< Checkbox, bool > ChangedEvent
 
TextualProperty< Checkbox, std::string, &Checkbox::GetText, &Checkbox::SetTextText
 
- Public Attributes inherited from Widget
Event< WidgetBoundsChangedEvent
 This event will be fired when the area that the widget occupies on its container is changed. More...
 
std::string dbgname
 
Event< WidgetFocusEvent
 This event will be fired when the widget receives or looses focus. More...
 
Geometry::PointProperty< Widget, &Widget::getlocation, &Widget::move > Location
 
Geometry::SizeProperty< Widget, &Widget::getsize, &Widget::resize > Size
 
- Public Attributes inherited from TwoStateControl
Event< TwoStateControl, bool, bool & > StateChangingEvent
 This event. More...
 

Protected Member Functions

virtual bool allowfocus () const override
 Should return true if the widget can be focused. More...
 
- Protected Member Functions inherited from ComponentStackWidget
virtual void addto (Layer &layer) override
 When called, widget should locate itself on to this layer. More...
 
virtual void focused () override
 This is called after the focus is transferred to this widget. More...
 
virtual void focuslost () override
 This is called after the focus is lost. More...
 
virtual void parentenabledchanged (bool state) override
 This function is called when the parent's enabled state changes. More...
 
virtual void removed () override
 Called after this widget is removed from its parent. More...
 
virtual void removefrom (Layer &layer) override
 When called, widget should remove itself from the given layer. More...
 
virtual void setlayerorder (Layer &, int order) override
 When called, widget should reorder itself in layer hierarchy. More...
 
- Protected Member Functions inherited from Widget
virtual void addedto (WidgetContainer &container)
 Called when this widget added to the given container. More...
 
virtual bool addingto (WidgetContainer &)
 Called when it is about to be added to the given container. More...
 
virtual void boundschanged ()
 Call this function when the widget bounds is changed. More...
 
virtual bool canloosefocus () const
 Should return true if the widget can loose the focus right now. More...
 
virtual void displaced ()
 Call this function when the widget container causes it to be displaced. More...
 
virtual bool removingfrom ()
 Called before this widget is removed from its parent. More...
 

Additional Inherited Members

- Protected Attributes inherited from ComponentStackWidget
bool enabled
 
bool parentenabled
 
ComponentStackstack
 

Constructor & Destructor Documentation

◆ Checkbox() [1/23]

Checkbox ( const Checkbox )
delete

◆ Checkbox() [2/23]

◆ Checkbox() [3/23]

Checkbox ( bool  state,
Registry::TemplateType  type = Registry::Checkbox_Regular 
)
explicit

◆ Checkbox() [4/23]

Checkbox ( std::string  text,
Registry::TemplateType  type = Registry::Checkbox_Regular 
)
explicit

◆ Checkbox() [5/23]

Checkbox ( const char *  text,
Registry::TemplateType  type = Registry::Checkbox_Regular 
)
explicit

◆ Checkbox() [6/23]

Checkbox ( F_  changed,
Registry::TemplateType  type = Registry::Checkbox_Regular 
)
explicit

◆ Checkbox() [7/23]

Checkbox ( std::string  text,
F_  changed,
Registry::TemplateType  type = Registry::Checkbox_Regular 
)
explicit

◆ Checkbox() [8/23]

Checkbox ( const char *  text,
F_  changed,
Registry::TemplateType  type = Registry::Checkbox_Regular 
)
explicit

◆ Checkbox() [9/23]

Checkbox ( std::string  text,
bool  state,
Registry::TemplateType  type = Registry::Checkbox_Regular 
)
explicit

◆ Checkbox() [10/23]

Checkbox ( const char *  text,
bool  state,
Registry::TemplateType  type = Registry::Checkbox_Regular 
)
explicit

◆ Checkbox() [11/23]

Checkbox ( bool  state,
F_  changed,
Registry::TemplateType  type = Registry::Checkbox_Regular 
)
explicit

◆ Checkbox() [12/23]

Checkbox ( std::string  text,
bool  state,
F_  changed,
Registry::TemplateType  type = Registry::Checkbox_Regular 
)
explicit

◆ Checkbox() [13/23]

Checkbox ( const UI::Template temp,
std::string  text = "" 
)
explicit

◆ Checkbox() [14/23]

Checkbox ( const UI::Template temp,
const char *  text 
)

◆ Checkbox() [15/23]

Checkbox ( const UI::Template temp,
F_  changed 
)

◆ Checkbox() [16/23]

Checkbox ( const UI::Template temp,
std::string  text,
F_  changed 
)

◆ Checkbox() [17/23]

Checkbox ( const UI::Template temp,
const char *  text,
F_  changed 
)

◆ Checkbox() [18/23]

Checkbox ( const UI::Template temp,
bool  state,
F_  changed 
)

◆ Checkbox() [19/23]

Checkbox ( const UI::Template temp,
std::string  text,
bool  state,
F_  changed 
)

◆ Checkbox() [20/23]

Checkbox ( const UI::Template temp,
const char *  text,
bool  state,
F_  changed 
)

◆ Checkbox() [21/23]

Checkbox ( const UI::Template temp,
bool  state 
)

◆ Checkbox() [22/23]

◆ Checkbox() [23/23]

Checkbox ( const UI::Template temp,
const char *  text,
bool  state 
)

◆ ~Checkbox()

~Checkbox ( )
virtual

Member Function Documentation

◆ Activate()

bool Activate ( )
overridevirtual

Activates the widget.

This might perform the action if the widget is a button, forward the focus if it is a label or focus if it is an input field.

Implements Widget.

References Checkbox::ChangedEvent, Checkbox::GetState(), and TwoStateControl::Toggle().

◆ allowfocus()

bool allowfocus ( ) const
overrideprotectedvirtual

Should return true if the widget can be focused.

Reimplemented from Widget.

References WidgetContainer::AllowAll, WidgetContainer::CurrentFocusStrategy(), Widget::GetParent(), and Widget::HasParent().

◆ GetState()

virtual bool GetState ( ) const
overridevirtual

Returns the state of the checkbox.

Implements TwoStateControl.

◆ GetText()

std::string GetText ( ) const

◆ KeyEvent()

◆ operator bool()

operator bool ( )

References Checkbox::GetState().

◆ operator=()

Checkbox& operator= ( bool  value)

References Checkbox::SetState().

◆ SetState()

bool SetState ( bool  value,
bool  force = false 
)
overridevirtual

◆ SetText()

void SetText ( const std::string &  value)

Member Data Documentation

◆ ChangedEvent

Event<Checkbox, bool > ChangedEvent

◆ Text


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