Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

YMultiSelectionBox Class Reference

Implementation of the MultiSelectionBox widget. More...

#include <YMultiSelectionBox.h>

Inheritance diagram for YMultiSelectionBox:

YWidget List of all members.

Public Member Functions

 YMultiSelectionBox (const YWidgetOpt &opt, YCPString label)
virtual char * widgetClass ()
void addItem (const YCPString &text, const YCPValue &id=YCPVoid(), bool selected=false)
YCPValue changeWidget (const YCPSymbol &property, const YCPValue &newvalue)
YCPValue queryWidget (const YCPSymbol &property)
virtual void setLabel (const YCPString &label)
YCPString getLabel ()
virtual void deleteAllItems ()
const char * shortcutProperty ()

Protected Member Functions

virtual void itemAdded (const YCPString &text, bool selected)=0
virtual bool itemIsSelected (int index)=0
virtual void selectItem (int index)=0
virtual void deselectAllItems ()=0
virtual int getCurrentItem ()=0
virtual void setCurrentItem (int index)=0
int numItems () const
int itemWithId (const YCPValue &id, bool report_error)

Protected Attributes

YCPString label
YCPList item_ids
YCPList item_labels

Private Member Functions

virtual void saveUserInput (YMacroRecorder *macroRecorder)

Detailed Description

Implementation of the MultiSelectionBox widget.

MultiSelectionBox

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

YMultiSelectionBox::YMultiSelectionBox const YWidgetOpt opt,
YCPString  label
 

Constructor

Parameters:
text the initial text of the MultiSelectionBox label
opt the widget options


Member Function Documentation

void YMultiSelectionBox::addItem const YCPString text,
const YCPValue id = YCPVoid(),
bool  selected = false
 

Adds an item to the selection box.

YCPValue YMultiSelectionBox::changeWidget const YCPSymbol property,
const YCPValue newvalue
[virtual]
 

Implements the ui command changeWidget.

string Label The label above the list describing what it is all about

string CurrentItem The item that currently has the keyboard focus

id_list SelectedItems The items that are currently selected

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!

YCPString YMultiSelectionBox::getLabel  ) 
 

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

YCPValue YMultiSelectionBox::queryWidget const YCPSymbol property  )  [virtual]
 

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

YCPList YMultiSelectionBox::item_ids [protected]
 

The current list of item ids. We make destructive changes to this variable, so make sure only one reference to it exists!

YCPList YMultiSelectionBox::item_labels [protected]
 

The current list of item labels. We make destructive changes to this variable, so make sure only one reference to it exists!

YCPString YMultiSelectionBox::label [protected]
 

The current label of the selectionbox


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:25 2007 for yast2-core by doxygen 1.3.6