Customizing Hierarchy Editor Menus
To add custom banner menus or context menu items to a Hierarchy Editor window:
-
Define a UI customization function that gets called whenever a new Hierarchy Editor window is opened and gets passed the
hiWindowIdof the new window.
The customization function can usehiSKILL functions to add banner menus to the Hierarchy Editor window or add menu items to the Hierarchy Editor context menus. The customization function can be loaded on Virtuoso startup through the.cdsinitfile. -
Register the customization function by using the
hedRegUICustomFuncSKILL function. Alternatively, add this call to.cdsinitso that the customization function is registered during Virtuoso startup.
When customizing Hierarchy Editor context menus, the context menus can be accessed using thecellTableMenu,instTableMenu, andtreeMenuproperties for the Hierarchy Editor window.
The following properties are also available for the Hierarchy Editor window:-
currentItem: Returns the currently selected item in a Hierarchy Editor window. -
libName: Returns the library name of the current configuration. -
cellName: Returns the cell name of the current configuration. -
viewName: Returns the view name of the current configuration. -
mode: Returns the mode that the configuration was opened in. It can be eitherr(representing read) ora(representing append).
The following sample script defines customization functions that add a custom Hierarchy Editor banner menu and tree context menu item and registers the functions with Hierarchy Editor.procedure(myBannerMenuUIFunc(hedWin) myMenu = hiCreateMenuItem( ?name 'myMenuItem ?itemText "My MenuItem" ?itemIcon nil ?callback "print(hiGetCurrentWindow()->currentItem)" ?disable nil ) hiCreatePulldownMenu( 'myMenu "My Custom menu" list(myMenu) ) hiInsertBannerMenu( hedWin 'myMenu hiGetNumMenus(hedWin) + 1 ) ) ) procedure(myContextMenuUIFunc(hedWin) let((treeMI) treeMI = hiCreateMenuItem( ?name 'treeMI ?itemText "My Tree MenuItem" ?itemIcon nil ?callback "print(hiGetCurrentWindow()->currentItem)" ?disable nil ) hiAddMenuItem(hedWin->treeMenu treeMI) ) ) hedRegUICustomFunc('myBannerMenuUIFunc) hedRegUICustomFunc('myContextMenuUIFunc)
-
Related Topics
Customizing Hierarchy Editor Columns
Return to top