![]() |
XII Release 0.1.0
|
Stores the valid values and names for 'dynamic' enums. More...
#include <DynamicEnums.h>
Public Member Functions | |
const xiiMap< xiiInt32, xiiString > & | GetAllValidValues () const |
Returns all enum values and current names. | |
void | Clear () |
Resets the internal data. | |
void | SetValueAndName (xiiInt32 iValue, xiiStringView sNewName) |
Sets the name for the given enum value. | |
void | RemoveValue (xiiInt32 iValue) |
Removes a certain enum value, if it exists. | |
bool | IsValueValid (xiiInt32 iValue) const |
Returns whether a certain value is known. | |
xiiStringView | GetValueName (xiiInt32 iValue) const |
Returns the name for the given value. Returns "<invalid value>" if the value is not in use. | |
void | SetEditCommand (xiiStringView sCmd, const xiiVariant &value) |
If specified, the widget shows an "edit" option, which will run xiiActionManager::ExecuteAction(sCmd, value). | |
xiiStringView | GetEditCommand () const |
const xiiVariant & | GetEditCommandValue () const |
Static Public Member Functions | |
static xiiDynamicEnum & | GetDynamicEnum (xiiStringView sEnumName) |
Returns a xiiDynamicEnum under the given name. Creates a new one, if the name has not been used before. | |
Stores the valid values and names for 'dynamic' enums.
The names and valid values for dynamic enums may change due to user configuration changes. The UI should show these user specified names without restarting the tool.
Call the static function GetDynamicEnum() to create or get the xiiDynamicEnum for a specific type.
void xiiDynamicEnum::SetEditCommand | ( | xiiStringView | sCmd, |
const xiiVariant & | value ) |
If specified, the widget shows an "edit" option, which will run xiiActionManager::ExecuteAction(sCmd, value).
This is meant to be used to open existing config dialogs. There is currently no way to report back a selection, so after making changes, the user has to make another selection.