#include <YSelectionWidget.h>
Inheritance diagram for YSelectionWidget:
Public Member Functions | |
YSelectionWidget (const YWidgetOpt &opt, YCPString label) | |
virtual char * | widgetClass () |
virtual const char * | shortcutProperty () |
void | parseItemList (const YCPList &itemlist) |
Static Public Member Functions | |
static bool | parseItem (const YCPTerm &itemTerm, YCPValue &item_id_ret, YCPString &item_label_ret, YCPString &item_icon_ret, YCPBoolean &item_selected_ret, YCPList &sub_item_list_ret) |
Protected Member Functions | |
virtual void | itemAdded (const YCPString &string, int index, bool selected)=0 |
int | itemWithId (const YCPValue &id, bool report_error) |
int | numItems () const |
virtual void | setLabel (const YCPString &label) |
YCPString | getLabel () |
virtual void | addItem (const YCPValue &id, const YCPString &text, const YCPString &icon, bool selected) |
virtual void | deleteAllItems () |
virtual YCPValue | changeLabel (const YCPValue &newValue) |
virtual YCPValue | changeItems (const YCPValue &newValue) |
YCPString | itemIcon (int item_no) const |
bool | hasIcons () const |
Protected Attributes | |
YCPString | label |
YCPList | item_ids |
YCPList | item_labels |
Private Attributes | |
YCPList | item_icons |
bool | _hasIcons |
|
Constructor
|
|
Adds one item |
|
Changes the widgets displayed items. Is used in every changeWidget(...) function in derived classes. |
|
Changes the widgets label. Is used in every changeWidget(...) function in derived classes. |
|
Cleares the two lists item_ids and item_labels. This function is calles out of the corresponding YQ classes. |
|
Get the current label text. This method cannot be overidden. The value of the label cannot be changed other than by calling setLabel, i.e. not by the ui. Therefore setLabel stores the current label in label. |
|
Returns 'true' if any item of this widget has an icon |
|
Called when an item has been added. Overload this to fill the ui specific widget with items.
|
|
Returns the full path name for the icon that corresponds with item number item_no or YCPVoid() if there is none. |
|
Searches for an item with a certain id or a certain label. Returns the index of the found item or -1 if none was found
|
|
Returns the current number of items |
|
Parse one `item() term with `id() [optional] `icon() [optional] string label [MANDATORY] bool selected [optional] list subItemList [optional] Example: `item( `id(`my_id), `icon( "colorful.png" ), "My Label", true ) The order of those parameters within `item() is arbitrary. The _ret Parameters are are return parameters that will be changed by this function. If the subItemList is not desired, rejecting it is the caller's responsibility (check if ! .isNull() and issue error). Returns 'true' on success, 'false' on error. |
|
Parses a given itemlist and calls addItem(...) to insert entries. |
|
Change the label text. Overload this, but call YTextEntry::setLabel at the end of your own function. |
|
The name of the widget property that holds the keyboard shortcut. Inherited from YWidget. Reimplemented from YWidget. |
|
Returns a descriptive name of this widget class for logging, debugging etc. Reimplemented from YWidget. Reimplemented in YComboBox, YMultiSelectionBox, and YSelectionBox. |
|
|
|
The curent list of item icons. We make destructive changes to this variable, so make sure only one reference to it exists! |
|
The current list of item ids |
|
The current list of item labels |
|
The current label of the SelectionWidget |