gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
Scales Class Reference

#include <Scales.H>

Inheritance diagram for Scales:
[legend]
Collaboration diagram for Scales:
[legend]

Public Member Functions

virtual ~Scales (void)
 destructor More...
 
double getVal (void)
 
double getStep (void)
 
void setStep (double step)
 
void setLower (double lower)
 
void setUpper (double upper)
 
double getLower (void)
 
double getUpper (void)
 
Scalesoperator= (double pos)
 
Scalesoperator= (int pos)
 
ScalesdrawValue ()
 
Scalesoperator<< (HScaleFuncData sf)
 
Scalesoperator<< (VScaleFuncData sf)
 
int findIndex (GtkWidget *widget)
 
void signalConnectAfter (ScaleFuncData sfd)
 connect a callback to execute after the currently connected callbacks More...
 
void signalRemove (ScaleFuncData sfd)
 disconnect the callback More...
 
void quantise (bool isQuantised)
 
void invert (bool isInverted)
 

Static Public Member Functions

static double getVal (GtkRange *wid)
 

Private Member Functions

void setDigits (double step)
 

Static Private Member Functions

static void quantiseVal (void *wid, void *data)
 

Additional Inherited Members

Detailed Description

Base class for the HScale and VScale classes.

This class operates by using the "<<" operator to load in the VScaleFuncData and HScaleFuncData classes, like so :

Scales scales;
scales<<HScaleFuncData(0.,100.,1.,scaleTouch,NULL)<<VScaleFuncData(0.,100.,1.,scaleTouch,NULL);

The scales can be set by locating the desired scale widget to set and then using the "=" operator :

scales.grab(1);
scales=50.9;
scales.grab(2);
scales=50.9;
ScaleTest.png
Examples:
ScaleTest.C.

Definition at line 159 of file Scales.H.

Constructor & Destructor Documentation

◆ ~Scales()

virtual Scales::~Scales ( void  )
inlinevirtual

destructor

Definition at line 191 of file Scales.H.

Member Function Documentation

◆ drawValue()

Scales& Scales::drawValue ( )
inline

Draw the value above the scale widget.

Returns
A reference to this scale class.

Definition at line 321 of file Scales.H.

◆ findIndex()

int Scales::findIndex ( GtkWidget *  widget)
inline

Find the GTK widget index (from 1) in the list of scales

Parameters
widgetThe widget to look for
Returns
0 if it isn't on the list, the index (from 1) otherwise

Definition at line 356 of file Scales.H.

◆ getLower()

double Scales::getLower ( void  )
inline

Get the lower range value.

Returns
The current lower value.

Definition at line 275 of file Scales.H.

◆ getStep()

double Scales::getStep ( void  )
inline

Get the stepping value of the scale widget.

Returns
the stepping value of the scale. If there are no scales, then return NaN

Definition at line 214 of file Scales.H.

◆ getUpper()

double Scales::getUpper ( void  )
inline

Set the upper range value.

Returns
The current upper value.

Definition at line 289 of file Scales.H.

◆ getVal() [1/2]

static double Scales::getVal ( GtkRange *  wid)
inlinestatic

Get the current value of the provided scale widget.

Parameters
widThe widget to get the position from
Returns
the value the scale is set to.
Examples:
ScaleTest.C.

Definition at line 198 of file Scales.H.

Here is the caller graph for this function:

◆ getVal() [2/2]

double Scales::getVal ( void  )
inline

Get the current value of the scale widget.

Returns
the value the scale is set to. If there are no scales, then return NaN

Definition at line 205 of file Scales.H.

◆ invert()

void Scales::invert ( bool  isInverted)
inline

Turn the scale upside down (Vertical scales) or flip left/right (Horizontal scales)

Parameters
isInvertedTrue to invert, False to return to normal transposition

Definition at line 405 of file Scales.H.

◆ operator<<() [1/2]

Scales& Scales::operator<< ( HScaleFuncData  sf)
inline

Create a horizontal scale widget

Parameters
sfThe HScaleFuncData which defines the horizontal scale
Returns
A reference to this scale class.

Definition at line 330 of file Scales.H.

Here is the call graph for this function:

◆ operator<<() [2/2]

Scales& Scales::operator<< ( VScaleFuncData  sf)
inline

Create a vertical scale widget

Parameters
sfThe VScaleFuncData which defines the vertical scale
Returns
A reference to this scale class.

Definition at line 343 of file Scales.H.

Here is the call graph for this function:

◆ operator=() [1/2]

Scales& Scales::operator= ( double  pos)
inline

Set the scale to a particular value.

Parameters
posThe value to set the scale to.
Returns
A reference to this scale class.

Definition at line 304 of file Scales.H.

◆ operator=() [2/2]

Scales& Scales::operator= ( int  pos)
inline

Set the scale to a particular value.

Parameters
posThe value to set the scale to.
Returns
A reference to this scale class.

Definition at line 314 of file Scales.H.

◆ quantise()

void Scales::quantise ( bool  isQuantised)
inline

Quantise the scale to the step size. If the user slides it, then it is quantised to the closest step size increment.

Definition at line 394 of file Scales.H.

◆ quantiseVal()

static void Scales::quantiseVal ( void *  wid,
void *  data 
)
inlinestaticprivate

Perform the quantisation of the widget

Parameters
widThe widget which caused this callback.
dataThe user data associated with that button press.

Definition at line 178 of file Scales.H.

Here is the call graph for this function:

◆ setDigits()

void Scales::setDigits ( double  step)
inlineprivate

Auto-set the number of decimal points to display in the slider

Parameters
stepThe slider stepping factor between movements.

Definition at line 164 of file Scales.H.

◆ setLower()

void Scales::setLower ( double  lower)
inline

Set the lower range value.

Parameters
lowerThe new lower value.

Definition at line 244 of file Scales.H.

◆ setStep()

void Scales::setStep ( double  step)
inline

Set the stepping value of the scale widget.

Parameters
stepthe stepping value of the scale.

Definition at line 229 of file Scales.H.

◆ setUpper()

void Scales::setUpper ( double  upper)
inline

Set the upper range value.

Parameters
upperThe new upper value.

Definition at line 260 of file Scales.H.

◆ signalConnectAfter()

void Scales::signalConnectAfter ( ScaleFuncData  sfd)
inline

connect a callback to execute after the currently connected callbacks

Parameters
sfdScaleFuncData matching the callback to connect - NOTE: only the ScaleFuncData::func and ScaleFuncData::data fields are used

Definition at line 376 of file Scales.H.

◆ signalRemove()

void Scales::signalRemove ( ScaleFuncData  sfd)
inline

disconnect the callback

Parameters
sfdScaleFuncData matching the callback to disconnect - NOTE: only the ScaleFuncData::func and ScaleFuncData::data fields are used

Definition at line 384 of file Scales.H.


The documentation for this class was generated from the following file:
gtkIOStream: Scales Class Reference
GTK+ IOStream  Beta