Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::SliderControl Class Reference

The SliderControl, sometimes referred to as a "trackbar" provides a UI that consists of a thumb button that slides, vertically or horizontally, along a "track". More...

#include <vcf/ApplicationKit/SliderControl.h>

Inheritance diagram for VCF::SliderControl:

VCF::CustomControl VCF::Control VCF::Component VCF::AbstractView VCF::ObjectWithEvents VCF::View VCF::Object List of all members.

Public Types

enum  DisplayOrientation { doHorizontal = 0, doVertical }
enum  TickMarkStyle { tmsNone = 0, tmsTopLeft = 0x01, tmsBottomRight = 0x02 }
enum  { PositionChangedEvent = 546600 }

Public Member Functions

 SliderControl ()
virtual double getPreferredWidth ()
 returns the preferred width for this control.
virtual double getPreferredHeight ()
 returns the preferred height for this control.
virtual void paint (GraphicsContext *ctx)
 Paints the control.
virtual void mouseDown (MouseEvent *e)
 Called when one (or more) of the mouse buttons are held down.
virtual void mouseMove (MouseEvent *e)
 Called when the mouse moves over the control.
virtual void mouseUp (MouseEvent *e)
 Called when one (or more) of the mouse buttons are released.
virtual void keyDown (KeyboardEvent *e)
 called when the user presses the key down
virtual void keyUp (KeyboardEvent *e)
 called when the user releases the key
DisplayOrientation getDisplayOrientation ()
void setDisplayOrientation (const DisplayOrientation &val)
double getMinValue ()
void setMinValue (const double &val)
double getMaxValue ()
void setMaxValue (const double &val)
double getPosition ()
void setPosition (const double &val)
bool hasTickMarks ()
void setHasTickMarks (const bool &val)
int32 getTickMarkStyle ()
bool hasNoTickMarks ()
bool hasTickMarksOnTopLeft ()
bool hasTickMarksOnBottomRight ()
void setTickMarkStyle (const int32 &val)
int32 getTickFrequency ()
void setTickFrequency (const int32 &val)
double getStepIncrement ()
void setStepIncrement (const double &val)
double getPageIncrement ()
void setPageIncrement (const double &val)

Public Attributes

VCF::Delegate PositionChanged

Protected Member Functions

void movePosition (MouseEvent *e)

Protected Attributes

DisplayOrientation orientation_
double minVal_
double maxVal_
double position_
bool hasTickMarks_
int32 tickMarkStyle_
int32 tickFrequency_
Point dragPosStart_
bool pressed_
double stepIncrement_
double pageIncrement_

Detailed Description

The SliderControl, sometimes referred to as a "trackbar" provides a UI that consists of a thumb button that slides, vertically or horizontally, along a "track".

Sliding this causes the position value to change. The position is bounded by a minimum and maximum value.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
PositionChangedEvent 

Reimplemented from VCF::Control.

enum VCF::SliderControl::DisplayOrientation
 

Enumerator:
doHorizontal 
doVertical 

enum VCF::SliderControl::TickMarkStyle
 

Enumerator:
tmsNone 
tmsTopLeft 
tmsBottomRight 


Constructor & Destructor Documentation

VCF::SliderControl::SliderControl  ) 
 


Member Function Documentation

DisplayOrientation VCF::SliderControl::getDisplayOrientation  )  [inline]
 

double VCF::SliderControl::getMaxValue  )  [inline]
 

double VCF::SliderControl::getMinValue  )  [inline]
 

double VCF::SliderControl::getPageIncrement  )  [inline]
 

double VCF::SliderControl::getPosition  )  [inline]
 

virtual double VCF::SliderControl::getPreferredHeight  )  [virtual]
 

returns the preferred height for this control.

This is used when determing the height of the control when it is first created. Override it to provide a different value that is more acceptable for your control's initial display size.

Reimplemented from VCF::Control.

virtual double VCF::SliderControl::getPreferredWidth  )  [virtual]
 

returns the preferred width for this control.

This is used when determing the width of the control when it is first created. Override it to provide a different value that is more acceptable for your control's initial display size.

Reimplemented from VCF::Control.

