Return to Index

Valuator

Parent class: Widget

The Valuator class provides a base class for numeric input widgets. It cannot be instantiated on its own, but its direct descendants Scrollbar, Counter, Slider, ValueSlider, ValueInput, and ValueOutput are frequently used widgets.


Object Events:
ChangedAn event generated when the value changes. No information is stored in the event structure, so use the Valuator methods to obtain the value.

Method Summary:
double Valuator::clamp(double value);
double Valuator::round(double value);
double Valuator::getMax();
void Valuator::setMax(double max);
double Valuator::getMin();
void Valuator::setMin(double min);
void Valuator::setPrecision(int ndigits);
void Valuator::setRange(double min, double max);
void Valuator::setStep(double step);
void Valuator::setStep(int n, int d);
double Valuator::getStep();
void Valuator::setValue(double val);
void Valuator::getValue();



double Valuator::clamp
double Valuator::clamp(double value);

Clamps the given value to the range of the slider and returns the clamped value.
Parameters:
double valueThe value to clamp.

double Valuator::round
double Valuator::round(double value);

Rounds the given value to the nearest step increment and returns the rounded value.
Parameters:
double valueThe value to round.

double Valuator::getMax
double Valuator::getMax();

Returns the valuator's maximum value.

void Valuator::setMax
void Valuator::setMax(double max);

Sets the valuator's maximum value.
Parameters:
double maxThe maximum value.

double Valuator::getMin
double Valuator::getMin();

Returns the valuator's minimum value.

void Valuator::setMin
void Valuator::setMin(double min);

Sets the valuator's minimum value.
Parameters:
double minThe minimum value.

void Valuator::setPrecision
void Valuator::setPrecision(int ndigits);

Sets the step value to 1/10^ndigits.
Parameters:
int ndigitsThe precision value.

void Valuator::setRange
void Valuator::setRange(double min, double max);

Sets the minimum and maximum values of the valuator.
Parameters:
double minThe minimum value.
double maxThe maximum value.

void Valuator::setStep
void Valuator::setStep(double step);

Sets the step/increment value.
Parameters:
double stepThe increment value

void Valuator::setStep
void Valuator::setStep(int n, int d);

Sets the step/increment value as a ratio of two integers.
Parameters:
int nThe numerator of the ratio.
int dThe denominator of the ratio.

double Valuator::getStep
double Valuator::getStep();

Returns the step/increment value.

void Valuator::setValue
void Valuator::setValue(double val);

Sets the value of the valuator. This does not clamp or round the value. Call those functions before setting the value.
Parameters:
double valThe new value.

void Valuator::getValue
void Valuator::getValue();

Returns the value of the valuator.


Generated automatically by docgen 0.0.1
© 2003 Aron Dobos