hiCreateCyclicField
hiCreateCyclicField(?names_fieldName?choicesl_enumerations?promptt_fieldPrompt[?valueg_currentValue] [?defValueg_defaultValue] [?callbackg_callback] [?helpg_fieldHelp] [?fontt_font] [?enabledg_enabled] [?invisibleg_invisible] [?keepHistoryg_keepHistory] ) =>r_fieldHandle
Description
Creates a cyclic field for a form. A cyclic field contains a list of string or icon enumerations, which are displayed in a drop-down list. Only one item can be selected at a time.
A maximum of 42 items are displayed in the drop-down list; if there are more items, a scroll bar appears.
This field can also have a context menu, that is, a pop-up menu that is displayed when you right-click on the field.
For information on creating tooltips for fields, see Creating Tool Tips for Fields.
Arguments
Values Returned
Examples
The following sample displays different types of fields in a form.
;;; creating the list of items in the cyclic field
trCyclicList = '(
"1" "2" "3" "4" "5" "6" "7" "8" "9" "10"
"11" "12" "13" "14" "15" "16" "17" "18" "19" "20" "21" "22"
)
;;; creating the cyclic field
trCyclicField = hiCreateCyclicField(
?name 'trCyclicField
?prompt "Cycle Through: "
?choices trCyclicList
?value "3"
?defValue "7"
?callback "println"
)
;;; creating the boolean button field.
;;; The callback for the trBooleanButton field dynamically retrieves the new value
;;;of the field and embeds it in a message
trBooleanButton = hiCreateBooleanButton(
?name 'trBooleanButton
?buttonText "Boolean"
?value t
?defValue nil
?callback "println( hiGetCurrentForm()->trBooleanButton-> value )"
)
;;; creating the button box field trButtonBoxField = hiCreateButtonBoxField( ?name 'trButtonBoxField ?prompt "Button Box" ?choices '("Do a" "Do b" "Do c") ?callback '("println( 'a )" "println( 'b )" "println( 'c)" ) )
;;; creating the radio field.
;;; The callback for the trConeRadioField field dynamically retrieves the new value
;;; of the field and imbeds it in a message
trConeRadioField = hiCreateRadioField(
?name 'trConeRadioField
?prompt "Cone Size: "
?choices list( "small" "medium" "large" )
?value "small"
?defValue "large"
?callback '( "printf( \"\n%s cone chosen \" hiGetCurrentForm() ->trConeRadioField->value )" )
)
;;; creating the scale field
trScaleField = hiCreateScaleField(
?name 'trScaleField
?prompt "Slide "
?value 500
?defValue 250
?callback "println(\"scale changed \")"
?range 0:750
)
;;; creating the label field
trLabelField = hiCreateLabel(
?name 'trLabelField
?labelText "Label"
?justification CDS_JUSTIFY_RIGHT
)
;;; creating the form
hiCreateAppForm(
?name 'trSampleForm
?formTitle "Sample Form"
?callback "println( 'FormAction )"
?fields
list(
trCyclicField
trBooleanButton
trButtonBoxField
trConeRadioField
trScaleField
trLabelField
)
?unmapAfterCB t
) ; hiCreateAppForm
;;; displaying the form
hiDisplayForm( trSampleForm )
Related Topics
Creating Context Menus for Fields
Return to top