Public Member Functions | Protected Member Functions

glv::Widget Class Reference

Base class for views having a regular grid of elements. More...

#include <glv_widget.h>

Inheritance diagram for glv::Widget:
glv::View glv::DataModel glv::Notifier glv::SmartObject< View > glv::Buttons glv::Label glv::NumberDialer glv::Sliders glv::SliderVector< Dim > glv::TextView glv::SliderVector< 2 > glv::Button glv::SliderGrid< Dim > glv::Slider2D glv::SliderRange

List of all members.

Public Member Functions

 Widget (const Rect &r, space_t pad=3, bool momentary=false, bool mutExc=false, bool drawGrid=true)
template<class T >
getValue () const
 Get selected element value type-casted to template parameter.
template<class T >
getValue (int i) const
 Get element value at 1D index type-casted to template parameter.
template<class T >
getValue (int i1, int i2) const
 Get element value at 2D index type-casted to template parameter.
bool isSelected (int x, int y) const
 Returns whether this element coordinate is selected.
const double & max () const
 Get maximum of value interval.
const double & min () const
 Get minimum of value interval.
double mid () const
 Get middle point of value interval.
space_t padding () const
 Get element padding amount.
int selected () const
 Get selected element index.
int selectedX () const
 Get selected element x coordinate.
int selectedY () const
 Get selected element y coordinate.
int size () const
 Get total number of elements.
int sizeX () const
 Get number of elements along x.
int sizeY () const
 Get number of elements along y.
template<class V >
void attachVariable (V &val, int i=0)
 Attach a single variable at a specified index.
Widgetinterval (const double &max, const double &min=0)
 Set interval for numerical values.
Widgetpadding (space_t v)
 Set element padding amount.
Widgetselect (int i)
 Select element at 1D index.
Widgetselect (int ix, int iy)
 Select element at 2D index.
template<class T >
WidgetsetValue (const T &v, int i)
 Set value at specified 1D index.
template<class T >
WidgetsetValue (const T &v, int ix, int iy)
 Set value at specified 2D index.
WidgetsetValueMax ()
 Set all values to maximum.
WidgetsetValueMid ()
 Set all values to middle value.
virtual void onDataModelSync ()
 Update internal values if different from attached model variables.
virtual const char * className () const
 Get class name.

Protected Member Functions

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.

Detailed Description

Base class for views having a regular grid of elements.


Constructor & Destructor Documentation

glv::Widget::Widget ( const Rect r,
space_t  pad = 3,
bool  momentary = false,
bool  mutExc = false,
bool  drawGrid = true 
)
Parameters:
[in] r geometry
[in] pad padding from border
[in] toggles whether the value elements toggle
[in] mutExc whether value elements operate mutually exclusively
[in] drawGrid whether to draw grid separater for multiple elements

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