Wt::WSelectionBox Class Reference
[Model/view system]

A selection box allows selection from a list of options. More...

#include <Wt/WSelectionBox>

Inheritance diagram for Wt::WSelectionBox:

Inheritance graph
[legend]

List of all members.

Public Member Functions

int verticalSize () const
 Set the number of items that are visible.
void setVerticalSize (int items)
 Get the number of items that are visible.
void setSelectionMode (SelectionMode mode)
 Set the selection mode.
SelectionMode selectionMode () const
 Get the selection mode.
const std::set< int > & selectedIndexes () const
 Get the current selection (in ExtendedSelection mode).
void setSelectedIndexes (const std::set< int > &selection)
 Set the selection (in ExtendedSelection mode).
void clearSelection ()
 Clear the current selection.


Detailed Description

A selection box allows selection from a list of options.

WSelectionBox is an inline widget.

By default, a selection box may be used to let the user select one item from a list. This may be changed to multiple selection mode using setSelectionMode().

The current selection may be set and read using setCurrentIndex() and currentIndex(), for SingleSelection mode, or setSelectedIndexes() and selectedIndexes() for ExtendedSelection mode. The inherited signals activated and sactivated are not emited in the ExtendedSelection mode, use the signal changed instead.


Member Function Documentation

int Wt::WSelectionBox::verticalSize (  )  const [inline]

Set the number of items that are visible.

If more items are available, a scroll-bar is provided.

void Wt::WSelectionBox::setSelectionMode ( SelectionMode  mode  ) 

Set the selection mode.

The default selection mode is SingleSelection. You can change to ExtendedSelection to allow selection of multiple items.

SelectionMode Wt::WSelectionBox::selectionMode (  )  const [inline]

Get the selection mode.

See also:
setSelectionMode(SelectionMode)

const std::set<int>& Wt::WSelectionBox::selectedIndexes (  )  const [inline]

Get the current selection (in ExtendedSelection mode).

Get the list of currently selected items. This method is only defined when selectionMode() is ExtendedSelection. Otherwise, you should use currentIndex() to get item currently selected.

See also:
currentIndex()

void Wt::WSelectionBox::setSelectedIndexes ( const std::set< int > &  selection  ) 

Set the selection (in ExtendedSelection mode).

For an ExtendedSelection mode, set the list of currently selected items.

See also:
selectedIndexes()

void Wt::WSelectionBox::clearSelection (  ) 

Clear the current selection.

Clears the current selection.

See also:
setCurrentIndex(), setSelectedIndexes()


Generated on Mon Jan 26 14:14:10 2009 for Wt by doxygen 1.5.6