An example for a custom command that changes the object states of an GUIObject. More...
#include <GUISetObjectStateCmd.h>
Public Member Functions | |
CGUISetObjectStateCmd () | |
Default constructor to be used by a factory. | |
CGUISetObjectStateCmd (ObjectHandle_t eTargetObject, eC_Bool bToggle, eC_Bool bFocusable, eC_Bool bInvisible, eC_Bool bGrayedOut, eC_Bool bDisabled) | |
virtual void | ReadFromStream () |
virtual void | WriteToStream (const eC_Bool bWriteClassID=false) |
![]() | |
void | AddAdditionalCmd (CGUICommandPtr pkCmd, eC_Bool bOneTime=false) |
CGUICommandPtr | GetAdditionalCmd (const eC_UInt &uiIndex) const |
eC_UInt | GetNumberOfAdditionalCmds () const |
eC_UInt | GetPriority () const |
eC_UInt | GetTimeUntilNextExecution () const |
eC_Bool | IsFinished () const |
virtual void | ReadFromStream () |
void | RemoveAdditionalCmd (CGUICommandPtr pkCmd) |
void | RemoveAllAdditionalCmds () |
Removes all additional commands from this command's list. | |
void | SetPriority (eC_UInt uiPriority) |
void | SetTimeUntilNextExecution (eC_UInt uiTime) |
virtual void | WriteToStream (const eC_Bool bWriteClassID=false) |
![]() | |
const eC_String & | GetXMLTag () const |
virtual void | ReadFromStream () |
void | SetXMLTag (const eC_String &kXMLTag) |
virtual void | WriteToStream (const eC_Bool bWriteClassID=false) |
![]() | |
RefCounted () | |
Create RefCounted object. The reference count is initialized to 0. | |
virtual | ~RefCounted () |
Destroy reference counted object. | |
void | AddRef () |
Increase reference count. | |
eC_Int | RefCount () const |
void | Release () |
bool | Unique () const |
Protected Member Functions | |
void | Do () |
Implements the actual command functionality. More... | |
![]() | |
CGUICommand (const eC_UInt uiPriority=0, const eC_UInt uiTimeUntilFirstExecution=0, const eC_Bool bFinished=true) | |
virtual | ~CGUICommand () |
Destructor. | |
virtual void | Do ()=0 |
void | SetToBeFinished (eC_Bool bIsFinished) |
![]() | |
eC_UInt | ReadStreamingHeader (const eC_UInt &uiClassVersion, const eC_UInt &uiClassMinVersion=0) const |
void | WriteStreamingFooter (const eC_Bool &bWriteClassID) const |
void | WriteStreamingHeader (const eC_Bool &bWriteClassID, const eC_Char *const pkClassIDTag, const eC_Int &iClassID, const eC_UInt &uiClassVersion) const |
Protected Attributes | |
eC_Bool | m_bDisabled |
Changeable state: Disabled. | |
eC_Bool | m_bFocussable |
Changeable state: focusable. | |
eC_Bool | m_bGrayedOut |
Changeable state: Grayed out. | |
eC_Bool | m_bInvisible |
Changeable state: Invisible. | |
eC_Bool | m_bToggle |
Specifies whether the states shall be toggled on/off, or if they will be set exactly as given. | |
ObjectHandle_t | m_eTargetObject |
Target object ID. | |
Additional Inherited Members | |
![]() | |
static const eC_Char | XMLTAG_ADDITIONALCMDCOUNT [] |
XML tag to be used when writing the additional command count into a stream. | |
static const eC_Char | XMLTAG_COMMANDCLASSID [] |
XML tag to be used when writing the command class ID into a stream. | |
static const eC_Char | XMLTAG_REMOVE_AFTER_EXECUTION [] |
XML tag to be used when writing the remove after execution flag. | |
![]() | |
static const eC_Char | XMLTAG_CLASSVERSION [] |
An example for a custom command that changes the object states of an GUIObject.
The target object is referenced by an object ID that has to be passed to the constructor. When this command is executed, it tries to find the specified object. If no object is found, this command does nothing. If the object is found, the object states are changed according the given values.
CGUISetObjectStateCmd::CGUISetObjectStateCmd | ( | ObjectHandle_t | eTargetObject, |
eC_Bool | bToggle, | ||
eC_Bool | bFocusable, | ||
eC_Bool | bInvisible, | ||
eC_Bool | bGrayedOut, | ||
eC_Bool | bDisabled | ||
) |
Constructor.
eTargetObject | The ID of the object to be modified by this command. |
bToggle | If true, all states marked as "True" will be toggled. Otherwise all states will be set to True/False exactly as given. |
bFocusable | New value of the focusable object state. |
bInvisible | New value of the invisible object state. |
bGrayedOut | New value of the grayed out object state. |
bDisabled | New value of the disabled object state. |
|
protectedvirtual |
Implements the actual command functionality.
Implements CGUICommand.
|
virtual |
Reads all attributes from streaming file. This method is called by CGUIFactoryManager after one of the registered factories has created an instance of this class.
Reimplemented from CGUICommand.
|
virtual |
Writes all attributes to the streaming file. A CGUIStreamWriter has to be initialized first.
bWriteClassID | This flag is used to select if writing of command class ID, leading and trailing tags is performed. |
Reimplemented from CGUICommand.