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

hiDisplayForm

hiDisplayForm( 
g_form 
[ l_location ] 
) 
=> t / nil

Description

Displays a form. Do not use hiDisplayForm for displaying options forms. You can also use this function to bring a form to the top of the screen if the form is covered by other windows.

Arguments

g_form

Either a valid form handle returned from hiCreateAppForm or hiCreateForm, or a symbol whose value is a valid form handle.

l_location

This argument is ignored if the form placement style is anything other than the default. If specified, the form is displayed with its upper left corner at the given location. If no location is specified, the form first appears at a default position set by hiSetFormPosition, if previously specified (again, only if the form placement style is the default). Once a form is displayed, it subsequently appears in the position it last appeared on the screen.

The default value can be set in your .Xdefaults file with the line:

Opus.formPlacement: default

or by setting the formPlacement property of the Command Interpreter Window to "default" with the line:

hiGetCIWindow()->formPlacement="default"

If you specify -1:-1 for the l_location argument, this causes the form to be displayed centered under the cursor.

Values Returned

t

The form is displayed.

nil

You selected Cancel to bring the form down.

If you set the g_dontBlock argument of the hiCreateAppForm function set to t, a call to hiDisplayForm() immediately return t.

Examples

;****************************************
;Sample form and fields
;****************************************
; Create string entry for the form. 
procedure( myformDefineFields()
  strfldglb = hiCreateStringField(
    ?name `strfldglb
    ?prompt "sample string field"    ;;; FIELD1, a string type
    ?defValue "initial string"
    ?callback "my_strfldglb_cb()"
    ?editable t
)
  ; Create a Boolean button for the form. 
  boolfldglb = hiCreateBooleanButton(
    ?name `boolfldglb
    ?buttonText "sample boolean field"        ;;; FIELD2, a boolean type
    ?defValue t
    ?callback "my_boolfldglb_cb()"
  )
  list( strfldglb boolfldglb )
)
; Generate the form
procedure( myformcreateform()
  if( !boundp(`myformglb) || (myformglb == nil)
    then
    myformglb = hiCreateAppForm(
      ?name `myformglb
      ?fields myformDefineFields()
      ?formTitle "My first Form"
      ?callback "myformglb_cb()"
      ?buttonLayout `OKCancel
    )
  )
  myformglb
)
; Display the form
procedure( myformdisplayform()
  myformcreateform()    ;;; Creation and Display are separate
  hiDisplayForm(`myformglb)
)
; Check the current state of the form
hiIsFormDisplayed(myformglb) =>nil
myformdisplayform()
hiIsFormDisplayed(myformglb) 
=>t

Related Topics

hiCreateAppForm

Form and Field Functions


Return to top
 ⠀
X