MicroView Arduino Library - MicroViewWidget Class Reference


Inheritance diagram for MicroViewWidget:
MicroViewGauge MicroViewSlider

Public Member Functions

 MicroViewWidget (uint8_t newx, uint8_t newy, int16_t min, int16_t max)
 MicroView widget parent class. More...
 
uint8_t getX ()
 Get widget x position.
 
uint8_t getY ()
 Get widget y position.
 
void setX (uint8_t newx)
 Set widget x position.
 
void setY (uint8_t newy)
 Set widget y position.
 
int16_t getMinValue ()
 Get minimum value. More...
 
int16_t getMaxValue ()
 Get maximum value. More...
 
int16_t getValue ()
 Get current value. More...
 
void setMinValue (int16_t min)
 Set minimum value. More...
 
void setMaxValue (int16_t max)
 Set maximum value. More...
 
void setValue (int16_t val)
 Set current value and update widget. More...
 
void setValue (int16_t val, boolean doDraw)
 Set current value with optional update. More...
 
uint8_t getValLen ()
 Get the print length of the value. More...
 
uint8_t getMaxValLen ()
 Get the maximum possible print length of the value. More...
 
virtual void draw ()
 Draw widget value overridden by child class.
 
virtual void drawFace ()
 Draw widget face overridden by child class.
 
void reDraw ()
 MicroView Widget reDraw routine. More...
 
void drawNumValue (int16_t value)
 Draw a signed decimal numeric value at the current cursor location. More...
 

Protected Attributes

uint8_t posX
 
uint8_t posY
 
int16_t minValue
 
int16_t maxValue
 
int16_t value
 
uint8_t valLen
 
uint8_t maxValLen
 

Constructor & Destructor Documentation

MicroViewWidget::MicroViewWidget ( uint8_t  newx,
uint8_t  newy,
int16_t  min,
int16_t  max 
)

MicroView widget parent class.

The MicroViewWidget class is the parent class for child widget like MicroViewSlider and MicroViewGauge.

Member Function Documentation

void MicroViewWidget::drawNumValue ( int16_t  value)

Draw a signed decimal numeric value at the current cursor location.

The value is right justified with leading spaces, within a field the length of the maximum posible for the widget's value range.

uint8_t MicroViewWidget::getMaxValLen ( )

Get the maximum possible print length of the value.

Return the maximum number of characters that would be printed using uView.print(value) for the current value range.

int16_t MicroViewWidget::getMaxValue ( )

Get maximum value.

Return the maximum value of the widget.

int16_t MicroViewWidget::getMinValue ( )

Get minimum value.

Return the minimum value of the widget.

uint8_t MicroViewWidget::getValLen ( )

Get the print length of the value.

Return the number of characters that would be printed using uView.print(value) for the current value.

int16_t MicroViewWidget::getValue ( )

Get current value.

Return the current value of the widget.

void MicroViewWidget::reDraw ( )

MicroView Widget reDraw routine.

Redraws the widget.

void MicroViewWidget::setMaxValue ( int16_t  max)

Set maximum value.

The maximum value of the widget is set to the variable passed in.

void MicroViewWidget::setMinValue ( int16_t  min)

Set minimum value.

The minimum value of the widget is set to the variable passed in.

void MicroViewWidget::setValue ( int16_t  val)

Set current value and update widget.

The current value of the widget is set to the variable passed in and the widget is drawn with the new value.

void MicroViewWidget::setValue ( int16_t  val,
boolean  doDraw 
)

Set current value with optional update.

The current value of the widget is set to the variable passed in. The widget is drawn with the new value if the doDraw argument is true.