YMultiSelectionBox Class Reference
Implementation of the MultiSelectionBox widget.
More...
#include <YMultiSelectionBox.h>
Inheritance diagram for YMultiSelectionBox:
List of all members.
Detailed Description
Implementation of the MultiSelectionBox widget.
MultiSelectionBox
- string label
- list items the items initially contained in the selection box shrinkable make the widget very small `MultiSelectionBox( `id( `topping ), "select pizza toppings:", [ "Salami", `item( `id( `cheese ), "Cheese", true ) ] ) MultiSelectionBox1.ycp MultiSelectionBox2.ycp MultiSelectionBox3.ycp
The MultiSelectionBox displays a ( scrollable ) list of items from which any number ( even nothing! ) can be selected. Use the MultiSelectionBox's SelectedItems property to find out which.
Each item can be specified either as a simple string or as `item( ... ) which includes an ( optional ) ID and an ( optional ) 'selected' flag that specifies the initial selected state ( 'not selected', i.e. 'false', is default ).
Constructor & Destructor Documentation
|
|
Constructor - Parameters:
-
| text | the initial text of the MultiSelectionBox label |
| opt | the widget options |
|
Member Function Documentation
|
|
Adds an item to the selection box. |
|
|
Implements the ui command changeWidget.
Reimplemented from YWidget. |
| void YMultiSelectionBox::deleteAllItems |
( |
|
) |
[virtual] |
|
|
|
Delete all items.
Reimplement this in derived classes, but make sure to call the parent method! |
| virtual void YMultiSelectionBox::deselectAllItems |
( |
|
) |
[protected, pure virtual] |
|
|
|
Deselect all items.
Reimplement this in derived classes! |
| virtual int YMultiSelectionBox::getCurrentItem |
( |
|
) |
[protected, pure virtual] |
|
|
|
Returns the index of the item that currently has the keyboard focus.
Reimplement this in derived 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. |
| virtual void YMultiSelectionBox::itemAdded |
( |
const YCPString & |
text, |
|
|
bool |
selected |
|
) |
[protected, pure virtual] |
|
|
|
Called when an item has been added.
Reimplement this in derived classes!
- Parameters:
-
| string | text of the new item |
| selected | true if the item should be selected. |
|
| virtual bool YMultiSelectionBox::itemIsSelected |
( |
int |
index |
) |
[protected, pure virtual] |
|
|
|
Check whether or not item #index is selected.
Reimplement this in derived classes! |
| int YMultiSelectionBox::itemWithId |
( |
const YCPValue & |
id, |
|
|
bool |
report_error |
|
) |
[protected] |
|
|
|
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 - Parameters:
-
| report_error | set this to true, if you want me to report an error if non item can be found. |
|
| int YMultiSelectionBox::numItems |
( |
|
) |
const [protected] |
|
|
|
Returns the current number of items |
|
|
Implements the ui command queryWidget
Reimplemented from YWidget. |
| void YMultiSelectionBox::saveUserInput |
( |
YMacroRecorder * |
macroRecorder |
) |
[private, virtual] |
|
|
|
Save the widget's user input to a macro recorder. Intentionally declared as "private" so all macro recording internals are handled by the abstract libyui level, not by a specific UI.
Reimplemented from YWidget. |
| virtual void YMultiSelectionBox::selectItem |
( |
int |
index |
) |
[protected, pure virtual] |
|
|
|
Select item #index.
Reimplement this in derived classes! |
| virtual void YMultiSelectionBox::setCurrentItem |
( |
int |
index |
) |
[protected, pure virtual] |
|
|
|
Set the keyboard focus to one item.
Reimplement this in derived classes! |
| void YMultiSelectionBox::setLabel |
( |
const YCPString & |
label |
) |
[virtual] |
|
|
|
Change the label text. Overload this, but call YTextEntry::setLabel at the end of your own function. |
| const char* YMultiSelectionBox::shortcutProperty |
( |
|
) |
[inline, virtual] |
|
|
|
The name of the widget property that holds the keyboard shortcut. Inherited from YWidget.
Reimplemented from YWidget. |
| virtual char* YMultiSelectionBox::widgetClass |
( |
|
) |
[inline, virtual] |
|
|
|
Returns a descriptive name of this widget class for logging, debugging etc.
Reimplemented from YWidget. |
Member Data Documentation
|
|
The current list of item ids. We make destructive changes to this variable, so make sure only one reference to it exists! |
|
|
The current list of item labels. We make destructive changes to this variable, so make sure only one reference to it exists! |
|
|
The current label of the selectionbox |
The documentation for this class was generated from the following files:
Generated on Tue Mar 22 11:31:40 2005 for yast2-core by
1.4.1