Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

UChoice Class Reference

Exclusive selector for making UListbox. More...

#include <uchoice.hpp>

Inheritance diagram for UChoice:

UProp UBrick List of all members.

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 UBoxgetItem () const
 returns the selected item (null if none selected).
virtual UBoxgetLastItem () const
virtual int getLastIndex () const
virtual UBoxsetItem (UBox *, bool update=true)
virtual UBoxsetItem (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 UBoxsetIndex (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

UChoiceuchoice ()
 creator shortcut (see constructor for details).

Detailed Description

Exclusive selector for making UListbox.


Member Function Documentation

void UChoice::changed bool  update_now,
UBox target
 

called when the selection is changed.

This function:

  • updates grahics (if arg is true)
  • first fires object's UOn::change callbacks
  • then fires parents' UOn::select callbacks

void UChoice::select int   )  [virtual]
 

selects the item at this index in the list (0 is first item, -1 last item).

setIndex() returns the selected item (if any)

void UChoice::select UBox  )  [virtual]
 

selects this item (deselects all items if UBox* is null).

setItem() returns the selected item (if any)


The documentation for this class was generated from the following files:
Generated on Sun Jul 3 23:15:50 2005 for Ubit[Eric.Lecolinet@enst.fr] by  doxygen 1.4.3-20050530