XII Release 0.1.0
Loading...
Searching...
No Matches
xiiDynamicMenuAction Class Referenceabstract

A menu action whose content is determined when opening the menu. More...

#include <BaseActions.h>

Inheritance diagram for xiiDynamicMenuAction:
[legend]

Classes

struct  Item
 

Public Member Functions

 xiiDynamicMenuAction (const xiiActionContext &context, xiiStringView sName, xiiStringView sIconPath)
 
virtual void GetEntries (xiiDynamicArray< Item > &out_entries)=0
 
- Public Member Functions inherited from xiiMenuAction
 xiiMenuAction (const xiiActionContext &context, xiiStringView sName, xiiStringView sIconPath)
 
virtual void Execute (const xiiVariant &value) override
 
- Public Member Functions inherited from xiiNamedAction
 xiiNamedAction (const xiiActionContext &context, xiiStringView sName, xiiStringView sIconPath)
 
xiiStringView GetName () const
 
xiiStringView GetAdditionalDisplayString ()
 
void SetAdditionalDisplayString (xiiStringView sString, bool bTriggerUpdate=true)
 
xiiStringView GetIconPath () const
 
void SetIconPath (xiiStringView sIconPath)
 
- Public Member Functions inherited from xiiAction
 xiiAction (const xiiActionContext &context)
 
void TriggerUpdate ()
 
const xiiActionContextGetContext () const
 
xiiActionDescriptorHandle GetDescriptorHandle ()
 
- Public Member Functions inherited from xiiReflectedClass
virtual const xiiRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const xiiRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T>
XII_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 

Additional Inherited Members

- Static Public Member Functions inherited from xiiNoBase
static const xiiRTTIGetStaticRTTI ()
 
- Public Attributes inherited from xiiAction
xiiEvent< xiiAction * > m_StatusUpdateEvent
 Fire when the state of the action changes (enabled, value etc...)
 
- Protected Attributes inherited from xiiNamedAction
xiiString m_sName
 
xiiString m_sAdditionalDisplayString
 
xiiString m_sIconPath
 
- Protected Attributes inherited from xiiAction
xiiActionContext m_Context
 

Detailed Description

A menu action whose content is determined when opening the menu.

Every time this menu gets opened, GetEntries() is executed, with the state of the previous menu items. It can then return the same result, or adjust the entries (update check marks or show entirely different entries).

Derive from this, to create your own dynamic menu. Or use something like xiiEnumerationMenuAction to get a menu for an enum type.


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