the Parameter to modify
Optional
opt_label: null | stringthe text label to show besides this choice, or null
or
empty string for no label. If undefined
, then the Parameter's name is used.
Optional
opt_choices: string[]an array of localized strings giving the names of the menu items; if not specified, then the Parameter's choices are used.
Optional
opt_values: string[]array of values corresponding to the choices; if not specified, then the Parameter's values are used.
Protected
choicesThe menu items shown to the user for each choice, an array of localized (translated) strings.
Returns the index of the currently selected choice, or -1 if no item selected. The first item has index zero. See setChoice.
the index of the currently selected choice, or -1 if no item selected
Notifies this Observer that a change has occurred in the Subject.
contains information about what has changed in the Subject: typically either a one-time GenericEvent, or a change to the value of a Parameter
Private
rebuildChanges the menu item shown by this control, and sets the target to have the
corresponding value by firing the setter
function. An index of -1 causes this control
to enter the
"no selection" state.
the index of the chosen item within array of choices, where the first item has index zero and -1 means no item is selected
Changes the array of choices and modifies the current choice to match the target's
state. The setter
function is not called.
the new set of choices to display
the new set of values that correspond to the choices
if choices and values have different length
Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.
For an object whose main purpose is to represent another Printable object, it is
recommended to include the result of calling toStringShort
on that other object.
For example, calling toStringShort()
on a DisplayShape might return something like
this:
DisplayShape{polygon:Polygon{'chain3'}}
a minimal string representation of this object.
Generated using TypeDoc
A pop-up menu which synchronizes its state with the Parameter of a Subject.
When the value of the ChoiceControl is changed, the Parameter's value is changed accordingly and therefore the Subject broadcasts the Parameter's value to all its Observers.
ChoiceControl extends ChoiceControlBase, which has getter and setter functions that operate on strings. Therefore the getter and setter functions used here are Parameter.getAsString and Parameter.setFromString.
Choices and Values
If the choices and values are not specified as arguments to the constructor, then the choices and values of the Parameter are used, see Parameter.getChoices and Parameter.getValues.
If the choices and values are specified as arguments to the constructor, those will override the choices and values of the Parameter.