Gorgon Game Engine
TwoStateControl Class Referenceabstract

This class is designed to be the interface class for all checkbox like UI elements. More...

Inheritance diagram for TwoStateControl:
[legend]

Public Member Functions

 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...
 
virtual bool GetState () const =0
 Returns 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)
 
virtual bool SetState (bool value, bool force=false)=0
 Changes the state of the checkbox. More...
 
bool Toggle ()
 Changes the state of the checkbox. More...
 

Public Attributes

Event< TwoStateControl, bool, bool & > StateChangingEvent
 This event. More...
 

Detailed Description

This class is designed to be the interface class for all checkbox like UI elements.

Every widget derived from this should implement two virtual functions, assignment to bool, and should call StateChangingEvent anytime its state is about to change. If this event sets the given bool reference to false, the widget should deny state change.

Constructor & Destructor Documentation

◆ TwoStateControl()

◆ ~TwoStateControl()

virtual ~TwoStateControl ( )
virtual

Member Function Documentation

◆ Check()

bool Check ( )

Changes the state of the widget.

Returns true if the operation is actually performed.

References TwoStateControl::SetState().

◆ Clear()

bool Clear ( )

Changes the state of the checkbox.

References TwoStateControl::SetState().

◆ ForceCheck()

bool ForceCheck ( )

Changes the state of the widget.

Returns true if the operation is actually performed.

References TwoStateControl::SetState().

◆ ForceClear()

bool ForceClear ( )

Changes the state of the checkbox.

References TwoStateControl::SetState().

◆ GetState()

virtual bool GetState ( ) const
pure virtual

Returns the state of the checkbox.

Implemented in Checkbox.

◆ operator bool()

operator bool ( ) const
explicit

Returns the state of the checkbox.

References TwoStateControl::GetState().

◆ operator!()

bool operator! ( ) const

Returns the inverse state of the checkbox.

References TwoStateControl::GetState().

◆ operator=()

TwoStateControl& operator= ( bool  value)

◆ SetState()

virtual bool SetState ( bool  value,
bool  force = false 
)
pure virtual

Changes the state of the checkbox.

Implemented in Checkbox.

◆ Toggle()

bool Toggle ( )

Changes the state of the checkbox.

References TwoStateControl::GetState(), and TwoStateControl::SetState().

Member Data Documentation

◆ StateChangingEvent

Event<TwoStateControl, bool , bool & > StateChangingEvent

This event.


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