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

hiCreateDisclosureTriangle

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

Description

A disclosure triangle is a low profile widget for displaying the additional information or functionality embedded in a form.

By default, a disclosure triangle is displayed in the closed position, pointing to the right (>). When you click the triangle, it points down (v) and triggers the ?callback, if specified. The ?callback usually displays or hides additional information in the form.

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

?labelText t_labelText

  

The prompt string, which appears as the label.

Default value: ""

?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 run 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

Default value: None.

?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 the fields in the ?offFields list are made visible if the disclosure field value is nil.

Default value: nil

?persistent g_state

  

When set to t, the initial state of the triangle is restored to the previously saved state and its final state is saved.

When set to nil, the initial triangle state is default (close) and its final sate is not saved.

Default value: t

The fields specified by ?onFields and ?offFields must have the same parent of the disclosure field. Therefore, these fields should be in the same scroll region, on the same page of a tab-field, or directly placed in the same form.
In addition, if the form is a hiLayout form, then the ?onFields and ?offFields list also includes symbols of layouts. These layouts must have the same parent of the disclosure field.

Values Returned

r_fieldHandle

Handle to the disclosure triangle.

Examples

rotateLeftBtn = hiCreateFormButton(
      ?name 'rotateLeftBtn
?buttonText ""
?buttonIcon list("rotate-90-left.png" 24 24)
?invisible nil
) rotateRightBtn = hiCreateFormButton(      ?name 'rotateRightBtn
?buttonText ""
?buttonIcon list("rotate-90-right.png" 24 24)
?invisible nil
) flipVerticalBtn = hiCreateFormButton(      ?name 'flipVerticalBtn
?buttonText ""
?buttonIcon list("flip-horizontal-axis.png" 24 24)
?invisible nil
) flipHorizontalBtn = hiCreateFormButton(      ?name 'flipHorizontalBtn
?buttonText ""
?buttonIcon list("flip-vertical-axis.png" 24 24)
?invisible nil
) myDiscForm = hiCreateLayoutForm( 'myDiscForm "My Disclosure Form"      hiCreateVerticalBoxLayout( 'myMainLayout ?items list(
hiCreateGridLayout( 'myGridLayout
?items list(
list( hiCreateDisclosureTriangle( ?name 'trFont
?labelText "Font (trFont)" ?value nil
?onFields '(cmbSt cmbHt cmbJt cmbES iconBtnLabel
cmbStLbl cmbHtLbl cmbJtLbl cmbESLbl
hBoxIconBtn)
?offFields '(cmbSm))
'horiz_align 'left 'row 0 'col 0)
list( hiCreateComboField( ?name 'cmbSm ?prompt " "
?items '("Stick") ?value "Stick")
'horiz_align 'left 'row 0 'col 1)
list( hiCreateLabel( ?name 'cmbStLbl ?labelText "Style"
?invisible t ?justification 'right)
'horiz_align 'right 'row 1 'col 0)
list( hiCreateComboField( ?name 'cmbSt ?prompt " "
?items '("Stick") ?value "Stick" ?invisible t)
'horiz_align 'left 'row 1 'col 1)
list( hiCreateLabel( ?name 'cmbHtLbl ?labelText "Height"
?invisible t ?justification 'right)
'horiz_align 'right 'row 2 'col 0)
list( hiCreateComboField( ?name 'cmbHt ?prompt " "
?items '("0.0625") ?value "0.0625" ?invisible t)
'horiz_align 'left 'row 2 'col 1)
list( hiCreateLabel( ?name 'cmbJtLbl ?invisible t
?labelText "Justification"
?justification 'right)
'horiz_align 'right 'row 3 'col 0)
list( hiCreateComboField( ?name 'cmbJt ?prompt " "
?items '("Lower Center") ?value "Lower Center"
?invisible t)
'horiz_align 'left 'row 3 'col 1)
list( hiCreateLabel( ?name 'cmbESLbl ?invisible t
?labelText "Entry Style"
?justification 'right)
'horiz_align 'right 'row 4 'col 0)
list( hiCreateComboField( ?name 'cmbES ?prompt " "
?items '("Fixed Offset") ?value "Fixed Offset"
?invisible t)
'horiz_align 'left 'row 4 'col 1)
list( hiCreateLabel( ?name 'iconBtnLabel
?labelText "Icon Buttons"
?justification 'right ?invisible t)
'horiz_align 'right 'row 5 'col 0)
list( hiCreateHorizontalBoxLayout('hBoxIconBtn
?items list(rotateLeftBtn rotateRightBtn
flipVerticalBtn flipHorizontalBtn )
?margins '(nil nil nil nil) ?spacing 0 ?invisible t)
'horiz_align 'left 'row 5 'col 1)
list( 'col_stretch 1 1 )
)
)
list( 'stretch_item 1 )
))
?buttonLayout 'OKCancel ?minSize 275:70)
hiDisplayForm( myDiscForm)

Related Topics

Form and Field Functions


Return to top
 ⠀
X