hiCreateVerticalFixedMenu
hiCreateVerticalFixedMenu(s_menuHandlel_menuItemsx_rowsx_cols[S_doneCallback] [s_showTextWithIcon] ) =>r_hiMenu
Description
Creates a vertical fixed menu that can be displayed in the root window. Fixed menus can no longer be displayed in application windows; use the new toolbar functions to create toolbars for windows instead.
The fixed menu is created as a grid of row x column dimensions, and contains menu item objects created by hiCreateMenuItem. An additional Done item is added as the last menu item. Selecting Done removes the fixed menu from the screen.
The width and height of the vertical fixed menu is determined by the number of rows and columns in the menu. Menu items you want to display within the fixed menu are inserted in row-major order.
Vertical fixed menus appear along the side of the root window (the screen). These fixed menus are shared among all Cadence application windows contained within the root window. To display a fixed menu, use hiDisplayFixedMenu.
Fixed menus can no longer be displayed in windows. Use the new toolbar functions or toolbar files to create toolbars for windows instead. Existing fixed menus that are attached to windows placed in session windows are no longer displayed. Existing fixed menus attached to stand-alone windows are displayed but might have display problems. Therefore, you should replace all existing fixed menus attached to windows with toolbars.
Arguments
Value Returned
|
The SKILL structure representing the menu. The menuHandle can be referenced by menu->hiMenuSym. |
Examples
Creates a vertical fixed menu, displays it, and then attaches it to a window. In this example, the trCreateMenuItem procedure allows an easy means of generating menu items with a similar callback.
;;; The following procedure returns a menu item
;;; based on theMenuSymbol.
procedure( trCreateMenuItem( theMenuSymbol )
;;; The set function assigns the menu item data structure
;;; to the theMenuSymbol’s value.
set(
theMenuSymbol
hiCreateMenuItem(
?name theMenuSymbol
;;; get_pname returns the name of the symbol
;;; as a text string.
?itemText get_pname( theMenuSymbol )
;;; All menu items will have a similar callback
;;; that prints the menu item’s ?name variable.
?callback sprintf( nil "println( '%L )" theMenuSymbol )
)
) ; set
) ; procedure
;;; creating the menu items for the fixed menu
trCreateMenuItem( 'item1 )
trCreateMenuItem( 'item2 )
trCreateMenuItem( 'item3 )
;;; creating the vertical fixed menu
hiCreateVerticalFixedMenu(
'trExampleVerticalFixedMenu
list( item1 item2 item3 )
3 ;;; number of rows
1 ;;; number of columns
)
To display the sample fixed menu, use the following function:
hiDisplayFixedMenu(
trExampleVerticalFixedMenu
"left" ;;; placement must be one of "top", "bottom",
;;; "right", or "left"
)
After the fixed menu is displayed, press the menu items. Each menu item displays its name in the CIW.
You can add a vertical fixed menu to a window of type graphics, browser, form, text, or encap. The following example opens a text file named fixedmenu.sample and attaches the trExampleVerticalFixedMenu to this text window. You can open a different window and replace its wid with window(3) in the following example.
view("~/test/fixedmenu.sample")
;;; The file is displayed as window(3).
hiAddFixedMenu( ?window window(3) ?fixedMenu trExampleVerticalFixedMenu)
After the fixed menu is attached to the window, select the menu items. Each menu item displays its name in the CIW.
To remove trExampleVerticalFixedMenu from window(3), use the following command:
hiRemoveFixedMenu( window(3) )
Related Topics
Return to top