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

CAUGuiDisplay Class Reference

displays and manipulates values, provides PopUpMenue functionality More...

#include <CAUGuiDisplay.h>

Inheritance diagram for CAUGuiDisplay:

CAUGuiCtrl CAUGuiItem List of all members.

Public Member Functions

 CAUGuiDisplay (CAUGuiMan *theChief, CAAUParameter &theAuvp, eRect *theWhere, CAUGuiResolution theRes, CAUGuiGraphic *theForeGround, CAUGuiGraphic *theBackground)
 constructor for graphics driven display

 CAUGuiDisplay (CAUGuiMan *theChief, CAAUParameter &theAuvp, eRect *theWhere, CAUGuiResolution theRes, displayTextProcedure aTexter, void *userDData, CAUGuiGraphic *theBackground)
 constructor for text driven display

virtual ~CAUGuiDisplay ()
 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 (displayUserProcedure theProc, void *theUserData)
 optional displayUserProcedure that gets called on value changes

virtual void mouseRight (Point *P)
 derive this to react on mouse clicks /w CTRL for contextual stuff, but you need to install special event handlers. I never managed to get this working

virtual void generatePopUpMenue ()
 use on indexed parameters only!


Detailed Description

displays and manipulates values, provides PopUpMenue functionality

This is not just for representing values, it also works for manipulating them

on floating point values, it works like a vertical slider. Dragging up/down on the left side adjusts values in integer steps, dragging on the right side adjusts in fine resolution (determined by the attached CAUGuiResolution

on indexed values, it can be used as a PopUpMenue

a special note: If you have an indexed parameter attached and a simple CAUGuiGraphic as foreground, the display will use subsequently added Graphics to display feedback for each integer value.

CAUGuiGraphic* back = new CAUGuiGraphic ( "back.png" );

myCAUGuiMan->addImage( back );

CAUGuiGraphic* fore = new CAUGuiGraphic ( "fore1.png" );

myCAUGuiMan->addImage( fore );

CAUGuiGraphic* anotherfore = new CAUGuiGraphic ( "fore2.png" );

myCAUGuiMan->addImage( anotherfore );

anotherfore = new CAUGuiGraphic ( "fore3.png" );

myCAUGuiMan->addImage( anotherfore );

CAAUParameter myAUVP(mEditAudioUnit, kIndexedParameter3Values, kAudioUnitScope_Global, 0);

eRect* where = new eRect ( 20, 30, 64, 32 );

CAUGuiDisplay* myDisplay = new CAUGuiDisplay( myCAUGuiMan, myAUVP, where, kCAUGui_res_1, fore, back );

myCAUGuiPane->addCtrl( myDisplay );

this will attach the three images to the corresponding three values of myAUVP!

Definition at line 88 of file CAUGuiDisplay.h.


Constructor & Destructor Documentation

CAUGuiDisplay::CAUGuiDisplay CAUGuiMan theChief,
CAAUParameter &  theAuvp,
eRect theWhere,
CAUGuiResolution  theRes,
CAUGuiGraphic theForeGround,
CAUGuiGraphic theBackground
 

constructor for graphics driven display

Parameters:
theChief instance of controlling CAUGuiMan
theAuvp the CAAUParameter to be controlled
theWhere Control Bounds in pane-relative coordinates
theRes CAUGuiResolution
theForeGround foreground 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

if the foreground is a plain CAUGuiGraphic, hence a single image, the display assumes that it represents an indexed parameter and that the graphic is the first in a series of graphics stored in the same linked list (CAUGuiItem). Commonly, there's only one such list for graphics, observed and maintaines by CAUGuiMan

Definition at line 12 of file CAUGuiDisplay.cpp.

References CAUGUI_DEFAULT_FONT_ALIGN, kCAUGui_Display, and CAUGuiItem::setType().

CAUGuiDisplay::CAUGuiDisplay CAUGuiMan theChief,
CAAUParameter &  theAuvp,
eRect theWhere,
CAUGuiResolution  theRes,
displayTextProcedure  aTexter,
void *  userDData,
CAUGuiGraphic theBackground
 

constructor for text driven display

Parameters:
theChief instance of controlling CAUGuiMan
theAuvp the CAAUParameter to be controlled
theWhere Control Bounds in pane-relative coordinates
theRes CAUGuiResolution
aTexter the displayTextProcedure
userDData userdata to be passed to aTexter
theBackground background CAUGuiGraphic (shouldn't be NULL)
if aTexter is NULL, display values will be generated according to the Parameter's metadata, like integer values on indexed parameters, strings if ParameterValueStrings exist, float values with digits according to the attached CAUGuiResolution

Definition at line 42 of file CAUGuiDisplay.cpp.

References CAUGUI_DEFAULT_FONT_ALIGN, displayTextProcedure, generatePopUpMenue(), kCAUGui_Display, and CAUGuiItem::setType().

CAUGuiDisplay::~CAUGuiDisplay  )  [virtual]
 

destructor

Definition at line 95 of file CAUGuiDisplay.cpp.


Member Function Documentation

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

receives draws from CAUGuiControlHandler

Reimplemented from CAUGuiCtrl.

Definition at line 312 of file CAUGuiDisplay.cpp.

References CAUGuiCtrl::getAUVP(), CAUGuiCtrl::getBounds(), CAUGuiCtrl::getCarbonControl(), CAUGuiCtrl::getForeBounds(), CAUGuiGraphic::getImage(), CAUGuiItem::getNext(), and eRect::to().

void CAUGuiDisplay::generatePopUpMenue  )  [virtual]
 

use on indexed parameters only!

if AUTO_POP_UP_MENUES in CAUGuiConfig is set to zero, you can use this function to individually set up a PopUpMenue for this display. Otherwise it will be automatically established if applicable (indexed parameter, less than 100 or so values)

Definition at line 109 of file CAUGuiDisplay.cpp.

Referenced by CAUGuiDisplay().

void CAUGuiDisplay::mouseDown Point *  P,
bool  ,
bool 
[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 162 of file CAUGuiDisplay.cpp.

References CAUGuiCtrl::getCarbonControl(), last_X, last_Y, and val.

void CAUGuiDisplay::mouseRight Point *  P  )  [virtual]
 

derive this to react on mouse clicks /w CTRL for contextual stuff, but you need to install special event handlers. I never managed to get this working

Reimplemented from CAUGuiCtrl.

Definition at line 277 of file CAUGuiDisplay.cpp.

References CAUGuiCtrl::getCarbonControl().

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

receives MouseTracking from CAUGuiControlHandler

Reimplemented from CAUGuiCtrl.

Definition at line 198 of file CAUGuiDisplay.cpp.

References CAUGuiCtrl::getBounds(), CAUGuiCtrl::getCarbonControl(), CAUGuiCtrl::getResolution(), kCAUGui_res_1, last_X, val, and eRect::w.

void CAUGuiDisplay::mouseUp Point *  P,
bool  ,
bool 
[virtual]
 

receives Mouse ups from CAUGuiControlHandler

Reimplemented from CAUGuiCtrl.

Definition at line 270 of file CAUGuiDisplay.cpp.

void CAUGuiDisplay::setUserProcedure displayUserProcedure  theProc,
void *  theUserData
[virtual]
 

optional displayUserProcedure that gets called on value changes

Definition at line 431 of file CAUGuiDisplay.cpp.

References displayUserProcedure.


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:14 2004 for CAUGui by doxygen 1.3.6