24 #ifndef __valuator_hpp__ 56 double const i_minimum,
57 double const i_maximum);
66 int const i_precision);
70 double const i_value);
79 unsigned int const i_size);
87 double const i_value)
const;
91 double const i_value)
const;
95 double const i_value)
const;
100 int const i_amount)
const;
104 bool const i_debounce);
123 double const i_value);
141 signal_value_t i_signal)
179 double const i_minimum,
180 double const i_maximum)
199 int const i_precision)
215 bool const i_debounce)
220 #define __valuator_hpp__ void handle_release(widget *const io_widget)
emit a signal if the previous value is not equal to the current value
Definition: valuator.cpp:254
virtual double get_value() const
gets the current value
Definition: valuator.hpp:150
void set_signal_value(signal_value_t i_signal)
set callback
Definition: valuator.hpp:140
double m_previous_value
Definition: valuator.hpp:110
double increment(double const i_value, int const i_amount) const
increment the value
Definition: valuator.cpp:188
double m_step
Definition: valuator.hpp:113
void set_step(double const i_step)
set the amount that the value is incremented or decremented in response to mouse or keyboard movement...
Definition: valuator.hpp:189
double clamp(double const i_value) const
checks the bounds of i_value
Definition: valuator.cpp:120
void set_debounce(bool const i_debounce)
turns drawing of the widget on or off
Definition: valuator.hpp:214
double round(double const i_value) const
rounds the value to the nearest step increment
Definition: valuator.cpp:99
void(* signal_value_t)(widget const *i_widget, void *io_user_data)
function prototype to recieve signal
Definition: valuator.hpp:33
double m_value
Definition: valuator.hpp:109
double get_minimum() const
gets the minimum value
Definition: valuator.hpp:156
void handle_push()
sets previous value to current value
Definition: valuator.hpp:207
double get_maximum() const
gets the maximum value
Definition: valuator.hpp:162
virtual int format(char *o_buffer, unsigned int const i_size)
format a value into string
Definition: valuator.cpp:268
signal_value_t m_signal_value
Definition: valuator.hpp:115
double get_step() const
the amount that the value is incremented or decremented in response to mouse or keyboard movement ...
Definition: valuator.hpp:168
void handle_drag(widget *const io_widget, double const i_value)
sets the value and if changed redraws the widget
Definition: valuator.cpp:236
double m_minimum
Definition: valuator.hpp:111
virtual ~valuator()
destructor
Definition: valuator.cpp:55
void set_range(double const i_minimum, double const i_maximum)
sets the minimum and maximum bounds the value can have
Definition: valuator.hpp:178
interface to control a floating point value
Definition: valuator.hpp:28
bool m_debounce
Definition: valuator.hpp:108
double clamp_soft(double const i_value) const
checks the bounds of i_value
Definition: valuator.cpp:148
valuator()
constructor
Definition: valuator.cpp:42
virtual bool set_value(double const i_value)
sets the value
Definition: valuator.cpp:219
void set_precision(int const i_digits)
sets the precision
Definition: valuator.cpp:61
double m_precision
Definition: valuator.hpp:114
double m_maximum
Definition: valuator.hpp:112