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

ufo::UComboBox Class Reference

A button with a popup item list. More...

#include <ucombobox.hpp>

Inheritance diagram for ufo::UComboBox:

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

Public Types

typedef USignal2< UComboBox *,
int > 
sig_activated_t
typedef USignal2< UComboBox *,
int > 
sig_highlighted_t
typedef USignal3< UComboBox *,
int, int > 
sig_selection_change_t

Public Member Functions

 UComboBox (const std::vector< UString > &listDataA)
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
void setVisibleRowCount (int visibleRowCountA)
int getVisibleRowCount () const
int getCurrentItem () const
void setCurrentItem (int index)
std::string getCurrentText () const
void setCurrentText (const std::string &text)
virtual void popup ()
virtual void setListBox (UListBox *listBox)
UListBoxgetListBox () const
virtual void setTextEdit (UTextEdit *textEdit)
UTextEditgetTextEdit () const
sig_activated_t & sigActivated ()
sig_highlighted_t & sigHighlighted ()
sig_selection_change_t & sigSelectionChanged ()

Protected Member Functions

virtual UDimension getContentsSize (const UDimension &maxSize) const
virtual void processMouseEvent (UMouseEvent *e)
virtual void processKeyEvent (UKeyEvent *e)

Protected Attributes

UListBoxm_listBox
UTextEditm_textEdit

Detailed Description

A button with a popup item list.

A UComboBox provides a list of options as choice to the user.

Currently it is implemented using a text edit and a list box widget. But this might change.

Author:
Johannes Schmidt


Member Function Documentation

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

Adds item at index. References item.

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

Adds item at index. References item.

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

Adds item at index. References item.

void ufo::UComboBox::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.

int ufo::UComboBox::getCurrentItem  )  const
 

Returns the currently activated item. This item normally shows up as content of the text field.

std::string ufo::UComboBox::getCurrentText  )  const
 

Returns the text representation of the current item.

See also:
getCurrentItem

virtual void ufo::UComboBox::popup  )  [virtual]
 

Pops up the combo box menu

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

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

Reimplemented from ufo::UWidget.

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

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

Reimplemented from ufo::UWidget.

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

Removes item at index.

void ufo::UComboBox::setVisibleRowCount int  visibleRowCountA  ) 
 

Sets the row count which should be visible when the combo box pops up its menu.


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