moved reDraw() to parent

This commit is contained in:
JP
2014-08-04 11:00:08 +10:00
parent 7c3ec25d70
commit 94fc7e6437
3 changed files with 14 additions and 36 deletions

View File

@@ -1396,6 +1396,16 @@ void MicroViewWidget::setValue(int16_t val) {
}
}
/** \brief MicroView Widget reDraw routine.
Redraws the widget.
*/
void MicroViewWidget::reDraw() {
needFirstDraw=true;
this->drawFace();
this->draw();
}
// -------------------------------------------------------------------------------------
// MicroViewWidget Class - end
// -------------------------------------------------------------------------------------
@@ -1417,16 +1427,6 @@ MicroViewSlider::MicroViewSlider(uint8_t newx, uint8_t newy, int16_t min, int16_
draw();
}
/** \brief MicroView Widget reDraw routine.
Redraws the widget.
*/
void MicroViewSlider::reDraw() {
needFirstDraw=true;
drawFace();
draw();
}
/** \brief MicroViewSlider class initialisation with style.
Initialise the MicroViewSlider widget with style WIDGETSTYLE0 or WIDGETSTYLE1 or WIDGETSTYLE2 (like 0, but vertical) or WIDGETSTYLE3 (like 1, but vertical). If this list gets any longer, it might be better as a switch/case statement.
@@ -1545,16 +1545,6 @@ void MicroViewSlider::draw() {
offsetY=getY();
if (needFirstDraw) {
/*
if (style==0 || style==1){ //Horizontal
uView.lineH(offsetX+tickPosition, offsetY, 3, WHITE, XOR);
uView.pixel(offsetX+1+tickPosition, offsetY+1, WHITE, XOR);
}
else { //Vertical
uView.lineV(offsetX+7, offsetY+tickPosition, 3, WHITE, XOR);
uView.pixel(offsetX+6, offsetY+1+tickPosition, WHITE, XOR);
}
*/
tickPosition= (((float)(prevValue-getMinValue())/(float)(getMaxValue()-getMinValue()))*totalTicks);
if (style==0 || style==1){ //Horizontal
uView.lineH(offsetX+tickPosition,offsetY, 3, WHITE, XOR);
@@ -1629,16 +1619,6 @@ MicroViewGauge::MicroViewGauge(uint8_t newx, uint8_t newy, int16_t min, int16_t
draw();
}
/** \brief MicroView Widget reDraw routine.
Redraws the widget.
*/
void MicroViewGauge::reDraw() {
needFirstDraw=true;
drawFace();
draw();
}
/** \brief MicroViewGauge class initialisation with style.
Initialise the MicroViewGauge widget with style WIDGETSTYLE0 or WIDGETSTYLE1.