Product Documentation
Virtuoso Hierarchy Editor User Guide
Product Version IC23.1, August 2023

Customizing Hierarchy Editor Menus

To add custom banner menus or context menu items to a Hierarchy Editor window:

  1. Define a UI customization function that gets called whenever a new Hierarchy Editor window is opened and gets passed the hiWindowId of the new window.
    The customization function can use hi SKILL 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 .cdsinit file.
  2. Register the customization function by using the hedRegUICustomFunc SKILL function. Alternatively, add this call to .cdsinit so that the customization function is registered during Virtuoso startup.
    When customizing Hierarchy Editor context menus, the context menus can be accessed using the cellTableMenu, instTableMenu, and treeMenu properties 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 either r (representing read) or a (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

hedRegUICustomFunc

Customizing Hierarchy Editor Columns


Return to top
 ⠀
X