HDK
|
#include <DT_Plugin.h>
Public Member Functions | |
DT_ParmDefMenu * | setStaticMenu (const DT_MenuItemList &items) |
Set this menu to be a static menu with a fixed set of menu entries. More... | |
const DT_MenuItemList & | staticMenu () const |
DT_ParmDefMenu * | setDynamicMenu (fpreal pref_width_in_em=12.0) |
bool | isDynamicMenu () const |
Returns true if this menu is dynamically generated. More... | |
DT_ParmDefMenu * | setActionMenu () |
bool | isActionMenu () const |
Returns true if this is an action menu. More... | |
fpreal | dynamicMenuWidth () const |
void | copyValue (const char *src, DT_Value &dst) const |
Copy a value from a concrete type to an opaque DT_Value object. More... | |
void | copyValue (const DT_Value &src, UT_StringHolder &dst) const |
Copy a value from DT_Value opaque type to a concrete type. More... | |
bool | allowsMultiValueSet () const override |
Don't allow triggering multiple action menus at once. More... | |
bool | operator== (const DT_ParmDef &other) const override |
Public Member Functions inherited from DT_ParmDef | |
virtual | ~DT_ParmDef () |
int | id () const |
Type | type () const |
const char * | typeName () const |
DT_ParmDef * | setName (const UT_StringHolder &name) |
Set a name for this parameter definition. More... | |
const UT_StringHolder & | name () const |
Returns the name of the parameter definition. More... | |
DT_ParmDef * | setIcon (const UT_StringHolder &icon) |
Show an icon, instead of a headet text / label. More... | |
const UT_StringHolder & | icon () const |
DT_ParmDef * | setTooltip (const UT_StringHolder &str) |
const UT_StringHolder & | tooltip () const |
DT_ParmDef * | setReadOnly () |
bool | readOnly () const |
DT_ParmDef * | setOptionType (OptionType opt_type) |
OptionType | optionType () const |
DT_ParmDef * | setToolbarName (const UT_StringHolder &toolbar_name) |
const UT_StringHolder & | toolbarName () const |
DT_ParmDef * | setCanBeIndeterminate () |
The parameter can be in an indeterminate state. Ignored for options. More... | |
bool | canBeIndeterminate () const |
Static Public Member Functions | |
static DT_ParmDefMenu * | create (int id, const UT_StringHolder &name) |
static const DT_ParmDefMenu & | get (const DT_ParmDef &def) |
Automatically cast the base class definition to this type. More... | |
Static Public Member Functions inherited from DT_ParmDef | |
static DT_ParmDef * | createFromTemplate (int id, const PRM_Template &tpl) |
static bool | getMenuItemsFromTemplate (const PRM_Template &tpl, PRM_Parm &parm, DT_MenuItemList &items) |
Additional Inherited Members | |
Public Types inherited from DT_ParmDef | |
enum | Type { T_TOGGLE, T_INTEGER, T_FLOAT, T_COLOR, T_STRING, T_MENU, T_PATH, T_BUTTON, T_GROUPED } |
enum | OptionType { OT_OPTION_ONLY, OT_OPTION_AND_TOOLBAR, OT_TOOLBAR_ONLY } |
Protected Member Functions inherited from DT_ParmDef | |
DT_ParmDef (int id, const UT_StringHolder &name, Type parm_type) | |
Protected Member Functions inherited from UT_NonCopyableNS::UT_NonCopyable | |
UT_NonCopyable ()=default | |
~UT_NonCopyable ()=default | |
UT_NonCopyable (const UT_NonCopyable &)=delete | |
UT_NonCopyable & | operator= (const UT_NonCopyable &)=delete |
Protected Attributes inherited from DT_ParmDef | |
int | myId |
UT_StringHolder | myName |
UT_StringHolder | myIcon |
Type | myType |
UT_StringHolder | myTooltip |
OptionType | myOptionType |
UT_StringHolder | myToolbarName |
bool | myReadOnly |
bool | myCanBeIndeterminate |
Definition at line 546 of file DT_Plugin.h.
|
inlineoverridevirtual |
Don't allow triggering multiple action menus at once.
Reimplemented from DT_ParmDef.
Definition at line 600 of file DT_Plugin.h.
Copy a value from a concrete type to an opaque DT_Value object.
void DT_ParmDefMenu::copyValue | ( | const DT_Value & | src, |
UT_StringHolder & | dst | ||
) | const |
Copy a value from DT_Value opaque type to a concrete type.
|
static |
Create a new menu parameter definition. By default the menu is marked as dynamic, requiring the implementation of either DT_Plugin::getOptionMenuItems, DT_Plugin::getParameterMenuItems, or both.
fpreal DT_ParmDefMenu::dynamicMenuWidth | ( | ) | const |
|
inlinestatic |
Automatically cast the base class definition to this type.
Definition at line 557 of file DT_Plugin.h.
bool DT_ParmDefMenu::isActionMenu | ( | ) | const |
Returns true
if this is an action menu.
bool DT_ParmDefMenu::isDynamicMenu | ( | ) | const |
Returns true
if this menu is dynamically generated.
|
overridevirtual |
Implements DT_ParmDef.
DT_ParmDefMenu* DT_ParmDefMenu::setActionMenu | ( | ) |
Mark this as an action menu, where selecting a menu entry triggers an action rather than updating the value shown in the menu. For this type of menu, the parameter value is always shown as the menu text. That menu text is not expected to show up in the list of menu items.
DT_ParmDefMenu* DT_ParmDefMenu::setDynamicMenu | ( | fpreal | pref_width_in_em = 12.0 | ) |
Mark this menu as being dynamically generated. Any existing list of static menu items will be deleted. The pref_width_in_em
parameter is used as a guidance to set the approximate display width of the menu in units of em
. The width in pixels is computed based on the font used.
DT_ParmDefMenu* DT_ParmDefMenu::setStaticMenu | ( | const DT_MenuItemList & | items | ) |
Set this menu to be a static menu with a fixed set of menu entries.
const DT_MenuItemList& DT_ParmDefMenu::staticMenu | ( | ) | const |
Return the list of static menu items for this parameter definition. If the menu is marked as dynamic, this list will be empty.