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

URadioSelect Class Reference

Exclusive selector for selecting boxes (eg. More...

#include <uchoice.hpp>

Inheritance diagram for URadioSelect:

UProp UBrick List of all members.

Public Member Functions

 URadioSelect (UIntg &index)
 constructor.
virtual ~URadioSelect ()
 destructor.
virtual void setCanUnselectMode (bool)
virtual bool isCanUnselectMode () const
 clicking on a selected item will unselect it if true (default is false).
virtual UGroupgetItem () const
 returns the selected item (null if none selected)
virtual void setItem (UGroup *)
virtual void setItem (UGroup &)
virtual void select (UGroup &)
 selects this item (deselects all items if null given as an arg).
virtual void unselect ()
 unselects all items
UIntgindex () const
virtual int getIndex () const
 returns the index of the selected item (-1 if nothing selected; 0 if first item selected).
virtual void setIndex (int)
virtual void setIndex (const UIntg &)
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).
virtual void changed (bool update_now)
 called when the selection is changed.

Friends

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

Detailed Description

Exclusive selector for selecting boxes (eg.

UCheckbox, UButton, etc.).

This selector must be a child of the items it selects. These items are automatically made selectable (for instance an UButton will becone selectable if an USelect is added to it as a child).

  Exemple:
    URadioSelect& sel = uradioSelect();
    ubox( ubutton(sel + "One" + UMode::selected)
          + ucheckbox(sel + "Two")
          + utextbox(sel + "Three")
        ) 
  


Constructor & Destructor Documentation

URadioSelect::URadioSelect UIntg index  ) 
 

constructor.

Notes:

  • this selector must be a child of the items it selects
  • selection is exclusive
  • no item is initially selected


Member Function Documentation

void URadioSelect::changed bool  update_now  )  [virtual]
 

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

Reimplemented from UProp.


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