Inheritance diagram for ChoicePropertyComponent:

This type of property component contains a list of options and has a combo box to choose one.
Your subclass's constructor must add some strings to the choices StringArray and these are shown in the list.
The getIndex() method will be called to find out which option is the currently selected one. If you call refresh() it will call getIndex() to check whether the value has changed, and will update the combo box if needed.
If the user selects a different item from the list, setIndex() will be called to let your class process this.
Public Member Functions | |
| ChoicePropertyComponent (const String &propertyName) | |
| Creates the component. | |
| ~ChoicePropertyComponent () | |
| Destructor. | |
| virtual void | setIndex (const int newIndex)=0 |
| Called when the user selects an item from the combo box. | |
| virtual int | getIndex () const =0 |
| Returns the index of the item that should currently be shown. | |
| const StringArray & | getChoices () const throw () |
| Returns the list of options. | |
| void | refresh () |
| void | comboBoxChanged (ComboBox *) |
Protected Attributes | |
| StringArray | choices |
| The list of options that will be shown in the combo box. | |
|
|
Creates the component. Your subclass's constructor must add a list of options to the choices member variable. |
|
|
Destructor.
|
|
|
Called when the user selects an item from the combo box. Your subclass must use this callback to update the value that this component represents. The index is the index of the chosen item in the choices StringArray. |
|
|
Returns the index of the item that should currently be shown. This is the index of the item in the choices StringArray that will be shown. |
|
|
Returns the list of options.
|
|
|
For internal use only.
Implements PropertyComponent. |
|
|
For internal use only.
Implements ComboBoxListener. |
|
|
The list of options that will be shown in the combo box. Your subclass must populate this array in its constructor. If any empty strings are added, these will be replaced with horizontal separators (see ComboBox::addSeparator() for more info). |