double VCF::SliderControl::getStepIncrement  )  [inline]
 

int32 VCF::SliderControl::getTickFrequency  )  [inline]
 

int32 VCF::SliderControl::getTickMarkStyle  )  [inline]
 

bool VCF::SliderControl::hasNoTickMarks  ) 
 

bool VCF::SliderControl::hasTickMarks  )  [inline]
 

bool VCF::SliderControl::hasTickMarksOnBottomRight  ) 
 

bool VCF::SliderControl::hasTickMarksOnTopLeft  ) 
 

virtual void VCF::SliderControl::keyDown KeyboardEvent e  )  [virtual]
 

called when the user presses the key down

Reimplemented from VCF::Control.

virtual void VCF::SliderControl::keyUp KeyboardEvent e  )  [virtual]
 

called when the user releases the key

Reimplemented from VCF::Control.

virtual void VCF::SliderControl::mouseDown MouseEvent e  )  [virtual]
 

Called when one (or more) of the mouse buttons are held down.

override this to provide specific behaviours when the mouse buttons are held down

Reimplemented from VCF::Control.

virtual void VCF::SliderControl::mouseMove MouseEvent e  )  [virtual]
 

Called when the mouse moves over the control.

override this to provide specific behaviours when the mouse moves over the control.

Reimplemented from VCF::Control.

virtual void VCF::SliderControl::mouseUp MouseEvent e  )  [virtual]
 

Called when one (or more) of the mouse buttons are released.

override this to provide specific behaviours when the mouse buttons are released.

Reimplemented from VCF::Control.

void VCF::SliderControl::movePosition MouseEvent e  )  [protected]
 

virtual void VCF::SliderControl::paint GraphicsContext ctx  )  [virtual]
 

Paints the control.

Called by the underlying windowing system whenever the control needs to be painted. Note that in some cases the GraphicsContext passed in to this method may not be the same pointer as the GraphicsContext that the control holds itself. During the paint() method you should only use the context value for all your drawing and not the one returned in getContext(). The value returned by getContext() should be used for drawing that takes place outside of the paint() method.

If the control allows paint notification, then the framework will fire an event to the BeforeControlPainted delegate prior to calling the control's paint() method. After the paint() method has returned, if the control allows paint notification, the framework will fire an event to the AfterControlPainted delegate. This allows outside observers to take part in the paint cycle, but beware that this does come at a bit of a cost, so use this feature sparingly.

Note: This should NEVER be called by programmers using the VCF, it will be called for you during the course of your applications native event loop, and is only here for providing custom drawing routines for controls. In other words: you implement it, you never call it yourself.

See also:
getAllowPaintNotification

Reimplemented from VCF::CustomControl.

void VCF::SliderControl::setDisplayOrientation const DisplayOrientation val  ) 
 

void VCF::SliderControl::setHasTickMarks const bool &  val  ) 
 

void VCF::SliderControl::setMaxValue const double &  val  ) 
 

void VCF::SliderControl::setMinValue const double &  val  ) 
 

void VCF::SliderControl::setPageIncrement const double &  val  ) 
 

void VCF::SliderControl::setPosition const double &  val  ) 
 

void VCF::SliderControl::setStepIncrement const double &  val  ) 
 

void VCF::SliderControl::setTickFrequency const int32 val  ) 
 

void VCF::SliderControl::setTickMarkStyle const int32 val  ) 
 


Member Data Documentation

Point VCF::SliderControl::dragPosStart_ [protected]
 

bool VCF::SliderControl::hasTickMarks_ [protected]
 

double VCF::SliderControl::maxVal_ [protected]
 

double VCF::SliderControl::minVal_ [protected]
 

DisplayOrientation VCF::SliderControl::orientation_ [protected]
 

double VCF::SliderControl::pageIncrement_ [protected]
 

double VCF::SliderControl::position_ [protected]
 

VCF::Delegate VCF::SliderControl::PositionChanged
 

bool VCF::SliderControl::pressed_ [protected]
 

double VCF::SliderControl::stepIncrement_ [protected]
 

int32 VCF::SliderControl::tickFrequency_ [protected]
 

int32 VCF::SliderControl::tickMarkStyle_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information