#include <glv_textview.h>
Public Member Functions | |
NumberDialer (const Rect &r, int numInt, int numFrac) | |
NumberDialer (const Rect &r, int numInt, int numFrac, double max, double min) | |
double | value () const |
Get value. | |
NumberDialer & | padding (space_t v) |
Set padding amount from top and bottom. | |
NumberDialer & | interval (double max, double min=0) |
Set max and min output range. Values larger than displayable range will be clipped. | |
NumberDialer & | resize (int numInt, int numFrac) |
Set number of digits in integer and fraction parts. | |
NumberDialer & | showSign (bool v) |
Set whether to show sign. | |
NumberDialer & | value (double v) |
Set value. | |
virtual void | onDraw () |
Main drawing callback. | |
virtual bool | onEvent (Event::t e, GLV &g) |
Main event callback to be called after those in callback list. | |
Protected Member Functions | |
int | size () const |
Get total number of elements. |
Each digit acts like a slider that can be scrolled up or down to increase or decrease the value of the number. The keyboard can also be used to edit the currently focused digit. The sign on the left side can be toggled by clicking it. The digits are scaled according to the dimensions of the view. The padding amount determines the spacing around the digits. For best looking characters use a Rect dimension ns x s where 'n' is the number of digits and 's' is the character size plus padding amount.
glv::NumberDialer::NumberDialer | ( | const Rect & | r, | |
int | numInt, | |||
int | numFrac | |||
) |
[in] | r | Geometry |
[in] | numInt | Number of places in integer part |
[in] | numFrac | Number of places in fraction part |
glv::NumberDialer::NumberDialer | ( | const Rect & | r, | |
int | numInt, | |||
int | numFrac, | |||
double | max, | |||
double | min | |||
) |
[in] | r | Geometry |
[in] | numInt | Number of places in integer part |
[in] | numFrac | Number of places in fraction part |
[in] | max | Maximum value |
[in] | min | Minimum value |