- Your Widget Set For OpenGL
Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

ufo::UListBox Class Reference

A widget with several items. More...

#include <ulistbox.hpp>

Inheritance diagram for ufo::UListBox:

ufo::UScrollableWidget ufo::UWidget ufo::UObject ufo::UCollectable List of all members.

Public Types

typedef USignal3< UListBox *,
int, int > 
sig_selection_change_t
enum  SelectionMode { SingleSelection, MultipleSelection, NoSelection }

Public Member Functions

 UListBox (const std::vector< UString > &listDataA)
virtual int getUnitIncrement (Orientation orientation=Horizontal) const
virtual int getBlockIncrement (Orientation orientation=Horizontal) const
virtual UDimension getPreferredViewportSize () const
void addList (const std::vector< UString > &listData)
void addItem (UItem *itemA, int index=-1)
void addItem (const UString &itemA, int index=-1)
void addItem (UIcon *itemA, int index=-1)
void removeItem (unsigned int index)
void removeAllItems ()
UItemgetItemAt (unsigned int n) const
const std::vector< UItem * > & getItems () const
unsigned int getItemCount () const
SelectionMode getSelectionMode () const
void setSelectionMode (SelectionMode modeA)
int getSelectedIndex () const
void setSelectedIndex (int indexA)
void invertSelection ()
void selectAll ()
std::vector< unsigned int > getSelectedIndices () const
void setSelectedIndices (const std::vector< unsigned int > &indicesA)
bool isSelectedIndex (unsigned int indexA)
UItemgetSelectedItem ()
std::vector< UItem * > getSelectedItems ()
void setVisibleRowCount (int visibleRowCountA)
int getVisibleRowCount () const
UPoint indexToLocation (unsigned int indexA)
int locationToIndex (const UPoint &locationA)
sig_selection_change_tsigSelectionChanged ()

Protected Member Functions

virtual void paintWidget (UGraphics *g)
virtual UDimension getContentsSize (const UDimension &maxSize) const
virtual void processMouseEvent (UMouseEvent *e)
virtual void processKeyEvent (UKeyEvent *e)
virtual void processWidgetEvent (UWidgetEvent *e)
void addItemImpl (UItem *itemA, int index)
void fireSelectionEvent (int firstIndexA, int lastIndexA)

Detailed Description

A widget with several items.

This widget may be added to a scroll pane.

Author:
Johannes Schmidt


Member Typedef Documentation

typedef USignal3<UListBox*, int, int> ufo::UListBox::sig_selection_change_t
 

UListBox * listBox, int firstIndex, int lastIndex


Member Enumeration Documentation

enum ufo::UListBox::SelectionMode
 

Allow either single selection or multiple selection. So far, multiple selection isn't fully implemented (or should I say not at all).


Member Function Documentation

void ufo::UListBox::addItem UIcon itemA,
int  index = -1
 

Adds item at index. References item.

void ufo::UListBox::addItem const UString itemA,
int  index = -1
 

Adds item at index. References item.

void ufo::UListBox::addItem UItem itemA,
int  index = -1
 

Adds item at index. References item.

void ufo::UListBox::addList const std::vector< UString > &  listData  ) 
 

Appends the strings of list data to the list box. Using add prefix instead of insert to match UWidget and other classes.

virtual int ufo::UListBox::getBlockIncrement Orientation  orientation = Horizontal  )  const [virtual]
 

Returns the positive increment for scrolling one block (page up/down)

Reimplemented from ufo::UScrollableWidget.

virtual UDimension ufo::UListBox::getPreferredViewportSize  )  const [virtual]
 

The size of the visible viewport for this scrollable widget.

Reimplemented from ufo::UScrollableWidget.

virtual int ufo::UListBox::getUnitIncrement Orientation  orientation = Horizontal  )  const [virtual]
 

Returns the positive increment for scrolling one "unit"

Reimplemented from ufo::UScrollableWidget.

UPoint ufo::UListBox::indexToLocation unsigned int  indexA  ) 
 

Returns:
The top-left corner of the indexed list box item.

int ufo::UListBox::locationToIndex const UPoint locationA  ) 
 

Returns:
The Index of the item at locationA or -1 when there is no item under the given point.

virtual void ufo::UListBox::paintWidget UGraphics g  )  [protected, virtual]
 

Paints the widget itsself. Normally, this means drawing the UI. This is the method which should be overriden if you want to use your own drawing code (and don't want to create custom UI classes).

Reimplemented from ufo::UWidget.

virtual void ufo::UListBox::processKeyEvent UKeyEvent e  )  [protected, virtual]
 

Processes key events. Primarily, it is used to notify listeners.

Reimplemented from ufo::UWidget.

virtual void ufo::UListBox::processMouseEvent UMouseEvent e  )  [protected, virtual]
 

Processes focus events. Primarily, it is used to notify listeners.

Reimplemented from ufo::UWidget.

virtual void ufo::UListBox::processWidgetEvent UWidgetEvent e  )  [protected, virtual]
 

Processes widget events. Primarily, it is used to notify listeners.

Reimplemented from ufo::UWidget.

void ufo::UListBox::removeItem unsigned int  index  ) 
 

Removes item at index.

void ufo::UListBox::setVisibleRowCount int  visibleRowCountA  ) 
 

Sets the row count which should be visible when this list is shown within a scrollpane.


The documentation for this class was generated from the following file:
The libUFO Project - written by Johannes Schmidt