VWLib REFERENCE MANUAL


NAME
vwValueFrame - A frame that displays a value.

INHERITS FROM
vwFrame, vwObserver

HEADER FILE
#include <vwValueFrame.h>

PUBLIC METHOD SUMMARY
vwValueFrame::vwValueFrame ( vwMediator * concreteMediator, pfSCS * scs, pfFont * font);
virtual vwValueFrame::~vwValueFrame ( void);
void vwValueFrame::initValue ( float value, int numDecimals);
void vwValueFrame::initValue ( float value, float *rgbaColor, int numDecimals);
void vwValueFrame::initValue ( int value);
void vwValueFrame::initValue ( int value, float * rgbaColor);
inline float vwValueFrame::getValue ( void);
void vwValueFrame::setValue ( float newValue);
inline void vwValueFrame::setLabelSize ( float labelSize=1.0);
inline void vwValueFrame::setLabelHeight ( float labelHeight=0.0);
void vwValueFrame::update ( vwSubject * callingSubject, void * data);

INHERITED PUBLIC METHODS

   Inherited from vwFrame
inline int vwFrame::isGeneric ( void);

   Inherited from vwObserver
vitrual void vwObserver::update ( vwSubject * callingSubject, void * data) = 0;

   Inherited from vwWidget
virtual void vwWidget::setActive ( int activeState=True);
virtual void vwWidget::setOver ( int overState=True);
virtual void vwWidget::setVisible ( int visibiltyState=True);
inline int vwWidget::getActive ( void);
inline int vwWidget::getOver ( void);

inline int vwWidget::getPressed (

void);
inline int vwWidget::getVisible ( void);
inline int vwWidget::getDragged ( void);
inline int vwWidget::getIdent ( void);
inline int vwWidget::getInterface ( void);
void vwWidget::getColor ( wColor colorIndex, float rgba[]);
inline void vwWidget::setColor ( wColor colorIndex=ACTIVE);
void vwWidget::registerColor ( wColor colorIndex, float *rgba);
inline int vwWidget::isOfType ( wType wdg_type);
inline pfSCS * vwWidget::getSCS ( void);
inline pfDCS * vwWidget::getDCS ( void);
inline void vwWidget::getParentMtx ( pfMatrix * m);

   Inherited from vwSubject
virtual void vwSubject::attach ( vwObserver *concreteObserver);
virtual void vwSubject::detach ( vwObserver *concreteObserver);
inline void vwSubject::setSubectData ( void * data);
inline void * vwSubject::getSubjectData ( void);
inline unsigned long vwSubject::getID ( void);

INHERITED PROTECTED METHODS

   Inherited from vwWidget
virtual void vwWidget::doSetColor ( wColor colorIndex);
virtual void vwWidget::setWType ( wType widgetType);

   Inherited from vwSubject
void vwSubject::notify ( void);

CLASS DESCRIPTION
vwValueFrame is a frame that is meant to act primarily as an observer, displaying another widget's value (e.g., it can display the value of a slider). The first call to a vwValueFrame should be to initValue() (initValue() is overloaded). vwValueFrame overrides vwObserver::update() with a method that takes an incoming value and displays it as text on the frame. By default its Active State is set to False. It does call notify() from its update() method, and therefore can be used to propagate events. This class will eventually be rewritten to include vwLabel as a protected parent class. The public interface will remain the same.

METHOD DESCRIPTIONS

   vwValueFrame()
vwValueFrame ( vwMediator *concreteMediator, pfSCS *scs, pfFont *font);

Construct a valueFrame.

*concreteMediator specifies a pointer to the concrete mediator of the interface being created.

*scs specifies a pointer to a Performer pfSCS containing the valueFrame geometry.

*font specifies a pointer to the Performer pfFont used by the interface.

   ~vwValueFrame()
virtual ~vwValueFrame ( void);

Destruct an instance. Deletes pfText and pfString objects if they exists.

   initValue()
void initValue ( float value, int numDecimals);

Initialize a valueFrame to display floating point values in the color defined by the interface.

value specifies the initial value of the valueFrame.

numDecimals specifies the number of significant figures to display.

   initValue()
void initValue ( float value, float *rgbaColor, int numDecimals);

Initialize a valueFrame to display floating point values.

value specifies the initial value of the valueFrame.

*rgbaColor specifies a pointer to a 4-component floating point color value that will be used in the label.

numDecimals specifies the number of significant figures to display.

   initValue()
void initValue ( int value);

Initialize a valueFrame to display integer values in the color defined by the interface.

value specifies the initial value of the valueFrame.

   initValue()
void initValue ( int value, float *rgbaColor);

Initialize a valueFrame to display integer values.

value specifies the initial value of the valueFrame

*rgbaColor specifies a pointer to a 4-component floating point color value that will be used in the label.

   getValue()
inline float getValue ( void);

Get the current value of the valueFrame.

   setValue()
void setValue ( float newValue);

Explicitly set the value of the valueFrame. Normally only called internally by update(). This method must not be called before the call to initValue() has been made. If the valueFrame has been initialized as an integer, newValue will be truncated. setValue() does not call notify().

newValue specifies the new value to apply to the valueFrame.

   setLabelHeight()
inline void setLabelHeight ( float labelHeight);

Vertical translation factor for text in the frame.

labelHeight specifies the translation value in Y (Performer Z) local coordinates. Default value is 0.0.

   setLabelSize()
inline void setLabelSize ( float labelSize);

Sets the scalefactor for the text in the frame.

labelSize specifies the text scalefactor. Default value is 1.0.

   update()
void update ( vwSubject * callingSubject, void * data);

Override pure virtual vwObserver::update(). update() gets called whenever a notify event is generated by a widget to which the vwValueFrame is attached. The value of the subject, or the void data pointer is used to update the value displayed in the text. After the textFrame updates itself, it calls notify(). If any observers are attached to this valueFrame, they will receive an update with the data value pointing being that of the vwValueFrame's integer value if it is an integer value frame, or float value if it is a floating point value frame.

*callingSubject specifies a pointer to the subject that generated the notify() event.

*data specifies a pointer to the calling subject's data.

SEE ALSO
vwFrame, vwObserver, vwSubject

vrmedlab.jpg (7272 bytes)