Public Member Functions | Protected Member Functions

glv::NumberDialer Class Reference

Number editor with individually controllable digits. More...

#include <glv_textview.h>

Inheritance diagram for glv::NumberDialer:
glv::Widget glv::View glv::DataModel glv::Notifier glv::SmartObject< View >

List of all members.

Public Member Functions

 NumberDialer (const Rect &r, int numInt, int numFrac)
 NumberDialer (const Rect &r, int numInt, int numFrac, double max, double min)
double getValue () const
 Get value.
NumberDialerpadding (space_t v)
 Set padding amount from top and bottom.
NumberDialerinterval (double max, double min=0)
 Set max and min output range. Values larger than displayable range will be clipped.
NumberDialerresize (int numInt, int numFrac)
 Set number of digits in integer and fraction parts.
NumberDialershowSign (bool v)
 Set whether to show sign.
NumberDialersetValue (double v)
 Set value.
virtual const char * className () const
 Get class name.
virtual void onDraw (GLV &g)
 Drawing callback.
virtual bool onEvent (Event::t e, GLV &g)
 Event callback to be called after those in callback list.

Protected Member Functions

int size () const
 Get total number of elements.

Detailed Description

Number editor with individually controllable digits.

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.


Constructor & Destructor Documentation

glv::NumberDialer::NumberDialer ( const Rect r,
int  numInt,
int  numFrac 
)
Parameters:
[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 
)
Parameters:
[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

The documentation for this class was generated from the following files: