#include <YComboBox.h>
Inheritance diagram for YComboBox:

Public Member Functions | |
| YComboBox (const YWidgetOpt &opt, YCPString label) | |
| bool | editable () const |
| virtual char * | widgetClass () |
| YCPValue | changeWidget (const YCPSymbol &property, const YCPValue &newvalue) |
| YCPValue | queryWidget (const YCPSymbol &property) |
| virtual void | setValidChars (const YCPString &validChars) |
| YCPString | getValidChars () |
| virtual void | setInputMaxLength (const YCPInteger &numberOfChars) |
| const char * | userInputProperty () |
Protected Member Functions | |
| virtual YCPString | getValue () const=0 |
| virtual void | setValue (const YCPString &new_value)=0 |
| virtual int | getCurrentItem () const=0 |
| virtual void | setCurrentItem (int index)=0 |
Private Member Functions | |
| virtual void | saveUserInput (YMacroRecorder *macroRecorder) |
Private Attributes | |
| YCPString | validChars |
| bool | _editable |
ComboBox
A combo box is a combination of a selection box and an input field. It gives the user a one-out-of-many choice from a list of items. Each item has a ( mandatory ) label and an ( optional ) id. When the 'editable' option is set, the user can also freely enter any value. By default, the user can only select an item already present in the list.
The items are very much like SelectionBox items: They can have an (optional) ID, they have a mandatory text to be displayed and an optional boolean parameter indicating the selected state. Only one of the items may have this parameter set to "true"; this will be the default selection on startup.
| YComboBox::YComboBox | ( | const YWidgetOpt & | opt, | |
| YCPString | label | |||
| ) |
Constructor
| bool YComboBox::editable | ( | ) | const [inline] |
Returns whether or not any value ( not only from the list ) can be entered.
| virtual char* YComboBox::widgetClass | ( | ) | [inline, virtual] |
Returns a descriptive name of this widget class for logging, debugging etc.
Reimplemented from YSelectionWidget.
| YCPValue YComboBox::changeWidget | ( | const YCPSymbol & | property, | |
| const YCPValue & | newvalue | |||
| ) | [virtual] |
Implements the ui command changeWidget.
The label above the ComboBox describing what it is all about
Reimplemented from YWidget.
Implements the ui command queryWidget
Reimplemented from YWidget.
| void YComboBox::setValidChars | ( | const YCPString & | validChars | ) | [virtual] |
Change the valid input characters.
Overload this, but call YComboBox::setValidChars at the end of your own method.
| YCPString YComboBox::getValidChars | ( | ) |
Get the valid input characters.
| void YComboBox::setInputMaxLength | ( | const YCPInteger & | numberOfChars | ) | [virtual] |
Specify the amount of characters which can be inserted.
Overload this to limit the input.
| const char* YComboBox::userInputProperty | ( | ) | [inline, virtual] |
| virtual YCPString YComboBox::getValue | ( | ) | const [protected, pure virtual] |
Returns the ComboBox value.
| virtual void YComboBox::setValue | ( | const YCPString & | new_value | ) | [protected, pure virtual] |
Sets the ComboBox value to a random value that is not already in the item list. Will be called for editable ComboBox widgets only.
| virtual int YComboBox::getCurrentItem | ( | ) | const [protected, pure virtual] |
Returns the index of the currently selected item (from 0 on) or -1 if no item is selected.
| virtual void YComboBox::setCurrentItem | ( | int | index | ) | [protected, pure virtual] |
Selects an item from the list. Notice there intentionally is no corresponding getCurrentItem() method - use getValue() instead.
| void YComboBox::saveUserInput | ( | YMacroRecorder * | macroRecorder | ) | [private, virtual] |
YCPString YComboBox::validChars [private] |
Valid input characters
bool YComboBox::_editable [private] |
Any input ( not only from the list ) permitted?
1.5.0