mbRegisterCustomMenu
mbRegisterCustomMenu(t_viewType t_uniqueId t_enableCB t_customCB) =>t/nil
Description
Registers a custom menu with the menu builder for future retrieval and use within menus. A custom menu item is a single or slider menu that is built using the hi function calls, independently of the menu builder. The t_customCB argument is used to specify the function that is responsible for building and returning the menu item. The menu will display only when the mbSetContextData function is called.
Arguments
|
Name of the view type for which this action has been registered. |
|
Values Returned
Example
Here, the first function, BuildCustMenuItem() creates a pulldown menu, and returns a slider menu containing it. The second function EnableCustMenuItem() returns t to ensure that the menu item is always enabled .
procedure(BuildCustMenuItem()
hiCreatePulldownMenu(
'MyCustomMenu
"Custom Menu"
list(
hiCreateMenuItem(
?name 'item1
?itemText "Item 1"
?callback "println(\"Item 1\")"
)
hiCreateMenuItem(
?name 'item2
?itemText "Item 2"
?callback "println(\"Item 2\")"
)
)
)
hiCreateSliderMenuItem(
?name 'MySlider
?itemText "Custom Menu"
?subMenu MyCustomMenu
)
)
procedure(EnableCustMenuItem()
t
)
mbRegisterCustomMenu("maskLayout" "custMenu" "EnableCustMenuItem()"
"BuildCustMenuItem()")
mbSetContextData("maskLayout" "custMenu" "Via Ruler" "Canvas" "Common")
Return to top