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

hiCreateTypeinMenuItem

hiCreateTypeinMenuItem(
?name s_name 
[ ?itemIcon g_icon ] 
[ ?itemText t_text ] 
[ ?callback S_funcname ] 
[ ?disable g_disable ] 
[ ?statusTip t_statusTip ] 
[ ?toolTip t_toolTip ] 
[ ?completerType s_type ] 
[ ?completerList l_list ]
) 
=> r_menuItem / nil

Description

Creates a type-in menu item that can receive user inputs. When a user types text in the type-in menu item created using this function and presses Enter, the specified callback function S_funcname is run.

Arguments

?name s_name

SKILL handle to the menu item.

?itemIcon g_icon

The icon associated with the menu item.

?itemText t_text

The placeholder text set to prompt user input in the type-in menu item. This text is displayed when the menu item is not in focus.

?callback S_funcname

  

The callback function that is run when user accesses the menu item and presses Enter.

?disable g_disable

  

Disables the menu item (grayed out and unselectable) when displayed.

?statusTip t_statusTip

  

The status text is displayed in the status bar at the bottom of the window when the menu item is in focus. If you do not specify this argument, the menu item text t_text is displayed.

?toolTip t_toolTip

  

Displays tool tip when the mouse hovers over the menu item. If you do not specify this argument, the menu item text t_text is displayed.

?completerType s_type

  

The setting to assist user input in the type-in menu item. This argument can have one of the following values:

  • inline: The history of user inputs is displayed in line.
  • popup: The history of user inputs appears in a popup list.
  • none: The history of user inputs is not shown.

?completerList l_list

  

The list of strings that store the history of the previous user inputs. This list is used to assist user inputs in the type-in menu item. It is updated when the user types text in the type-in menu item and presses Enter. The latest user inputs are placed in the begining of the history list and older inputs are moved below in the list.

It is possible to set or replace this list of strings with custom strings using hiSetTypeinMenuItemCompleterList.

All instances of the same type-in menu item share the same history list.

Value Returned

r_menuItem

The SKILL structure representing the type-in menu item.

nil

The menu item could not be created.

Example

The following code creates a type-in menu item with a pre-seeded completer list and a popup completer. This code can be specified in the list of menu items, for example, hiCreatePulldownMenu.

PopupTypein = hiCreateTypeinMenuItem( ?name 'PopupCompleter ?itemText "Has Popup"
                                      ?itemIcon "search.png" ?callback "println"
                                      ?completerType 'popup
                                      ?completerList '( "Apple" "Orange" "Grape" "Grapefruit"
                                                       "Guava" "Stawberry" "Watermelon" )
                                      ?toolTip "This has a popup completer" )

Related Topics

Menu Functions

hiCreatePulldownMenu

hiSetTypeinMenuItemCompleterList

hiCreateMenuItem

hiAddMenuItem

hiCreateSeparatorMenuItem


Return to top
 ⠀
X