#include <uchoice.hpp>
Inheritance diagram for UChoice:

Public Member Functions | |
| UChoice (UBox *container=null) | |
| constructor. | |
| virtual | ~UChoice () |
| destructor. | |
| virtual void | setCanUnselectMode (bool) |
| virtual bool | isCanUnselectMode () const |
| clicking on a selected item will unselect it if true (default is false). | |
| virtual UBox * | getItem () const |
| returns the selected item (null if none selected). | |
| virtual UBox * | getLastItem () const |
| virtual int | getLastIndex () const |
| virtual UBox * | setItem (UBox *, bool update=true) |
| virtual UBox * | setItem (UBox &, bool update=true) |
| virtual void | select (UBox &) |
| selects this item (deselects all items if UBox* is null) | |
| virtual void | unselect () |
| unselects all items | |
| virtual int | getIndex () const |
| returns the index of the selected item (-1 if nothing selected; 0 if first item selected). | |
| virtual UBox * | setIndex (int, bool update=true) |
| virtual void | select (int) |
| selects the item at this index in the list (0 is first item, -1 last item) | |
| virtual void | update () |
| updates graphics (this function must be called when adding or removing items). | |
| void | changed (bool update_now, UBox *target) |
| called when the selection is changed | |
Friends | |
| UChoice & | uchoice () |
| creator shortcut (see constructor for details). | |
|
||||||||||||
|
called when the selection is changed This function:
|
|
|
selects the item at this index in the list (0 is first item, -1 last item) setIndex() returns the selected item (if any) |
|
|
selects this item (deselects all items if UBox* is null) setItem() returns the selected item (if any) |
1.4.1