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

hiCreateDisclosureButton

hiCreateDisclosureButton(  
?name s_name
[ ?callback g_callback ]
[ ?value g_value ]
[ ?defValue g_defValue ]
[ ?help S_help ]
[ ?enabled g_enabled ]
[ ?invisible g_invisible ]
[ ?onFields l_onFields ]
[ ?offFields l_offFields ]
)
=> r_fieldHandle 

Description

A disclosure button is a button without a label used for displaying the additional information or functionality associated with another widget.

By default, a disclosure button is displayed in the closed position, pointing down [v]. When you click a button, it points up [^] and triggers the ?callback, which is usually used to display additional fields.

This function checks for duplicate fields in the onFields and offFields lists. In case a field appears in both lists, it gets removed from both lists and a warning message is displayed.

In addition, whenever a field is added to a form after the form is displayed, the form code checks if the field is listed in any disclosure field’s disclosureList. If it finds the field in any one of the lists, the code sets the visibility of the field appropriately prior to adding the field to the form.

Arguments

?name s_name

Handle to this field within a form. To reference it, use:

formHandle->fieldSym

?callback g_callback

  

A string, function object, or symbol type callback. The callback is called as soon as the button state changes.

If the callback is of String type, you can specify one or more SKILL functions or statements that should be executed when the value of the field changes.

Default value: nil

?value g_value

The initial and current value of the field. It must be an integer within the range specified by l_rangeOfItems.

Default value: nil

?defValue g_defValue

  

Optional default value of the field. This value is equal to the initial entry in g_value if defaultValue is not specified. To reference the default value, use:

formHandle->fieldSym->defValue

?help S_help

A string or symbol used to reference help. If not specified, s_name is used. This argument is currently not used.

Default value: ""

?enabled g_enabled

  

Specifies whether the fields in the layout are enabled. The default value is t.

?invisible g_invisible

  

Specifies whether the layout and the fields within are invisible. The default value is nil.

?onfields l_onFields

  

If specified, it must be a list of the symbols of fields. All the fields in the ?onFields list are made visible if the disclosure field value is not nil.

Default value: nil

?offFields l_offFields

  

If specified, it must be a list of the symbols of fields. All fields in the ?offFields list are made visible if the disclosure field value is nil.

Default value: nil

Values Returned

r_fieldHandle

Handle to the disclosure button.

Examples

(defun make_font_selection_form ( name use_disclosure_button )
    (let ((attachment (bor hicLeftPositionSet hicTopPositionSet)) 
     (font_disclosure_args ;; args for hiCreateDisclosure... below
(list '?name 'trFont '?value nil
'?onFields '(cmbSt cmbHt cmbJt cmbES)
'?offFields '(cmbSm)
'?callback (lambda (field scope value)
(hiReattachField
scope 'trCo
(list (list 5 (if value 170 44)) 20:20 10)
(bor hicLeftPositionSet hicTopPositionSet)))))
(fields
(list
(list (hiCreateComboField
?name 'cmbSm ?prompt " " ?items '("Stick") ?value "Stick")
110:10 160:25 10)
(list (hiCreateComboField
?name 'cmbSt ?prompt " Style" ?items '("Stick")
?value "Stick" ?invisible t) 50:40 220:25 70)
(list (hiCreateComboField
?name 'cmbHt ?prompt " Height" ?items '("0.0625")
?value "0.0625" ?invisible t) 50:70 220:25 70)
(list (hiCreateComboField
?name 'cmbJt ?prompt "Justification" ?items '("Lower Center")
?value "Lower Center" ?invisible t) 50:100 220:25 70)
(list (hiCreateComboField
?name 'cmbES ?prompt " Entry Style" ?items '("Fixed Offset")
?value "Fixed Offset" ?invisible t) 50:130 220:25 70))))
(unless use_disclosure_button
font_disclosure_args= (append font_disclosure_args
'(?labelText "Font (trFont)")))
fields= (cons (list
(apply (if use_disclosure_button 'hiCreateDisclosureButton
'hiCreateDisclosureTriangle) font_disclosure_args)
5:14 20:20 10)
fields)
(hiCreateAppForm
     ?name name ?formTitle (sprintf nil "Font Selection (%s)"  name)
?buttonLayout 'OKCancel ?dontBlock t ?initialSize 300:120 ?fields fields
?attachmentList (list attachment attachment attachment attachment
attachment attachment attachment))))
(hiDisplayForm (make_font_selection_form (gensym 'form) t) 200:100)

Related Topics

Form and Field Functions


Return to top
 ⠀
X