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

hiDisplayUserDBox

hiDisplayUserDBox(
?name s_dboxHandle
[ ?dboxBanner t_dboxBanner ]
[ ?dboxText t_dboxText ]
[ ?location l_location ]
[ ?dialogType x_dialogType ]
[ ?dialogStyle s_dialogStyle ]
[ ?defaultButton x_defaultButton ]
?buttons g_buttons
[ ?callbacks g_callbacks ]
[ ?dontPopdowns g_dontPopdowns ]
[ ?help g_help ]
)
=> buttonIndex / callbackReturnVal / t / nil

Description

Creates and displays a dialog box. This function lets you customize buttons in the dialog box. You can also choose whether the dialog box is removed from the screen or not when a button is pressed. Using this function is equivalent to using hiDisplayAppDBox with s_buttonLayout set to ’UserDefined.

Arguments

?name s_dboxHandle

  

SKILL handle to the dialog box. When the dialog box is dismissed, this symbol is reset to nil.

?dboxBanner t_dboxBanner

  

Text that appears within the window manager banner of the dialog box.

?dboxText t_dboxText

  

Text that is displayed in the dialog box.

?location l_location

  

The location of the dialog box on the screen, specified as the x and y coordinates of the upper left corner of the box:

list(x-coordinate y-coordinate). If this argument is not specified or if it is specified incorrectly, then the default location set by hiSetDBoxDefaultLocation is used. If the default location has not been set, then the toolkit that implements the dialog box determines the location (usually the center of the screen).

?dialogType x_dialogType

  

One of the following dialog box types, which determine the appearence of the dialog box:

  • hicWarningDialog(default)
  • hicErrorDialog
  • hicInformationDialog
  • hicMessageDialog
  • hicQuestionDialog
  • hicWorkingDialog

?dialogStyle s_dialogStyle

  

One of the following symbols, which determines the blocking behavior of the dialog box:

’modal

Blocks access to the application while it is displayed. The user must dismiss the dialog box in order to continue using the application. (Access to window manager commands or other applications is not blocked.)

’modeless

Does not block access to the application. The user can continue using the application without having to close the dialog box.

The default value of this argument is ’modal.

?defaultButton x_defaultButton

  

The default button to be used when the Return key is pressed. Specify the default button by its position. The first button you specify in g_buttons is 1, the second one is 2, and so on.

If you do not specify a value or if you specify an invalid value (for example, if you specify 5 when the dialog box only has three buttons), the first button is the default.

?buttons g_buttons

  

List of button labels that you want to display in the dialog box. Specify this argument as a list of strings. You can specify any string for a button, for example, "Overwrite", "Update", or "Cancel".

A Help button is not added by default to your list of buttons. If you want a Help button, specify it in the g_buttons list and specify a callback for it in the g_callbacks argument. You can also invoke the standard Doc Assistant mechanism when the user clicks Help; see the description of g_callbacks for more information.

?callbacks g_callbacks

  

List of callbacks that determine what happens when the buttons in the dialog box are clicked. The list of callbacks corresponds to the list of buttons specified for the g_buttons argument. The first callback is called when the first button in g_buttons is clicked, the second is called when the second button is clicked, and so on. If you do not want to specify a callback for a button, use nil.

The default value of this argument is nil for all buttons.

If you specified a Help button in g_buttons and if you want the standard Doc Assistant mechanism to be invoked when the user clicks the button, use the following procedure as the callback for the Help button:

procedure(myHelp()

hiHelp(’dbox dBoxName)

If s_dialogStyle is ’modeless, you should specify a callback for each button, as the function returns t immediately after the dialog box is displayed (if there is no error). You can write the callback in a way that it returns the button index. For example, write the callback as:

procedure( myCallback(button)

when (button == 1 "Overwrite selected")

and, in the hiDisplayUserDBox function, pass the button index to the callback:

?callback ’("myCallback(1)" "myCallback(2)" "myCallback(3)")

?dontPopdowns g_dontPopdowns

  

A list, each element of which is t or nil, that determines whether the dialog box is closed when a button is clicked. Specify t if you want to continue to display the dialog box when the button is clicked; specify nil if you want the dialog box to be closed when the button is clicked.

The items in the list correspond to the buttons in g_buttons. The first item in g_dontPopdowns determines the behavior of the first button in g_buttons, the second item determines the behavior of the second button, and so on.

The default value of this argument is nil for all buttons.

?help g_help

This argument works the same way as the g_help argument of hiDisplayAppDBox if you specify a Help button in the g_buttons argument and if the button calls hiHelp(’dBox dBoxName). Otherwise, this argument is not used.

For more information about specifying a Help button and a callback for it, see the description of the g_buttons and g_callbacks arguments.

Values Returned

If s_dialogStyle is ’modal, this function returns one of the following values when a button is clicked:

buttonIndex

The index of the button that is clicked, if the button does not have a callback associated with it. The first button in the dialog box is 1, the second is 2, and so on.

callbackReturnVal

The return value of the callback that is associated with the button that is clicked.

If s_dialogStyle is ’modeless, this function returns one of the following values immediately after the dialog box is displayed:

t

There is no error.

nil

There is an error.

Related Topics

General Dialog Box Functions

hiDisplayAppDBox

hiSetDBoxDefaultLocation

hiGetDBoxDefaultLocation


Return to top
 ⠀
X