[Horus] Cosmetics

This commit is contained in:
Bertrand Songis
2016-02-17 20:31:42 +01:00
parent 3e0a314307
commit 01ef176173
8 changed files with 28 additions and 49 deletions
+3 -3
View File
@@ -28,7 +28,7 @@ class GaugeWidget: public Widget
{
}
virtual void create()
virtual void init()
{
persistentData->options[0].unsignedValue = 1;
persistentData->options[1].signedValue = -RESX;
@@ -36,7 +36,7 @@ class GaugeWidget: public Widget
persistentData->options[3].unsignedValue = RED;
}
void refresh();
virtual void refresh();
static const ZoneOption options[];
};
@@ -76,4 +76,4 @@ void GaugeWidget::refresh()
lcdInvertRect(zone.x + w, zone.y + 15, zone.w - w, 16, CUSTOM_COLOR);
}
BaseWidgetFactory<GaugeWidget> gaugeWidget("Gauge", "", GaugeWidget::options);
BaseWidgetFactory<GaugeWidget> gaugeWidget("Gauge", GaugeWidget::options);
+2 -2
View File
@@ -28,7 +28,7 @@ class ModelPanelWidget: public Widget
{
}
void refresh();
virtual void refresh();
};
void ModelPanelWidget::refresh()
@@ -53,4 +53,4 @@ void ModelPanelWidget::refresh()
}
}
BaseWidgetFactory<ModelPanelWidget> modelPanelWidget("ModelPanel", "", NULL);
BaseWidgetFactory<ModelPanelWidget> modelPanelWidget("ModelPanel", NULL);
+3 -3
View File
@@ -28,14 +28,14 @@ class TextWidget: public Widget
{
}
void create()
virtual void init()
{
str2zchar(persistentData->options[0].stringValue, "Label", sizeof(persistentData->options[0].stringValue));
persistentData->options[1].unsignedValue = RED;
persistentData->options[2].unsignedValue = 0;
}
void refresh();
virtual void refresh();
static const ZoneOption options[];
};
@@ -54,4 +54,4 @@ void TextWidget::refresh()
lcdDrawSizedText(zone.x, zone.y, persistentData->options[0].stringValue, sizeof(persistentData->options[0].stringValue), ZCHAR|fontsize|CUSTOM_COLOR);
}
BaseWidgetFactory<TextWidget> textWidget("Text", "", TextWidget::options);
BaseWidgetFactory<TextWidget> textWidget("Text", TextWidget::options);
+2 -2
View File
@@ -28,7 +28,7 @@ class TimerWidget: public Widget
{
}
void refresh();
virtual void refresh();
static const ZoneOption options[];
};
@@ -58,4 +58,4 @@ void TimerWidget::refresh()
drawStringWithIndex(zone.x+137, zone.y+17, "TMR", index+1, SMLSIZE|TEXT_COLOR);
}
BaseWidgetFactory<TimerWidget> timerWidget("Timer", "", TimerWidget::options);
BaseWidgetFactory<TimerWidget> timerWidget("Timer", TimerWidget::options);
+3 -6
View File
@@ -28,13 +28,13 @@ class ValueWidget: public Widget
{
}
virtual void create()
virtual void init()
{
persistentData->options[0].unsignedValue = 1;
persistentData->options[3].unsignedValue = RED;
}
void refresh();
virtual void refresh();
static const ZoneOption options[];
};
@@ -46,9 +46,6 @@ const ZoneOption ValueWidget::options[] = {
void ValueWidget::refresh()
{
const int NUMBERS_W = 56;
const int NUMBERS_H = 30;
const int NUMBERS_MARGIN = 16;
const int NUMBERS_PADDING = 4;
mixsrc_t field = persistentData->options[0].unsignedValue;
@@ -96,4 +93,4 @@ void ValueWidget::refresh()
putsChannel(xValue, yValue, field, attr|DBLSIZE|color);
}
BaseWidgetFactory<ValueWidget> ValueWidget("Value", "", ValueWidget::options);
BaseWidgetFactory<ValueWidget> ValueWidget("Value", ValueWidget::options);