Product Documentation
Cadence User Interface SKILL Reference
Product Version IC23.1, September 2023

hiCreateVerticalFixedMenu

hiCreateVerticalFixedMenu(
s_menuHandle 
l_menuItems 
x_rows 
x_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

s_menuHandle

A unique global SKILL symbol used to reference this menu.

l_menuItems

List of menu items created by hiCreateMenuItem.

x_rows

Number of rows in the fixed menu.

x_cols

Number of columns in the fixed menu.

S_doneCallback

Symbol or string specifying the SKILL function that is called when the menu is closed either by clicking the Done button or by calling hiFixedMenuDown. If you specify a symbol, the function is passed one argument (r_hiMenu); if you specify a string, the string is evaluated and the function is not passed any argument.

If you do not want to use this argument but want to use the next argument, specify ’none as the value of this argument.

s_showTextWithIcon

  

Specifies whether both text and icons should be displayed for all menu items for which both ?itemText and ?itemIcon have been set. Legal values are ’under (the text is displayed below the icon), ’beside (the text is displayed beside the icon) and ’none (if both ?itemText and ?itemIcon have been set for a menu item, only the icon is displayed). The default value is ’none.

Value Returned

r_hiMenu

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

Menu Functions

hiDisplayFixedMenu


Return to top
 ⠀
X