[Horus] Widgets can be written in Lua
This commit is contained in:
@@ -28,24 +28,16 @@ class GaugeWidget: public Widget
|
||||
{
|
||||
}
|
||||
|
||||
virtual void init()
|
||||
{
|
||||
persistentData->options[0].unsignedValue = 1;
|
||||
persistentData->options[1].signedValue = -RESX;
|
||||
persistentData->options[2].signedValue = RESX;
|
||||
persistentData->options[3].unsignedValue = RED;
|
||||
}
|
||||
|
||||
virtual void refresh();
|
||||
|
||||
static const ZoneOption options[];
|
||||
};
|
||||
|
||||
const ZoneOption GaugeWidget::options[] = {
|
||||
{ "Source", ZoneOption::Source },
|
||||
{ "Min", ZoneOption::Integer },
|
||||
{ "Max", ZoneOption::Integer },
|
||||
{ "Color", ZoneOption::Color },
|
||||
{ "Source", ZoneOption::Source, { .unsignedValue = 1 } },
|
||||
{ "Min", ZoneOption::Integer, { .signedValue = -RESX } },
|
||||
{ "Max", ZoneOption::Integer, { .signedValue = RESX } },
|
||||
{ "Color", ZoneOption::Color, { .unsignedValue = RED } },
|
||||
{ NULL, ZoneOption::Bool }
|
||||
};
|
||||
|
||||
|
||||
@@ -28,22 +28,15 @@ class TextWidget: public Widget
|
||||
{
|
||||
}
|
||||
|
||||
virtual void init()
|
||||
{
|
||||
str2zchar(persistentData->options[0].stringValue, "Label", sizeof(persistentData->options[0].stringValue));
|
||||
persistentData->options[1].unsignedValue = RED;
|
||||
persistentData->options[2].unsignedValue = 0;
|
||||
}
|
||||
|
||||
virtual void refresh();
|
||||
|
||||
static const ZoneOption options[];
|
||||
};
|
||||
|
||||
const ZoneOption TextWidget::options[] = {
|
||||
{ "Text", ZoneOption::String },
|
||||
{ "Color", ZoneOption::Color },
|
||||
{ "Size", ZoneOption::TextSize },
|
||||
{ "Text", ZoneOption::String, { .stringValue = { '\015', '\347', '\0', '\14', '\377', '\376', '\373', '\364' } } },
|
||||
{ "Color", ZoneOption::Color, { .unsignedValue = RED } },
|
||||
{ "Size", ZoneOption::TextSize, { .unsignedValue = 0 } },
|
||||
{ NULL, ZoneOption::Bool }
|
||||
};
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class TimerWidget: public Widget
|
||||
};
|
||||
|
||||
const ZoneOption TimerWidget::options[] = {
|
||||
{ "Timer source", ZoneOption::Timer },
|
||||
{ "Timer source", ZoneOption::Timer, { .unsignedValue = 0 } },
|
||||
{ NULL, ZoneOption::Bool }
|
||||
};
|
||||
|
||||
|
||||
@@ -28,19 +28,13 @@ class ValueWidget: public Widget
|
||||
{
|
||||
}
|
||||
|
||||
virtual void init()
|
||||
{
|
||||
persistentData->options[0].unsignedValue = 1;
|
||||
persistentData->options[3].unsignedValue = RED;
|
||||
}
|
||||
|
||||
virtual void refresh();
|
||||
|
||||
static const ZoneOption options[];
|
||||
};
|
||||
|
||||
const ZoneOption ValueWidget::options[] = {
|
||||
{ "Source", ZoneOption::Source },
|
||||
{ "Source", ZoneOption::Source, { .unsignedValue = MIXSRC_Rud } },
|
||||
{ NULL, ZoneOption::Bool }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user