More settings work. Widgets can now be disabled, although not all the rendering is implemented.
This commit is contained in:
parent
9f066b6e92
commit
aa09a6c31c
20 changed files with 259 additions and 123 deletions
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
static void buttonDel(WidgetT **widget);
|
static void buttonDel(WidgetT **widget);
|
||||||
static void buttonMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
static void buttonMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
||||||
static void buttonPaint(WidgetT *widget, RectT pos);
|
static void buttonPaint(WidgetT *widget, uint8_t enabled, RectT pos);
|
||||||
|
|
||||||
|
|
||||||
void buttonClickHandlerSet(ButtonT *button, widgetCallback callback) {
|
void buttonClickHandlerSet(ButtonT *button, widgetCallback callback) {
|
||||||
|
@ -103,18 +103,30 @@ ButtonT *buttonNew(uint16_t x, uint16_t y, char *title, widgetCallback callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void buttonPaint(WidgetT *widget, RectT pos) {
|
static void buttonPaint(WidgetT *widget, uint8_t enabled, RectT pos) {
|
||||||
ButtonT *b;
|
ButtonT *b;
|
||||||
int16_t i;
|
int16_t i;
|
||||||
int8_t active;
|
int8_t active;
|
||||||
ColorT highlight;
|
ColorT highlight;
|
||||||
ColorT shadow;
|
ColorT shadow;
|
||||||
|
ColorT background;
|
||||||
|
ColorT text;
|
||||||
|
|
||||||
if (GUI_GET_FLAG(widget, WIDGET_FLAG_DIRTY)) {
|
if (GUI_GET_FLAG(widget, WIDGET_FLAG_DIRTY)) {
|
||||||
b = (ButtonT *)widget;
|
b = (ButtonT *)widget;
|
||||||
active = GUI_GET_FLAG(widget, WIDGET_FLAG_ACTIVE);
|
active = GUI_GET_FLAG(widget, WIDGET_FLAG_ACTIVE);
|
||||||
|
|
||||||
|
if (enabled) {
|
||||||
highlight = active ? _guiColor[COLOR_BUTTON_SHADOW] : _guiColor[COLOR_BUTTON_HIGHLIGHT];
|
highlight = active ? _guiColor[COLOR_BUTTON_SHADOW] : _guiColor[COLOR_BUTTON_HIGHLIGHT];
|
||||||
shadow = active ? _guiColor[COLOR_BUTTON_HIGHLIGHT] : _guiColor[COLOR_BUTTON_SHADOW];
|
shadow = active ? _guiColor[COLOR_BUTTON_HIGHLIGHT] : _guiColor[COLOR_BUTTON_SHADOW];
|
||||||
|
background = _guiColor[COLOR_BUTTON_BACKGROUND];
|
||||||
|
text = _guiColor[COLOR_BUTTON_TEXT];
|
||||||
|
} else {
|
||||||
|
highlight = active ? _guiColor[COLOR_BUTTON_SHADOW_DISABLED] : _guiColor[COLOR_BUTTON_HIGHLIGHT_DISABLED];
|
||||||
|
shadow = active ? _guiColor[COLOR_BUTTON_HIGHLIGHT_DISABLED] : _guiColor[COLOR_BUTTON_SHADOW_DISABLED];
|
||||||
|
background = _guiColor[COLOR_BUTTON_BACKGROUND_DISABLED];
|
||||||
|
text = _guiColor[COLOR_BUTTON_TEXT_DISABLED];
|
||||||
|
}
|
||||||
|
|
||||||
// Draw bezel.
|
// Draw bezel.
|
||||||
for (i=0; i<_guiMetric[METRIC_BUTTON_BEZEL_SIZE]; i++) {
|
for (i=0; i<_guiMetric[METRIC_BUTTON_BEZEL_SIZE]; i++) {
|
||||||
|
@ -122,10 +134,10 @@ static void buttonPaint(WidgetT *widget, RectT pos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw background (depends on x from above).
|
// Draw background (depends on x from above).
|
||||||
surfaceRectangleFilledDraw(pos.x + i, pos.y + i, pos.x + pos.w - i, pos.y + pos.h - i, _guiColor[COLOR_BUTTON_BACKGROUND]);
|
surfaceRectangleFilledDraw(pos.x + i, pos.y + i, pos.x + pos.w - i, pos.y + pos.h - i, background);
|
||||||
|
|
||||||
// Draw title (depends on x from above).
|
// Draw title (depends on x from above).
|
||||||
fontRender(_guiFont, b->title, _guiColor[COLOR_BUTTON_TEXT], _guiColor[COLOR_BUTTON_BACKGROUND], pos.x + i + _guiMetric[METRIC_BUTTON_HORIZONTAL_PADDING] + active, pos.y + i + _guiMetric[METRIC_BUTTON_VERTICAL_PADDING] + active);
|
fontRender(_guiFont, b->title, text, background, pos.x + i + _guiMetric[METRIC_BUTTON_HORIZONTAL_PADDING] + active, pos.y + i + _guiMetric[METRIC_BUTTON_VERTICAL_PADDING] + active);
|
||||||
|
|
||||||
GUI_CLEAR_FLAG(widget, WIDGET_FLAG_DIRTY);
|
GUI_CLEAR_FLAG(widget, WIDGET_FLAG_DIRTY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
static void checkboxDel(WidgetT **widget);
|
static void checkboxDel(WidgetT **widget);
|
||||||
static void checkboxMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
static void checkboxMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
||||||
static void checkboxPaint(WidgetT *widget, RectT pos);
|
static void checkboxPaint(WidgetT *widget, uint8_t enabled, RectT pos);
|
||||||
|
|
||||||
|
|
||||||
void checkboxClickHandlerSet(CheckboxT *checkbox, widgetCallback callback) {
|
void checkboxClickHandlerSet(CheckboxT *checkbox, widgetCallback callback) {
|
||||||
|
@ -89,19 +89,31 @@ CheckboxT *checkboxNew(uint16_t x, uint16_t y, char *title) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void checkboxPaint(WidgetT *widget, RectT pos) {
|
static void checkboxPaint(WidgetT *widget, uint8_t enabled, RectT pos) {
|
||||||
CheckboxT *c = (CheckboxT *)widget;
|
CheckboxT *c = (CheckboxT *)widget;
|
||||||
int16_t o;
|
int16_t o;
|
||||||
int8_t active;
|
int8_t active;
|
||||||
ColorT highlight;
|
ColorT highlight;
|
||||||
ColorT shadow;
|
ColorT shadow;
|
||||||
ColorT fill;
|
ColorT fill;
|
||||||
|
ColorT text;
|
||||||
|
ColorT background;
|
||||||
|
|
||||||
if (GUI_GET_FLAG(widget, WIDGET_FLAG_DIRTY)) {
|
if (GUI_GET_FLAG(widget, WIDGET_FLAG_DIRTY)) {
|
||||||
active = checkboxValueGet(c);
|
active = checkboxValueGet(c);
|
||||||
|
if (enabled) {
|
||||||
highlight = active ? _guiColor[COLOR_CHECKBOX_SHADOW] : _guiColor[COLOR_CHECKBOX_HIGHLIGHT];
|
highlight = active ? _guiColor[COLOR_CHECKBOX_SHADOW] : _guiColor[COLOR_CHECKBOX_HIGHLIGHT];
|
||||||
shadow = active ? _guiColor[COLOR_CHECKBOX_HIGHLIGHT] : _guiColor[COLOR_CHECKBOX_SHADOW];
|
shadow = active ? _guiColor[COLOR_CHECKBOX_HIGHLIGHT] : _guiColor[COLOR_CHECKBOX_SHADOW];
|
||||||
fill = active ? _guiColor[COLOR_CHECKBOX_ACTIVE] : _guiColor[COLOR_CHECKBOX_INACTIVE];
|
fill = active ? _guiColor[COLOR_CHECKBOX_ACTIVE] : _guiColor[COLOR_CHECKBOX_INACTIVE];
|
||||||
|
text = _guiColor[COLOR_CHECKBOX_TEXT];
|
||||||
|
background = _guiColor[COLOR_WINDOW_BACKGROUND];
|
||||||
|
} else {
|
||||||
|
highlight = active ? _guiColor[COLOR_CHECKBOX_SHADOW_DISABLED] : _guiColor[COLOR_CHECKBOX_HIGHLIGHT_DISABLED];
|
||||||
|
shadow = active ? _guiColor[COLOR_CHECKBOX_HIGHLIGHT_DISABLED] : _guiColor[COLOR_CHECKBOX_SHADOW_DISABLED];
|
||||||
|
fill = active ? _guiColor[COLOR_CHECKBOX_ACTIVE_DISABLED] : _guiColor[COLOR_CHECKBOX_INACTIVE_DISABLED];
|
||||||
|
text = _guiColor[COLOR_CHECKBOX_TEXT_DISABLED];
|
||||||
|
background = _guiColor[COLOR_WINDOW_BACKGROUND];
|
||||||
|
}
|
||||||
|
|
||||||
// Checkbox is 10x10 pixels. Find offset based on font height.
|
// Checkbox is 10x10 pixels. Find offset based on font height.
|
||||||
o = (_guiFont->height - 10) * 0.5;
|
o = (_guiFont->height - 10) * 0.5;
|
||||||
|
@ -113,7 +125,7 @@ static void checkboxPaint(WidgetT *widget, RectT pos) {
|
||||||
surfaceRectangleFilledDraw(pos.x + 1, pos.y + o + 1, pos.x + 9, pos.y + + o + 9, fill);
|
surfaceRectangleFilledDraw(pos.x + 1, pos.y + o + 1, pos.x + 9, pos.y + + o + 9, fill);
|
||||||
|
|
||||||
// Draw title.
|
// Draw title.
|
||||||
fontRender(_guiFont, c->title, _guiColor[COLOR_CHECKBOX_TEXT], _guiColor[COLOR_WINDOW_BACKGROUND], pos.x + 10 + _guiMetric[METRIC_CHECKBOX_PADDING], pos.y);
|
fontRender(_guiFont, c->title, text, background, pos.x + 10 + _guiMetric[METRIC_CHECKBOX_PADDING], pos.y);
|
||||||
|
|
||||||
GUI_CLEAR_FLAG(widget, WIDGET_FLAG_DIRTY);
|
GUI_CLEAR_FLAG(widget, WIDGET_FLAG_DIRTY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
|
|
||||||
static void desktopPaint(WidgetT *desktop, RectT pos);
|
static void desktopPaint(WidgetT *desktop, uint8_t enabled, RectT pos);
|
||||||
|
|
||||||
|
|
||||||
WidgetT *desktopInit(WidgetT *desktop) {
|
WidgetT *desktopInit(WidgetT *desktop) {
|
||||||
|
@ -60,8 +60,9 @@ DesktopT *desktopNew(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void desktopPaint(WidgetT *desktop, RectT pos) {
|
static void desktopPaint(WidgetT *desktop, uint8_t enabled, RectT pos) {
|
||||||
(void)pos;
|
(void)pos;
|
||||||
|
(void)enabled;
|
||||||
|
|
||||||
if (GUI_GET_FLAG(desktop, WIDGET_FLAG_DIRTY)) {
|
if (GUI_GET_FLAG(desktop, WIDGET_FLAG_DIRTY)) {
|
||||||
surfaceClear(_guiColor[COLOR_DESKTOP]);
|
surfaceClear(_guiColor[COLOR_DESKTOP]);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
static void frameDel(WidgetT **widget);
|
static void frameDel(WidgetT **widget);
|
||||||
static void framePaint(WidgetT *widget, RectT pos);
|
static void framePaint(WidgetT *widget, uint8_t enabled, RectT pos);
|
||||||
|
|
||||||
|
|
||||||
static void frameDel(WidgetT **widget) {
|
static void frameDel(WidgetT **widget) {
|
||||||
|
@ -63,7 +63,7 @@ FrameT *frameNew(uint16_t x, uint16_t y, uint16_t w, uint16_t h, char *title) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void framePaint(WidgetT *widget, RectT pos) {
|
static void framePaint(WidgetT *widget, uint8_t enabled, RectT pos) {
|
||||||
FrameT *f = (FrameT *)widget;
|
FrameT *f = (FrameT *)widget;
|
||||||
|
|
||||||
if (GUI_GET_FLAG(widget, WIDGET_FLAG_DIRTY)) {
|
if (GUI_GET_FLAG(widget, WIDGET_FLAG_DIRTY)) {
|
||||||
|
|
|
@ -47,7 +47,7 @@ static uint8_t _guiHasStopped = 0;
|
||||||
static WidgetT ***_guiDeleteList = NULL;
|
static WidgetT ***_guiDeleteList = NULL;
|
||||||
|
|
||||||
|
|
||||||
// Widget Magic Debug Info
|
// Widget Magic Debug Info. Don't forget to change MagicE!
|
||||||
static char *_magicDebugNames[MAGIC_COUNT] = {
|
static char *_magicDebugNames[MAGIC_COUNT] = {
|
||||||
"Unknown",
|
"Unknown",
|
||||||
"Desktop",
|
"Desktop",
|
||||||
|
@ -309,19 +309,23 @@ static void guiKeyboardChildrenProcess(WidgetT *widget, uint8_t ascii, uint8_t e
|
||||||
// Does this widget want events? Check for global keyboard so it doesn't get double events.
|
// Does this widget want events? Check for global keyboard so it doesn't get double events.
|
||||||
if (widget) {
|
if (widget) {
|
||||||
if (widget->keyboardEventMethod && GUI_GET_FLAG(widget, WIDGET_FLAG_ALWAYS_RECEIVE_KEYBOARD_EVENTS)) {
|
if (widget->keyboardEventMethod && GUI_GET_FLAG(widget, WIDGET_FLAG_ALWAYS_RECEIVE_KEYBOARD_EVENTS)) {
|
||||||
|
if (!GUI_GET_FLAG(widget, WIDGET_FLAG_DISABLED)) {
|
||||||
widget->keyboardEventMethod(widget, ascii, extended, scancode, shift, control, alt);
|
widget->keyboardEventMethod(widget, ascii, extended, scancode, shift, control, alt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void guiKeyboardProcess(uint8_t ascii, uint8_t extended, uint8_t scancode, uint8_t shift, uint8_t control, uint8_t alt) {
|
void guiKeyboardProcess(uint8_t ascii, uint8_t extended, uint8_t scancode, uint8_t shift, uint8_t control, uint8_t alt) {
|
||||||
// Does the focused widget want events? Check for global keyboard so it doesn't get double events.
|
// Does the focused widget want events? Check for global keyboard so it doesn't get double events.
|
||||||
if (_guiFocused) {
|
if (_guiFocused) {
|
||||||
if (_guiFocused->keyboardEventMethod && !GUI_GET_FLAG(_guiFocused, WIDGET_FLAG_ALWAYS_RECEIVE_KEYBOARD_EVENTS)) {
|
if (_guiFocused->keyboardEventMethod && !GUI_GET_FLAG(_guiFocused, WIDGET_FLAG_ALWAYS_RECEIVE_KEYBOARD_EVENTS)) {
|
||||||
|
if (!GUI_GET_FLAG(_guiFocused, WIDGET_FLAG_DISABLED)) {
|
||||||
_guiFocused->keyboardEventMethod(_guiFocused, ascii, extended, scancode, shift, control, alt);
|
_guiFocused->keyboardEventMethod(_guiFocused, ascii, extended, scancode, shift, control, alt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check everyone for global keyboard handling.
|
// Check everyone for global keyboard handling.
|
||||||
guiKeyboardChildrenProcess((WidgetT *)_guiDesktop, ascii, extended, scancode, shift, control, alt);
|
guiKeyboardChildrenProcess((WidgetT *)_guiDesktop, ascii, extended, scancode, shift, control, alt);
|
||||||
|
@ -411,11 +415,13 @@ static uint8_t guiMouseChildrenProcess(WidgetT *widget, MouseT *mouse) {
|
||||||
if (widget->window == _guiActiveWindow || widget->magic == MAGIC_WINDOW || widget->magic == MAGIC_DESKTOP) {
|
if (widget->window == _guiActiveWindow || widget->magic == MAGIC_WINDOW || widget->magic == MAGIC_DESKTOP) {
|
||||||
// Is there a mouse handler?
|
// Is there a mouse handler?
|
||||||
if (widget->mouseEventMethod) {
|
if (widget->mouseEventMethod) {
|
||||||
|
if (!GUI_GET_FLAG(widget, WIDGET_FLAG_DISABLED)) {
|
||||||
// Ask child to handle event.
|
// Ask child to handle event.
|
||||||
widget->mouseEventMethod(widget, mouse, mx, my, event);
|
widget->mouseEventMethod(widget, mouse, mx, my, event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Proper child found.
|
// Proper child found.
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -443,7 +449,7 @@ void guiPaint(WidgetT *widget) {
|
||||||
if (widget->paintMethod) {
|
if (widget->paintMethod) {
|
||||||
surfaceSet(widget->surface);
|
surfaceSet(widget->surface);
|
||||||
guiPaintBoundsGet(widget, &pos);
|
guiPaintBoundsGet(widget, &pos);
|
||||||
widget->paintMethod(widget, pos);
|
widget->paintMethod(widget, !GUI_GET_FLAG(widget, WIDGET_FLAG_DISABLED), pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paint all children.
|
// Paint all children.
|
||||||
|
@ -493,26 +499,40 @@ DesktopT *guiStartup(void) {
|
||||||
_guiMetric[METRIC_BUTTON_BEZEL_SIZE] = 2;
|
_guiMetric[METRIC_BUTTON_BEZEL_SIZE] = 2;
|
||||||
_guiMetric[METRIC_BUTTON_HORIZONTAL_PADDING] = 8;
|
_guiMetric[METRIC_BUTTON_HORIZONTAL_PADDING] = 8;
|
||||||
_guiMetric[METRIC_BUTTON_VERTICAL_PADDING] = 2;
|
_guiMetric[METRIC_BUTTON_VERTICAL_PADDING] = 2;
|
||||||
|
|
||||||
_guiMetric[METRIC_WINDOW_BORDER_WIDTH] = 4; // Does not include highlight or shadow lines.
|
_guiMetric[METRIC_WINDOW_BORDER_WIDTH] = 4; // Does not include highlight or shadow lines.
|
||||||
_guiMetric[METRIC_WINDOW_TITLE_HEIGHT] = 17; // Does not include highlight or shadow lines.
|
_guiMetric[METRIC_WINDOW_TITLE_HEIGHT] = 17; // Does not include highlight or shadow lines.
|
||||||
_guiMetric[METRIC_WINDOW_TITLE_GRAB_HEIGHT] = _guiMetric[METRIC_WINDOW_BORDER_WIDTH] + _guiMetric[METRIC_WINDOW_TITLE_HEIGHT] + 5; // Border, highlights, titlebar.
|
_guiMetric[METRIC_WINDOW_TITLE_GRAB_HEIGHT] = _guiMetric[METRIC_WINDOW_BORDER_WIDTH] + _guiMetric[METRIC_WINDOW_TITLE_HEIGHT] + 5; // Border, highlights, titlebar.
|
||||||
|
|
||||||
_guiMetric[METRIC_CHECKBOX_PADDING] = 6; // Makes the 10 wide checkbox fill two character cells by padding it out to 16.
|
_guiMetric[METRIC_CHECKBOX_PADDING] = 6; // Makes the 10 wide checkbox fill two character cells by padding it out to 16.
|
||||||
|
|
||||||
_guiMetric[METRIC_RADIOBUTTON_PADDING] = 6; // Makes the 10 wide radio button fill two character cells by padding it out to 16.
|
_guiMetric[METRIC_RADIOBUTTON_PADDING] = 6; // Makes the 10 wide radio button fill two character cells by padding it out to 16.
|
||||||
|
|
||||||
_guiMetric[METRIC_TEXTBOX_HORIZONTAL_PADDING] = 2;
|
_guiMetric[METRIC_TEXTBOX_HORIZONTAL_PADDING] = 2;
|
||||||
_guiMetric[METRIC_TEXTBOX_VERTICAL_PADDING] = 2;
|
_guiMetric[METRIC_TEXTBOX_VERTICAL_PADDING] = 2;
|
||||||
_guiMetric[METRIC_TEXTBOX_PADDING] = 6; // Matches other label / widget padding.
|
_guiMetric[METRIC_TEXTBOX_PADDING] = 6; // Matches other label / widget padding.
|
||||||
|
|
||||||
_guiMetric[METRIC_UPDOWN_HORIZONTAL_PADDING] = 2;
|
_guiMetric[METRIC_UPDOWN_HORIZONTAL_PADDING] = 2;
|
||||||
_guiMetric[METRIC_UPDOWN_VERTICAL_PADDING] = 2;
|
_guiMetric[METRIC_UPDOWN_VERTICAL_PADDING] = 2;
|
||||||
_guiMetric[METRIC_UPDOWN_PADDING] = 6; // Matches other label / widget padding.
|
_guiMetric[METRIC_UPDOWN_PADDING] = 6; // Matches other label / widget padding.
|
||||||
_guiMetric[METRIC_UPDOWN_ARROW_PADDING] = 2;
|
_guiMetric[METRIC_UPDOWN_ARROW_PADDING] = 2;
|
||||||
|
|
||||||
_guiMetric[METRIC_LISTBOX_HORIZONTAL_PADDING] = 2;
|
_guiMetric[METRIC_LISTBOX_HORIZONTAL_PADDING] = 2;
|
||||||
_guiMetric[METRIC_LISTBOX_VERTICAL_PADDING] = 2;
|
_guiMetric[METRIC_LISTBOX_VERTICAL_PADDING] = 2;
|
||||||
|
|
||||||
|
|
||||||
_guiColor[COLOR_BUTTON_BACKGROUND] = vbeColorMake(168, 168, 168);
|
_guiColor[COLOR_BUTTON_BACKGROUND] = vbeColorMake(168, 168, 168);
|
||||||
_guiColor[COLOR_BUTTON_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
_guiColor[COLOR_BUTTON_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
||||||
_guiColor[COLOR_BUTTON_SHADOW] = vbeColorMake( 80, 84, 80);
|
_guiColor[COLOR_BUTTON_SHADOW] = vbeColorMake( 80, 84, 80);
|
||||||
_guiColor[COLOR_BUTTON_TEXT] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_BUTTON_TEXT] = vbeColorMake( 0, 0, 0);
|
||||||
|
|
||||||
|
_guiColor[COLOR_BUTTON_BACKGROUND_DISABLED] = vbeColorMake(124, 126, 124);
|
||||||
|
_guiColor[COLOR_BUTTON_HIGHLIGHT_DISABLED] = vbeColorMake(200, 200, 200);
|
||||||
|
_guiColor[COLOR_BUTTON_SHADOW_DISABLED] = vbeColorMake( 80, 84, 80);
|
||||||
|
_guiColor[COLOR_BUTTON_TEXT_DISABLED] = vbeColorMake( 84, 84, 84);
|
||||||
|
|
||||||
_guiColor[COLOR_DESKTOP] = vbeColorMake( 51, 153, 255);
|
_guiColor[COLOR_DESKTOP] = vbeColorMake( 51, 153, 255);
|
||||||
|
|
||||||
_guiColor[COLOR_WINDOW_BACKGROUND] = vbeColorMake(168, 168, 168);
|
_guiColor[COLOR_WINDOW_BACKGROUND] = vbeColorMake(168, 168, 168);
|
||||||
_guiColor[COLOR_WINDOW_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
_guiColor[COLOR_WINDOW_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
||||||
_guiColor[COLOR_WINDOW_SHADOW] = vbeColorMake( 80, 84, 80);
|
_guiColor[COLOR_WINDOW_SHADOW] = vbeColorMake( 80, 84, 80);
|
||||||
|
@ -520,25 +540,41 @@ DesktopT *guiStartup(void) {
|
||||||
_guiColor[COLOR_WINDOW_TITLE_INACTIVE] = vbeColorMake(168, 168, 168);
|
_guiColor[COLOR_WINDOW_TITLE_INACTIVE] = vbeColorMake(168, 168, 168);
|
||||||
_guiColor[COLOR_WINDOW_TITLE_TEXT_ACTIVE] = vbeColorMake(248, 252, 248);
|
_guiColor[COLOR_WINDOW_TITLE_TEXT_ACTIVE] = vbeColorMake(248, 252, 248);
|
||||||
_guiColor[COLOR_WINDOW_TITLE_TEXT_INACTIVE] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_WINDOW_TITLE_TEXT_INACTIVE] = vbeColorMake( 0, 0, 0);
|
||||||
|
|
||||||
_guiColor[COLOR_LABEL_TEXT_INACTIVE] = vbeColorMake(248, 252, 248);
|
_guiColor[COLOR_LABEL_TEXT_INACTIVE] = vbeColorMake(248, 252, 248);
|
||||||
_guiColor[COLOR_LABEL_TEXT_INACTIVE] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_LABEL_TEXT_INACTIVE] = vbeColorMake( 0, 0, 0);
|
||||||
|
|
||||||
_guiColor[COLOR_CHECKBOX_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
_guiColor[COLOR_CHECKBOX_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
||||||
_guiColor[COLOR_CHECKBOX_SHADOW] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_CHECKBOX_SHADOW] = vbeColorMake( 0, 0, 0);
|
||||||
_guiColor[COLOR_CHECKBOX_ACTIVE] = vbeColorMake( 80, 84, 80);
|
_guiColor[COLOR_CHECKBOX_ACTIVE] = vbeColorMake( 80, 84, 80);
|
||||||
_guiColor[COLOR_CHECKBOX_INACTIVE] = vbeColorMake(168, 168, 168);
|
_guiColor[COLOR_CHECKBOX_INACTIVE] = vbeColorMake(168, 168, 168);
|
||||||
_guiColor[COLOR_CHECKBOX_TEXT] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_CHECKBOX_TEXT] = vbeColorMake( 0, 0, 0);
|
||||||
|
_guiColor[COLOR_CHECKBOX_HIGHLIGHT_DISABLED] = vbeColorMake(200, 200, 200);
|
||||||
|
_guiColor[COLOR_CHECKBOX_SHADOW_DISABLED] = vbeColorMake( 80, 84, 80);
|
||||||
|
_guiColor[COLOR_CHECKBOX_ACTIVE_DISABLED] = vbeColorMake( 80, 84, 80);
|
||||||
|
_guiColor[COLOR_CHECKBOX_INACTIVE_DISABLED] = vbeColorMake(124, 126, 124);
|
||||||
|
_guiColor[COLOR_CHECKBOX_TEXT_DISABLED] = vbeColorMake( 84, 84, 84);
|
||||||
|
|
||||||
_guiColor[COLOR_RADIOBUTTON_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
_guiColor[COLOR_RADIOBUTTON_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
||||||
_guiColor[COLOR_RADIOBUTTON_SHADOW] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_RADIOBUTTON_SHADOW] = vbeColorMake( 0, 0, 0);
|
||||||
_guiColor[COLOR_RADIOBUTTON_ACTIVE] = vbeColorMake( 80, 84, 80);
|
_guiColor[COLOR_RADIOBUTTON_ACTIVE] = vbeColorMake( 80, 84, 80);
|
||||||
_guiColor[COLOR_RADIOBUTTON_INACTIVE] = vbeColorMake(168, 168, 168);
|
_guiColor[COLOR_RADIOBUTTON_INACTIVE] = vbeColorMake(168, 168, 168);
|
||||||
_guiColor[COLOR_RADIOBUTTON_TEXT] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_RADIOBUTTON_TEXT] = vbeColorMake( 0, 0, 0);
|
||||||
|
_guiColor[COLOR_RADIOBUTTON_HIGHLIGHT_DISABLED] = vbeColorMake(200, 200, 200);
|
||||||
|
_guiColor[COLOR_RADIOBUTTON_SHADOW_DISABLED] = vbeColorMake( 80, 84, 80);
|
||||||
|
_guiColor[COLOR_RADIOBUTTON_ACTIVE_DISABLED] = vbeColorMake( 80, 84, 80);
|
||||||
|
_guiColor[COLOR_RADIOBUTTON_INACTIVE_DISABLED] = vbeColorMake(124, 126, 124);
|
||||||
|
_guiColor[COLOR_RADIOBUTTON_TEXT_DISABLED] = vbeColorMake( 84, 84, 84);
|
||||||
|
|
||||||
_guiColor[COLOR_FRAME_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
_guiColor[COLOR_FRAME_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
||||||
_guiColor[COLOR_FRAME_SHADOW] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_FRAME_SHADOW] = vbeColorMake( 0, 0, 0);
|
||||||
_guiColor[COLOR_FRAME_TEXT] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_FRAME_TEXT] = vbeColorMake( 0, 0, 0);
|
||||||
|
|
||||||
_guiColor[COLOR_TEXTBOX_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
_guiColor[COLOR_TEXTBOX_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
||||||
_guiColor[COLOR_TEXTBOX_SHADOW] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_TEXTBOX_SHADOW] = vbeColorMake( 0, 0, 0);
|
||||||
_guiColor[COLOR_TEXTBOX_TEXT] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_TEXTBOX_TEXT] = vbeColorMake( 0, 0, 0);
|
||||||
_guiColor[COLOR_TEXTBOX_BACKGROUND] = vbeColorMake(248, 252, 248);
|
_guiColor[COLOR_TEXTBOX_BACKGROUND] = vbeColorMake(248, 252, 248);
|
||||||
|
|
||||||
_guiColor[COLOR_UPDOWN_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
_guiColor[COLOR_UPDOWN_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
||||||
_guiColor[COLOR_UPDOWN_SHADOW] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_UPDOWN_SHADOW] = vbeColorMake( 0, 0, 0);
|
||||||
_guiColor[COLOR_UPDOWN_TEXT] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_UPDOWN_TEXT] = vbeColorMake( 0, 0, 0);
|
||||||
|
@ -546,6 +582,7 @@ DesktopT *guiStartup(void) {
|
||||||
_guiColor[COLOR_UPDOWN_ARROWS_BACKGROUND] = vbeColorMake(124, 126, 124);
|
_guiColor[COLOR_UPDOWN_ARROWS_BACKGROUND] = vbeColorMake(124, 126, 124);
|
||||||
_guiColor[COLOR_UPDOWN_ARROWS_ACTIVE] = vbeColorMake(168, 168, 168);
|
_guiColor[COLOR_UPDOWN_ARROWS_ACTIVE] = vbeColorMake(168, 168, 168);
|
||||||
_guiColor[COLOR_UPDOWN_ARROWS_INACTIVE] = vbeColorMake( 80, 84, 80);
|
_guiColor[COLOR_UPDOWN_ARROWS_INACTIVE] = vbeColorMake( 80, 84, 80);
|
||||||
|
|
||||||
_guiColor[COLOR_LISTBOX_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
_guiColor[COLOR_LISTBOX_HIGHLIGHT] = vbeColorMake(248, 252, 248);
|
||||||
_guiColor[COLOR_LISTBOX_SHADOW] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_LISTBOX_SHADOW] = vbeColorMake( 0, 0, 0);
|
||||||
_guiColor[COLOR_LISTBOX_TEXT] = vbeColorMake( 0, 0, 0);
|
_guiColor[COLOR_LISTBOX_TEXT] = vbeColorMake( 0, 0, 0);
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#define D(w) ((WidgetT **)&w)
|
#define D(w) ((WidgetT **)&w)
|
||||||
|
|
||||||
|
|
||||||
// Widget Magics
|
// Widget Magics. Don't forget to change _magicDebugNames!
|
||||||
enum MagicE {
|
enum MagicE {
|
||||||
MAGIC_UNKNOWN = 0,
|
MAGIC_UNKNOWN = 0,
|
||||||
MAGIC_DESKTOP,
|
MAGIC_DESKTOP,
|
||||||
|
@ -63,20 +63,27 @@ enum MetricE {
|
||||||
METRIC_BUTTON_BEZEL_SIZE = 0,
|
METRIC_BUTTON_BEZEL_SIZE = 0,
|
||||||
METRIC_BUTTON_HORIZONTAL_PADDING,
|
METRIC_BUTTON_HORIZONTAL_PADDING,
|
||||||
METRIC_BUTTON_VERTICAL_PADDING,
|
METRIC_BUTTON_VERTICAL_PADDING,
|
||||||
|
|
||||||
METRIC_WINDOW_BORDER_WIDTH,
|
METRIC_WINDOW_BORDER_WIDTH,
|
||||||
METRIC_WINDOW_TITLE_HEIGHT,
|
METRIC_WINDOW_TITLE_HEIGHT,
|
||||||
METRIC_WINDOW_TITLE_GRAB_HEIGHT,
|
METRIC_WINDOW_TITLE_GRAB_HEIGHT,
|
||||||
|
|
||||||
METRIC_CHECKBOX_PADDING,
|
METRIC_CHECKBOX_PADDING,
|
||||||
|
|
||||||
METRIC_RADIOBUTTON_PADDING,
|
METRIC_RADIOBUTTON_PADDING,
|
||||||
|
|
||||||
METRIC_TEXTBOX_HORIZONTAL_PADDING,
|
METRIC_TEXTBOX_HORIZONTAL_PADDING,
|
||||||
METRIC_TEXTBOX_VERTICAL_PADDING,
|
METRIC_TEXTBOX_VERTICAL_PADDING,
|
||||||
METRIC_TEXTBOX_PADDING,
|
METRIC_TEXTBOX_PADDING,
|
||||||
|
|
||||||
METRIC_UPDOWN_PADDING,
|
METRIC_UPDOWN_PADDING,
|
||||||
METRIC_UPDOWN_ARROW_PADDING,
|
METRIC_UPDOWN_ARROW_PADDING,
|
||||||
METRIC_UPDOWN_HORIZONTAL_PADDING,
|
METRIC_UPDOWN_HORIZONTAL_PADDING,
|
||||||
METRIC_UPDOWN_VERTICAL_PADDING,
|
METRIC_UPDOWN_VERTICAL_PADDING,
|
||||||
|
|
||||||
METRIC_LISTBOX_HORIZONTAL_PADDING,
|
METRIC_LISTBOX_HORIZONTAL_PADDING,
|
||||||
METRIC_LISTBOX_VERTICAL_PADDING,
|
METRIC_LISTBOX_VERTICAL_PADDING,
|
||||||
|
|
||||||
METRIC_COUNT
|
METRIC_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -86,7 +93,13 @@ enum ColorE {
|
||||||
COLOR_BUTTON_HIGHLIGHT,
|
COLOR_BUTTON_HIGHLIGHT,
|
||||||
COLOR_BUTTON_SHADOW,
|
COLOR_BUTTON_SHADOW,
|
||||||
COLOR_BUTTON_TEXT,
|
COLOR_BUTTON_TEXT,
|
||||||
|
COLOR_BUTTON_BACKGROUND_DISABLED,
|
||||||
|
COLOR_BUTTON_HIGHLIGHT_DISABLED,
|
||||||
|
COLOR_BUTTON_SHADOW_DISABLED,
|
||||||
|
COLOR_BUTTON_TEXT_DISABLED,
|
||||||
|
|
||||||
COLOR_DESKTOP,
|
COLOR_DESKTOP,
|
||||||
|
|
||||||
COLOR_WINDOW_BACKGROUND,
|
COLOR_WINDOW_BACKGROUND,
|
||||||
COLOR_WINDOW_HIGHLIGHT,
|
COLOR_WINDOW_HIGHLIGHT,
|
||||||
COLOR_WINDOW_SHADOW,
|
COLOR_WINDOW_SHADOW,
|
||||||
|
@ -94,25 +107,41 @@ enum ColorE {
|
||||||
COLOR_WINDOW_TITLE_INACTIVE,
|
COLOR_WINDOW_TITLE_INACTIVE,
|
||||||
COLOR_WINDOW_TITLE_TEXT_ACTIVE,
|
COLOR_WINDOW_TITLE_TEXT_ACTIVE,
|
||||||
COLOR_WINDOW_TITLE_TEXT_INACTIVE,
|
COLOR_WINDOW_TITLE_TEXT_INACTIVE,
|
||||||
|
|
||||||
COLOR_LABEL_TEXT_ACTIVE,
|
COLOR_LABEL_TEXT_ACTIVE,
|
||||||
COLOR_LABEL_TEXT_INACTIVE,
|
COLOR_LABEL_TEXT_INACTIVE,
|
||||||
|
|
||||||
COLOR_CHECKBOX_HIGHLIGHT,
|
COLOR_CHECKBOX_HIGHLIGHT,
|
||||||
COLOR_CHECKBOX_SHADOW,
|
COLOR_CHECKBOX_SHADOW,
|
||||||
COLOR_CHECKBOX_ACTIVE,
|
COLOR_CHECKBOX_ACTIVE,
|
||||||
COLOR_CHECKBOX_INACTIVE,
|
COLOR_CHECKBOX_INACTIVE,
|
||||||
COLOR_CHECKBOX_TEXT,
|
COLOR_CHECKBOX_TEXT,
|
||||||
|
COLOR_CHECKBOX_HIGHLIGHT_DISABLED,
|
||||||
|
COLOR_CHECKBOX_SHADOW_DISABLED,
|
||||||
|
COLOR_CHECKBOX_ACTIVE_DISABLED,
|
||||||
|
COLOR_CHECKBOX_INACTIVE_DISABLED,
|
||||||
|
COLOR_CHECKBOX_TEXT_DISABLED,
|
||||||
|
|
||||||
COLOR_RADIOBUTTON_HIGHLIGHT,
|
COLOR_RADIOBUTTON_HIGHLIGHT,
|
||||||
COLOR_RADIOBUTTON_SHADOW,
|
COLOR_RADIOBUTTON_SHADOW,
|
||||||
COLOR_RADIOBUTTON_ACTIVE,
|
COLOR_RADIOBUTTON_ACTIVE,
|
||||||
COLOR_RADIOBUTTON_INACTIVE,
|
COLOR_RADIOBUTTON_INACTIVE,
|
||||||
COLOR_RADIOBUTTON_TEXT,
|
COLOR_RADIOBUTTON_TEXT,
|
||||||
|
COLOR_RADIOBUTTON_HIGHLIGHT_DISABLED,
|
||||||
|
COLOR_RADIOBUTTON_SHADOW_DISABLED,
|
||||||
|
COLOR_RADIOBUTTON_ACTIVE_DISABLED,
|
||||||
|
COLOR_RADIOBUTTON_INACTIVE_DISABLED,
|
||||||
|
COLOR_RADIOBUTTON_TEXT_DISABLED,
|
||||||
|
|
||||||
COLOR_FRAME_HIGHLIGHT,
|
COLOR_FRAME_HIGHLIGHT,
|
||||||
COLOR_FRAME_SHADOW,
|
COLOR_FRAME_SHADOW,
|
||||||
COLOR_FRAME_TEXT,
|
COLOR_FRAME_TEXT,
|
||||||
|
|
||||||
COLOR_TEXTBOX_HIGHLIGHT,
|
COLOR_TEXTBOX_HIGHLIGHT,
|
||||||
COLOR_TEXTBOX_SHADOW,
|
COLOR_TEXTBOX_SHADOW,
|
||||||
COLOR_TEXTBOX_TEXT,
|
COLOR_TEXTBOX_TEXT,
|
||||||
COLOR_TEXTBOX_BACKGROUND,
|
COLOR_TEXTBOX_BACKGROUND,
|
||||||
|
|
||||||
COLOR_UPDOWN_HIGHLIGHT,
|
COLOR_UPDOWN_HIGHLIGHT,
|
||||||
COLOR_UPDOWN_SHADOW,
|
COLOR_UPDOWN_SHADOW,
|
||||||
COLOR_UPDOWN_TEXT,
|
COLOR_UPDOWN_TEXT,
|
||||||
|
@ -120,6 +149,7 @@ enum ColorE {
|
||||||
COLOR_UPDOWN_ARROWS_BACKGROUND,
|
COLOR_UPDOWN_ARROWS_BACKGROUND,
|
||||||
COLOR_UPDOWN_ARROWS_ACTIVE,
|
COLOR_UPDOWN_ARROWS_ACTIVE,
|
||||||
COLOR_UPDOWN_ARROWS_INACTIVE,
|
COLOR_UPDOWN_ARROWS_INACTIVE,
|
||||||
|
|
||||||
COLOR_LISTBOX_HIGHLIGHT,
|
COLOR_LISTBOX_HIGHLIGHT,
|
||||||
COLOR_LISTBOX_SHADOW,
|
COLOR_LISTBOX_SHADOW,
|
||||||
COLOR_LISTBOX_TEXT,
|
COLOR_LISTBOX_TEXT,
|
||||||
|
@ -129,6 +159,7 @@ enum ColorE {
|
||||||
COLOR_LISTBOX_ARROWS_BACKGROUND,
|
COLOR_LISTBOX_ARROWS_BACKGROUND,
|
||||||
COLOR_LISTBOX_ARROWS_ACTIVE,
|
COLOR_LISTBOX_ARROWS_ACTIVE,
|
||||||
COLOR_LISTBOX_ARROWS_INACTIVE,
|
COLOR_LISTBOX_ARROWS_INACTIVE,
|
||||||
|
|
||||||
COLOR_COUNT
|
COLOR_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
static void labelDel(WidgetT **widget);
|
static void labelDel(WidgetT **widget);
|
||||||
static void labelMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
static void labelMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
||||||
static void labelPaint(WidgetT *widget, RectT pos);
|
static void labelPaint(WidgetT *widget, uint8_t enabled, RectT pos);
|
||||||
|
|
||||||
|
|
||||||
void labelClickHandlerSet(LabelT *label, widgetCallback callback) {
|
void labelClickHandlerSet(LabelT *label, widgetCallback callback) {
|
||||||
|
@ -120,7 +120,7 @@ LabelT *labelNew(uint16_t x, uint16_t y, char *title) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void labelPaint(WidgetT *widget, RectT pos) {
|
static void labelPaint(WidgetT *widget, uint8_t enabled, RectT pos) {
|
||||||
LabelT *l = (LabelT *)widget;
|
LabelT *l = (LabelT *)widget;
|
||||||
ColorT text = GUI_GET_FLAG(widget, WIDGET_FLAG_ACTIVE) ? l->active : l->foreground;
|
ColorT text = GUI_GET_FLAG(widget, WIDGET_FLAG_ACTIVE) ? l->active : l->foreground;
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ static uint16_t _arrowStart = 0;
|
||||||
static void listboxDel(WidgetT **widget);
|
static void listboxDel(WidgetT **widget);
|
||||||
static void listboxMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
static void listboxMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
||||||
static void listboxKeyboardEvent(WidgetT *widget, uint8_t ascii, uint8_t extended, uint8_t scancode, uint8_t shift, uint8_t control, uint8_t alt);
|
static void listboxKeyboardEvent(WidgetT *widget, uint8_t ascii, uint8_t extended, uint8_t scancode, uint8_t shift, uint8_t control, uint8_t alt);
|
||||||
static void listboxPaint(WidgetT *widget, RectT pos);
|
static void listboxPaint(WidgetT *widget, uint8_t enabled, RectT pos);
|
||||||
static void listboxScrollDown(ListboxT *listbox);
|
static void listboxScrollDown(ListboxT *listbox);
|
||||||
static void listboxScrollUp(ListboxT *listbox);
|
static void listboxScrollUp(ListboxT *listbox);
|
||||||
static void listboxSizesRecalculate(ListboxT *listbox);
|
static void listboxSizesRecalculate(ListboxT *listbox);
|
||||||
|
@ -229,7 +229,7 @@ ListboxT *listboxNew(uint16_t x, uint16_t y, uint16_t w, uint16_t h, char *title
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void listboxPaint(WidgetT *widget, RectT pos) {
|
static void listboxPaint(WidgetT *widget, uint8_t enabled, RectT pos) {
|
||||||
ListboxT *l = (ListboxT *)widget;
|
ListboxT *l = (ListboxT *)widget;
|
||||||
uint16_t items;
|
uint16_t items;
|
||||||
uint16_t o;
|
uint16_t o;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
static void pictureDel(WidgetT **widget);
|
static void pictureDel(WidgetT **widget);
|
||||||
static void pictureMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
static void pictureMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
||||||
static void picturePaint(WidgetT *widget, RectT pos);
|
static void picturePaint(WidgetT *widget, uint8_t enabled, RectT pos);
|
||||||
|
|
||||||
|
|
||||||
void pictureClickHandlerSet(PictureT *picture, widgetCallback callback) {
|
void pictureClickHandlerSet(PictureT *picture, widgetCallback callback) {
|
||||||
|
@ -101,7 +101,7 @@ PictureT *pictureNew(uint16_t x, uint16_t y, char *filename) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void picturePaint(WidgetT *widget, RectT pos) {
|
static void picturePaint(WidgetT *widget, uint8_t enabled, RectT pos) {
|
||||||
PictureT *p = (PictureT *)widget;
|
PictureT *p = (PictureT *)widget;
|
||||||
|
|
||||||
if (GUI_GET_FLAG(widget, WIDGET_FLAG_DIRTY)) {
|
if (GUI_GET_FLAG(widget, WIDGET_FLAG_DIRTY)) {
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
static void radioDel(WidgetT **widget);
|
static void radioDel(WidgetT **widget);
|
||||||
static void radioMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
static void radioMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
||||||
static void radioPaint(WidgetT *widget, RectT pos);
|
static void radioPaint(WidgetT *widget, uint8_t enabled, RectT pos);
|
||||||
static void radioSelectedInGroupClear(WidgetT *widget, uint32_t group);
|
static void radioSelectedInGroupClear(WidgetT *widget, uint32_t group);
|
||||||
static RadioT *radioSelectedInGroupFind(WidgetT *widget, uint32_t group);
|
static RadioT *radioSelectedInGroupFind(WidgetT *widget, uint32_t group);
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ RadioT *radioNew(uint16_t x, uint16_t y, char *title, uint16_t group) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void radioPaint(WidgetT *widget, RectT pos) {
|
static void radioPaint(WidgetT *widget, uint8_t enabled, RectT pos) {
|
||||||
RadioT *r = (RadioT *)widget;
|
RadioT *r = (RadioT *)widget;
|
||||||
int16_t i;
|
int16_t i;
|
||||||
int16_t o;
|
int16_t o;
|
||||||
|
@ -102,12 +102,24 @@ static void radioPaint(WidgetT *widget, RectT pos) {
|
||||||
ColorT highlight;
|
ColorT highlight;
|
||||||
ColorT shadow;
|
ColorT shadow;
|
||||||
ColorT fill;
|
ColorT fill;
|
||||||
|
ColorT text;
|
||||||
|
ColorT background;
|
||||||
|
|
||||||
if (GUI_GET_FLAG(widget, WIDGET_FLAG_DIRTY)) {
|
if (GUI_GET_FLAG(widget, WIDGET_FLAG_DIRTY)) {
|
||||||
active = (radioSelectedGet(r) == r);
|
active = (radioSelectedGet(r) == r);
|
||||||
|
if (enabled) {
|
||||||
highlight = active ? _guiColor[COLOR_RADIOBUTTON_SHADOW] : _guiColor[COLOR_RADIOBUTTON_HIGHLIGHT];
|
highlight = active ? _guiColor[COLOR_RADIOBUTTON_SHADOW] : _guiColor[COLOR_RADIOBUTTON_HIGHLIGHT];
|
||||||
shadow = active ? _guiColor[COLOR_RADIOBUTTON_HIGHLIGHT] : _guiColor[COLOR_RADIOBUTTON_SHADOW];
|
shadow = active ? _guiColor[COLOR_RADIOBUTTON_HIGHLIGHT] : _guiColor[COLOR_RADIOBUTTON_SHADOW];
|
||||||
fill = active ? _guiColor[COLOR_RADIOBUTTON_ACTIVE] : _guiColor[COLOR_RADIOBUTTON_INACTIVE];
|
fill = active ? _guiColor[COLOR_RADIOBUTTON_ACTIVE] : _guiColor[COLOR_RADIOBUTTON_INACTIVE];
|
||||||
|
text = _guiColor[COLOR_CHECKBOX_TEXT];
|
||||||
|
background = _guiColor[COLOR_WINDOW_BACKGROUND];
|
||||||
|
} else {
|
||||||
|
highlight = active ? _guiColor[COLOR_RADIOBUTTON_SHADOW_DISABLED] : _guiColor[COLOR_RADIOBUTTON_HIGHLIGHT_DISABLED];
|
||||||
|
shadow = active ? _guiColor[COLOR_RADIOBUTTON_HIGHLIGHT_DISABLED] : _guiColor[COLOR_RADIOBUTTON_SHADOW_DISABLED];
|
||||||
|
fill = active ? _guiColor[COLOR_RADIOBUTTON_ACTIVE_DISABLED] : _guiColor[COLOR_RADIOBUTTON_INACTIVE_DISABLED];
|
||||||
|
text = _guiColor[COLOR_CHECKBOX_TEXT_DISABLED];
|
||||||
|
background = _guiColor[COLOR_WINDOW_BACKGROUND];
|
||||||
|
}
|
||||||
|
|
||||||
// Radio button is 10x10 pixels. Find offset based on font height.
|
// Radio button is 10x10 pixels. Find offset based on font height.
|
||||||
o = (_guiFont->height - 10) * 0.5;
|
o = (_guiFont->height - 10) * 0.5;
|
||||||
|
@ -125,7 +137,7 @@ static void radioPaint(WidgetT *widget, RectT pos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw title.
|
// Draw title.
|
||||||
fontRender(_guiFont, r->title, _guiColor[COLOR_RADIOBUTTON_TEXT], _guiColor[COLOR_WINDOW_BACKGROUND], pos.x + 10 + _guiMetric[METRIC_RADIOBUTTON_PADDING], pos.y);
|
fontRender(_guiFont, r->title, text, background, pos.x + 10 + _guiMetric[METRIC_RADIOBUTTON_PADDING], pos.y);
|
||||||
|
|
||||||
GUI_CLEAR_FLAG(widget, WIDGET_FLAG_DIRTY);
|
GUI_CLEAR_FLAG(widget, WIDGET_FLAG_DIRTY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ static void terminalFocusEvent(WidgetT *widget, uint8_t focused);
|
||||||
static int16_t terminalIntConvert(char *number, int16_t defaultValue);
|
static int16_t terminalIntConvert(char *number, int16_t defaultValue);
|
||||||
static void terminalMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
static void terminalMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
||||||
static void terminalKeyboardEvent(WidgetT *widget, uint8_t ascii, uint8_t extended, uint8_t scancode, uint8_t shift, uint8_t control, uint8_t alt);
|
static void terminalKeyboardEvent(WidgetT *widget, uint8_t ascii, uint8_t extended, uint8_t scancode, uint8_t shift, uint8_t control, uint8_t alt);
|
||||||
static void terminalPaint(WidgetT *widget, RectT pos);
|
static void terminalPaint(WidgetT *widget, uint8_t enabled, RectT pos);
|
||||||
static void terminalSequenceReset(TerminalT *terminal);
|
static void terminalSequenceReset(TerminalT *terminal);
|
||||||
|
|
||||||
|
|
||||||
|
@ -660,7 +660,7 @@ TerminalT *terminalNew(uint16_t x, uint16_t y, uint16_t cols, uint16_t rows) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void terminalPaint(WidgetT *widget, RectT pos) {
|
static void terminalPaint(WidgetT *widget, uint8_t enabled, RectT pos) {
|
||||||
TerminalT *t = (TerminalT *)widget;
|
TerminalT *t = (TerminalT *)widget;
|
||||||
uint16_t x;
|
uint16_t x;
|
||||||
uint16_t y;
|
uint16_t y;
|
||||||
|
|
|
@ -26,7 +26,7 @@ static void textboxDel(WidgetT **widget);
|
||||||
static void textboxFocusEvent(WidgetT *widget, uint8_t focused);
|
static void textboxFocusEvent(WidgetT *widget, uint8_t focused);
|
||||||
static void textboxMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
static void textboxMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
||||||
static void textboxKeyboardEvent(WidgetT *widget, uint8_t ascii, uint8_t extended, uint8_t scancode, uint8_t shift, uint8_t control, uint8_t alt);
|
static void textboxKeyboardEvent(WidgetT *widget, uint8_t ascii, uint8_t extended, uint8_t scancode, uint8_t shift, uint8_t control, uint8_t alt);
|
||||||
static void textboxPaint(WidgetT *widget, RectT pos);
|
static void textboxPaint(WidgetT *widget, uint8_t enabled, RectT pos);
|
||||||
|
|
||||||
|
|
||||||
static void textboxDel(WidgetT **widget) {
|
static void textboxDel(WidgetT **widget) {
|
||||||
|
@ -254,7 +254,7 @@ TextboxT *textboxNew(uint16_t x, uint16_t y, uint16_t w, char *title) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void textboxPaint(WidgetT *widget, RectT pos) {
|
static void textboxPaint(WidgetT *widget, uint8_t enabled, RectT pos) {
|
||||||
TextboxT *t = (TextboxT *)widget;
|
TextboxT *t = (TextboxT *)widget;
|
||||||
char *draw = NULL;
|
char *draw = NULL;
|
||||||
uint16_t labelWidth;
|
uint16_t labelWidth;
|
||||||
|
|
|
@ -39,7 +39,7 @@ static void updownDel(WidgetT **widget);
|
||||||
static void updownFocusEvent(WidgetT *widget, uint8_t focused);
|
static void updownFocusEvent(WidgetT *widget, uint8_t focused);
|
||||||
static void updownMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
static void updownMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
||||||
static void updownKeyboardEvent(WidgetT *widget, uint8_t ascii, uint8_t extended, uint8_t scancode, uint8_t shift, uint8_t control, uint8_t alt);
|
static void updownKeyboardEvent(WidgetT *widget, uint8_t ascii, uint8_t extended, uint8_t scancode, uint8_t shift, uint8_t control, uint8_t alt);
|
||||||
static void updownPaint(WidgetT *widget, RectT pos);
|
static void updownPaint(WidgetT *widget, uint8_t enabled, RectT pos);
|
||||||
static void updownSizesRecalculate(UpdownT *updown);
|
static void updownSizesRecalculate(UpdownT *updown);
|
||||||
static void updownVisibleSet(UpdownT *updown);
|
static void updownVisibleSet(UpdownT *updown);
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ UpdownT *updownNew(uint16_t x, uint16_t y, int32_t min, int32_t max, int32_t ste
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void updownPaint(WidgetT *widget, RectT pos) {
|
static void updownPaint(WidgetT *widget, uint8_t enabled, RectT pos) {
|
||||||
UpdownT *u = (UpdownT *)widget;
|
UpdownT *u = (UpdownT *)widget;
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
uint16_t textX;
|
uint16_t textX;
|
||||||
|
|
|
@ -22,6 +22,16 @@
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
|
|
||||||
|
void widgetEnableSet(WidgetT *widget, uint8_t enabled) {
|
||||||
|
// We did "DISABLED" for the flag so that "flags = 0" (the default) would enable widgets.
|
||||||
|
if (enabled) {
|
||||||
|
GUI_CLEAR_FLAG(widget, WIDGET_FLAG_DISABLED);
|
||||||
|
} else {
|
||||||
|
GUI_SET_FLAG(widget, WIDGET_FLAG_DISABLED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
uint16_t widgetHeightGet(WidgetT *widget) {
|
uint16_t widgetHeightGet(WidgetT *widget) {
|
||||||
return widget->pos.h;
|
return widget->pos.h;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,8 @@ enum WidgetE {
|
||||||
WIDGET_FLAG_DIRTY = 0,
|
WIDGET_FLAG_DIRTY = 0,
|
||||||
WIDGET_FLAG_ACTIVE,
|
WIDGET_FLAG_ACTIVE,
|
||||||
WIDGET_FLAG_OWNS_SURFACE,
|
WIDGET_FLAG_OWNS_SURFACE,
|
||||||
WIDGET_FLAG_ALWAYS_RECEIVE_KEYBOARD_EVENTS
|
WIDGET_FLAG_ALWAYS_RECEIVE_KEYBOARD_EVENTS,
|
||||||
|
WIDGET_FLAG_DISABLED
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ typedef void (*widgetCallback)(struct WidgetS *widget);
|
||||||
typedef void (*widgetDelMethod)(struct WidgetS **widget);
|
typedef void (*widgetDelMethod)(struct WidgetS **widget);
|
||||||
typedef void (*widgetFocusMethod)(struct WidgetS *widget, uint8_t focused);
|
typedef void (*widgetFocusMethod)(struct WidgetS *widget, uint8_t focused);
|
||||||
typedef void (*widgetKeyboardEventMethod)(struct WidgetS *widget, uint8_t ascii, uint8_t extended, uint8_t scancode, uint8_t shift, uint8_t control, uint8_t alt);
|
typedef void (*widgetKeyboardEventMethod)(struct WidgetS *widget, uint8_t ascii, uint8_t extended, uint8_t scancode, uint8_t shift, uint8_t control, uint8_t alt);
|
||||||
typedef void (*widgetPaintMethod)(struct WidgetS *widget, RectT pos);
|
typedef void (*widgetPaintMethod)(struct WidgetS *widget, uint8_t enabled, RectT pos);
|
||||||
typedef void (*widgetMouseEventMethod)(struct WidgetS *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
typedef void (*widgetMouseEventMethod)(struct WidgetS *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,6 +65,7 @@ typedef struct WidgetS {
|
||||||
} WidgetT;
|
} WidgetT;
|
||||||
|
|
||||||
|
|
||||||
|
void widgetEnableSet(WidgetT *widget, uint8_t enabled);
|
||||||
uint16_t widgetHeightGet(WidgetT *widget);
|
uint16_t widgetHeightGet(WidgetT *widget);
|
||||||
WidgetT *widgetInit(WidgetT *widget, uint8_t magic, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t marginX, uint16_t marginY, uint16_t marginX2, uint16_t marginY2);
|
WidgetT *widgetInit(WidgetT *widget, uint8_t magic, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t marginX, uint16_t marginY, uint16_t marginX2, uint16_t marginY2);
|
||||||
WidgetT *widgetNew(uint8_t magic, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t marginX, uint16_t marginY, uint16_t marginX2, uint16_t marginY2);
|
WidgetT *widgetNew(uint8_t magic, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t marginX, uint16_t marginY, uint16_t marginX2, uint16_t marginY2);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
static void windowAllDeactivate(WidgetT *widget);
|
static void windowAllDeactivate(WidgetT *widget);
|
||||||
static void windowDel(WidgetT **widget);
|
static void windowDel(WidgetT **widget);
|
||||||
static void windowMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
static void windowMouseEvent(WidgetT *widget, MouseT *mouse, uint16_t x, uint16_t y, uint8_t event);
|
||||||
static void windowPaint(WidgetT *widget, RectT pos);
|
static void windowPaint(WidgetT *widget, uint8_t enabled, RectT pos);
|
||||||
|
|
||||||
|
|
||||||
void windowActiveSet(WindowT *window) {
|
void windowActiveSet(WindowT *window) {
|
||||||
|
@ -167,7 +167,7 @@ WindowT *windowNew(uint16_t x, uint16_t y, uint16_t w, uint16_t h, char *title)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void windowPaint(WidgetT *widget, RectT pos) {
|
static void windowPaint(WidgetT *widget, uint8_t enabled, RectT pos) {
|
||||||
WindowT *w = (WindowT *)widget;
|
WindowT *w = (WindowT *)widget;
|
||||||
uint16_t x2;
|
uint16_t x2;
|
||||||
uint16_t y2;
|
uint16_t y2;
|
||||||
|
|
|
@ -41,6 +41,16 @@
|
||||||
#define PORT_BAD 1
|
#define PORT_BAD 1
|
||||||
#define PORT_GOOD 2
|
#define PORT_GOOD 2
|
||||||
|
|
||||||
|
#define TITLE_LEN 80
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct PortS {
|
||||||
|
uint8_t status;
|
||||||
|
char title[TITLE_LEN];
|
||||||
|
uint8_t selected;
|
||||||
|
uint8_t enabled;
|
||||||
|
} PortT;
|
||||||
|
|
||||||
|
|
||||||
static WindowT *winDetecting;
|
static WindowT *winDetecting;
|
||||||
static LabelT *lblOneMoment;
|
static LabelT *lblOneMoment;
|
||||||
|
@ -49,10 +59,7 @@ static WindowT *winSettings;
|
||||||
static FrameT *frmComPorts;
|
static FrameT *frmComPorts;
|
||||||
static FrameT *frmServer;
|
static FrameT *frmServer;
|
||||||
static ButtonT *btnOkay;
|
static ButtonT *btnOkay;
|
||||||
static RadioT *rdoCOM1;
|
static RadioT *rdoCOM[4];
|
||||||
static RadioT *rdoCOM2;
|
|
||||||
static RadioT *rdoCOM3;
|
|
||||||
static RadioT *rdoCOM4;
|
|
||||||
static TextboxT *txtServer;
|
static TextboxT *txtServer;
|
||||||
static UpdownT *updPort;
|
static UpdownT *updPort;
|
||||||
|
|
||||||
|
@ -73,7 +80,8 @@ void taskSettings(void *data) {
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
uint8_t quarterSeconds = 0;
|
uint8_t quarterSeconds = 0;
|
||||||
uint8_t ports[4] = { PORT_NONE, PORT_NONE, PORT_NONE, PORT_NONE }; // 0 = No port. 1 = No modem. 2 = Valid.
|
PortT port[4];
|
||||||
|
uint8_t selected = 1;
|
||||||
|
|
||||||
(void)data;
|
(void)data;
|
||||||
|
|
||||||
|
@ -99,6 +107,7 @@ void taskSettings(void *data) {
|
||||||
snprintf(buffer, 1024, "%s%c", "AT+SOCK1", 13);
|
snprintf(buffer, 1024, "%s%c", "AT+SOCK1", 13);
|
||||||
comWrite(x, buffer, strlen(buffer));
|
comWrite(x, buffer, strlen(buffer));
|
||||||
// Wait a second.
|
// Wait a second.
|
||||||
|
quarterSeconds = 0;
|
||||||
while (quarterSeconds < 5) {
|
while (quarterSeconds < 5) {
|
||||||
taskYield();
|
taskYield();
|
||||||
if (timerQuarterSecondTick) quarterSeconds++;
|
if (timerQuarterSecondTick) quarterSeconds++;
|
||||||
|
@ -106,11 +115,23 @@ void taskSettings(void *data) {
|
||||||
len = comRead(x, buffer, 1024);
|
len = comRead(x, buffer, 1024);
|
||||||
buffer[len] = 0;
|
buffer[len] = 0;
|
||||||
if (strstr(buffer, "OK")) {
|
if (strstr(buffer, "OK")) {
|
||||||
ports[x] = PORT_GOOD;
|
snprintf(port[x].title, TITLE_LEN - 1, "COM%d - SoftModem Found!", x + 1);
|
||||||
|
port[x].status = PORT_GOOD;
|
||||||
|
port[x].selected = selected;
|
||||||
|
port[x].enabled = 1;
|
||||||
|
selected = 0;
|
||||||
} else {
|
} else {
|
||||||
ports[x] = PORT_BAD;
|
snprintf(port[x].title, TITLE_LEN - 1, "COM%d - Incompatable Modem", x + 1);
|
||||||
|
port[x].status = PORT_BAD;
|
||||||
|
port[x].selected = 0;
|
||||||
|
port[x].enabled = 0;
|
||||||
}
|
}
|
||||||
comClose(x);
|
comClose(x);
|
||||||
|
} else {
|
||||||
|
snprintf(port[x].title, TITLE_LEN - 1, "COM%d - Not Present", x + 1);
|
||||||
|
port[x].status = PORT_NONE;
|
||||||
|
port[x].selected = 0;
|
||||||
|
port[x].enabled = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,26 +146,6 @@ void taskSettings(void *data) {
|
||||||
T_FRAME, O(frmComPorts),
|
T_FRAME, O(frmComPorts),
|
||||||
T_X, 10, T_Y, 5, T_WIDTH, 266, T_HEIGHT, 100,
|
T_X, 10, T_Y, 5, T_WIDTH, 266, T_HEIGHT, 100,
|
||||||
T_TITLE, P("COM Ports"),
|
T_TITLE, P("COM Ports"),
|
||||||
T_RADIOBUTTON, O(rdoCOM1),
|
|
||||||
T_X, 5,
|
|
||||||
T_TITLE, P((ports[0] == PORT_NONE ? "COM1 - Not Present" : (ports[0] == PORT_BAD ? "COM1 - Incompatable Modem" : "COM1 - SoftModem Found!"))),
|
|
||||||
T_GROUP, GROUP_COM,
|
|
||||||
T_RADIOBUTTON, T_DONE,
|
|
||||||
T_RADIOBUTTON, O(rdoCOM2),
|
|
||||||
T_X, 5, T_Y, 20,
|
|
||||||
T_TITLE, P((ports[1] == PORT_NONE ? "COM2 - Not Present" : (ports[1] == PORT_BAD ? "COM2 - Incompatable Modem" : "COM2 - SoftModem Found!"))),
|
|
||||||
T_GROUP, GROUP_COM,
|
|
||||||
T_RADIOBUTTON, T_DONE,
|
|
||||||
T_RADIOBUTTON, O(rdoCOM3),
|
|
||||||
T_X, 5, T_Y, 40,
|
|
||||||
T_TITLE, P((ports[2] == PORT_NONE ? "COM3 - Not Present" : (ports[2] == PORT_BAD ? "COM3 - Incompatable Modem" : "COM3 - SoftModem Found!"))),
|
|
||||||
T_GROUP, GROUP_COM,
|
|
||||||
T_RADIOBUTTON, T_DONE,
|
|
||||||
T_RADIOBUTTON, O(rdoCOM4),
|
|
||||||
T_X, 5, T_Y, 60,
|
|
||||||
T_TITLE, P((ports[3] == PORT_NONE ? "COM4 - Not Present" : (ports[3] == PORT_BAD ? "COM4 - Incompatable Modem" : "COM4 - SoftModem Found!"))),
|
|
||||||
T_GROUP, GROUP_COM,
|
|
||||||
T_RADIOBUTTON, T_DONE,
|
|
||||||
T_FRAME, T_DONE,
|
T_FRAME, T_DONE,
|
||||||
|
|
||||||
T_FRAME, O(frmServer),
|
T_FRAME, O(frmServer),
|
||||||
|
@ -176,7 +177,12 @@ void taskSettings(void *data) {
|
||||||
|
|
||||||
tagListRun(uiSettings);
|
tagListRun(uiSettings);
|
||||||
|
|
||||||
guiDebugAreaShow(W(winSettings));
|
rc = 0;
|
||||||
guiDebugAreaShow(W(frmComPorts));
|
for (len=0; len<4; len++) {
|
||||||
guiDebugAreaShow(W(btnOkay));
|
rdoCOM[len] = radioNew(5, rc, port[len].title, GROUP_COM);
|
||||||
|
if (port[len].selected) radioSelectedSet(rdoCOM[len]);
|
||||||
|
widgetEnableSet(W(rdoCOM[len]), port[len].enabled);
|
||||||
|
guiAttach(W(frmComPorts), W(rdoCOM[len]));
|
||||||
|
rc += 20;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,6 +104,7 @@ static void tagListWidgetAttributeHandle(void) {
|
||||||
char **items;
|
char **items;
|
||||||
uint32_t indexAttribute;
|
uint32_t indexAttribute;
|
||||||
uint8_t hasIndex;
|
uint8_t hasIndex;
|
||||||
|
uint8_t enabled;
|
||||||
|
|
||||||
// Process generated lists in reverse.
|
// Process generated lists in reverse.
|
||||||
while (arrlen(_widgetList) > 0) {
|
while (arrlen(_widgetList) > 0) {
|
||||||
|
@ -136,6 +137,7 @@ static void tagListWidgetAttributeHandle(void) {
|
||||||
items = NULL;
|
items = NULL;
|
||||||
indexAttribute = 0;
|
indexAttribute = 0;
|
||||||
hasIndex = 0;
|
hasIndex = 0;
|
||||||
|
enabled = 1;
|
||||||
|
|
||||||
// Parse provided attributes.
|
// Parse provided attributes.
|
||||||
for (i=0; i<arrlen(w->tagList); i+=2) {
|
for (i=0; i<arrlen(w->tagList); i+=2) {
|
||||||
|
@ -163,6 +165,10 @@ static void tagListWidgetAttributeHandle(void) {
|
||||||
click = (widgetCallback)v;
|
click = (widgetCallback)v;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case T_ENABLED:
|
||||||
|
enabled = (v != 0 ? 1 : 0);
|
||||||
|
break;
|
||||||
|
|
||||||
case T_FILENAME:
|
case T_FILENAME:
|
||||||
filename = (char *)v;
|
filename = (char *)v;
|
||||||
break;
|
break;
|
||||||
|
@ -324,6 +330,8 @@ static void tagListWidgetAttributeHandle(void) {
|
||||||
|
|
||||||
if (userdata != NULL) guiUserDataSet(widget, userdata);
|
if (userdata != NULL) guiUserDataSet(widget, userdata);
|
||||||
|
|
||||||
|
widgetEnableSet(widget, enabled);
|
||||||
|
|
||||||
// Store everything we did.
|
// Store everything we did.
|
||||||
*w->widget = widget;
|
*w->widget = widget;
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,9 @@ typedef uint32_t TagItemT;
|
||||||
#define O(x) ((TagItemT)&x) // Widget Objects
|
#define O(x) ((TagItemT)&x) // Widget Objects
|
||||||
#define P(x) ((TagItemT)x) // Pointers
|
#define P(x) ((TagItemT)x) // Pointers
|
||||||
|
|
||||||
|
#define T_FALSE 0
|
||||||
|
#define T_TRUE 1
|
||||||
|
|
||||||
|
|
||||||
enum TagItemsE {
|
enum TagItemsE {
|
||||||
T_END = 0,
|
T_END = 0,
|
||||||
|
@ -61,6 +64,7 @@ enum TagItemsE {
|
||||||
T_COLOR_ACTIVE,
|
T_COLOR_ACTIVE,
|
||||||
T_COLOR_BACKGROUND,
|
T_COLOR_BACKGROUND,
|
||||||
T_COLOR_FOREGROUND,
|
T_COLOR_FOREGROUND,
|
||||||
|
T_ENABLED,
|
||||||
T_FILENAME,
|
T_FILENAME,
|
||||||
T_GROUP,
|
T_GROUP,
|
||||||
T_HEIGHT,
|
T_HEIGHT,
|
||||||
|
|
|
@ -88,6 +88,7 @@ void taskWelcome(void *data) {
|
||||||
T_TITLE, P("Connect"),
|
T_TITLE, P("Connect"),
|
||||||
T_X, 379, T_Y, 157,
|
T_X, 379, T_Y, 157,
|
||||||
T_CLICK, P(btnConnectClick),
|
T_CLICK, P(btnConnectClick),
|
||||||
|
T_ENABLED, T_FALSE,
|
||||||
T_BUTTON, T_DONE,
|
T_BUTTON, T_DONE,
|
||||||
T_WINDOW, T_DONE,
|
T_WINDOW, T_DONE,
|
||||||
T_END
|
T_END
|
||||||
|
|
Loading…
Add table
Reference in a new issue