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

CAUGuiSelector Class Reference

a useful helper widget, i.e. to select different layers for a CAUGuiLayeredPane More...

#include <CAUGuiSelector.h>

Inheritance diagram for CAUGuiSelector:

CAUGuiCtrl CAUGuiItem List of all members.

Public Member Functions

 CAUGuiSelector (CAUGuiMan *theChief, eRect *theWhere, UInt32 theRange, UInt32 theOrientation, CAUGuiGraphic *theForeGround, CAUGuiGraphic *theBackground)
 constructor for a CAUGuiSelector control

virtual ~CAUGuiSelector ()
 destructor

virtual void draw (CGContextRef context, UInt32 portHeight)
 receives draws from CAUGuiControlHandler

virtual void mouseDown (Point *P, bool, bool)
 receives Mouse clicks from CAUGuiControlHandler

virtual void mouseTrack (Point *P, bool, bool)
 receives MouseTracking from CAUGuiControlHandler

virtual void mouseUp (Point *P, bool, bool)
 receives Mouse ups from CAUGuiControlHandler

virtual void setUserProcedure (selectorUserProcedure theProc, void *theUserData)
 attach a selectorUserProcedure with userdata to the selector


Detailed Description

a useful helper widget, i.e. to select different layers for a CAUGuiLayeredPane

There's currently no CAAUParameter attached.

It works much like CAUGuiButton in kRadioMode, but with all states combined in a single widget.

Buttons require AU Parameters, while CAUGuiSelector does not.

The states are evenly spaced inside foreBounds along the orientation axis

You typically install a callback that takes action on changes. For changing layers, you'd usually pass a pointer to a CAUGuiLayeredPane as userdata and the callback simply sets the layer to the chosen value.

In future, it might happen that this class will be extended to deal with indexed AU parameters as well.

Definition at line 46 of file CAUGuiSelector.h.


Constructor & Destructor Documentation

CAUGuiSelector::CAUGuiSelector CAUGuiMan theChief,
eRect theWhere,
UInt32  theRange,
UInt32  theOrientation,
CAUGuiGraphic theForeGround,
CAUGuiGraphic theBackground
 

constructor for a CAUGuiSelector control

Parameters:
theChief instance of controlling CAUGuiMan
theWhere Control Bounds in pane-relative coordinates
theRange number of different states
theOrientation 0 = vertical, 1 = horizontal
theForeGround foreground CAUGuiGraphic, usually a multiframe CAUGuiGraphic
theBackground background CAUGuiGraphic (can be NULL)
if the foreground graphics is multiframe, it maps the parameter's values accordingly and shows the correct subframe

Definition at line 14 of file CAUGuiSelector.cpp.

References CAUGuiGraphic::getHeight(), CAUGuiGraphic::getWidth(), eRect::h, kCAUGui_Selector, CAUGuiCtrl::setBounds(), CAUGuiCtrl::setTolerance(), CAUGuiItem::setType(), and eRect::w.

CAUGuiSelector::~CAUGuiSelector  )  [virtual]
 

destructor

Definition at line 60 of file CAUGuiSelector.cpp.


Member Function Documentation

void CAUGuiSelector::draw CGContextRef  context,
UInt32  portHeight
[virtual]
 

receives draws from CAUGuiControlHandler

Reimplemented from CAUGuiCtrl.

Definition at line 69 of file CAUGuiSelector.cpp.

References CAUGuiGraphic::draw(), CAUGuiCtrl::getBounds(), CAUGuiCtrl::getCarbonControl(), CAUGuiCtrl::getForeBounds(), CAUGuiGraphic::getImage(), eRect::to(), and val.

void CAUGuiSelector::mouseDown Point *  P,
bool  with_option,
bool  with_shift
[virtual]
 

receives Mouse clicks from CAUGuiControlHandler

Parameters:
P the point where the mouse is, relative to control bounds
with_option is option key pressed?
with_shift is shift key pressed?
(Currently the status of modifiers is only tested on first click and then maintained over the whole interaction)

Reimplemented from CAUGuiCtrl.

Definition at line 101 of file CAUGuiSelector.cpp.

References CAUGuiCtrl::getBounds(), CAUGuiCtrl::getCarbonControl(), CAUGuiCtrl::getForeBounds(), eRect::h, eRect::set(), val, eRect::w, eRect::x, and eRect::y.

void CAUGuiSelector::mouseTrack Point *  P,
bool  with_option,
bool  with_shift
[virtual]
 

receives MouseTracking from CAUGuiControlHandler

Reimplemented from CAUGuiCtrl.

Definition at line 151 of file CAUGuiSelector.cpp.

void CAUGuiSelector::mouseUp Point *  P,
bool  with_option,
bool  with_shift
[virtual]
 

receives Mouse ups from CAUGuiControlHandler

Reimplemented from CAUGuiCtrl.

Definition at line 157 of file CAUGuiSelector.cpp.

void CAUGuiSelector::setUserProcedure selectorUserProcedure  theProc,
void *  theUserData
[virtual]
 

attach a selectorUserProcedure with userdata to the selector

Definition at line 163 of file CAUGuiSelector.cpp.

References selectorUserProcedure.


The documentation for this class was generated from the following files:
(c) 2002 - 2003 by Urs Heckmann www.u-he.com
Generated on Thu May 6 15:13:15 2004 for CAUGui by doxygen 1.3.6