summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/widget
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-08-24 18:12:41 +0200
committerUros Majstorovic <majstor@majstor.org>2020-08-24 18:12:41 +0200
commitd7bdbcf7e6881065200b21a02522a68cf4fb9881 (patch)
tree67712572568ae37a215d872bf1921939b7164a20 /fw/fe310/eos/eve/widget
parent1e5eb7cb910e6f23c69c2c986b6373e9f9abb980 (diff)
fixed bug in form constructor; free widget improved
Diffstat (limited to 'fw/fe310/eos/eve/widget')
-rw-r--r--fw/fe310/eos/eve/widget/freew.c10
-rw-r--r--fw/fe310/eos/eve/widget/freew.h5
-rw-r--r--fw/fe310/eos/eve/widget/strw.c7
-rw-r--r--fw/fe310/eos/eve/widget/textw.c7
4 files changed, 24 insertions, 5 deletions
diff --git a/fw/fe310/eos/eve/widget/freew.c b/fw/fe310/eos/eve/widget/freew.c
index 55f91cb..51d1ead 100644
--- a/fw/fe310/eos/eve/widget/freew.c
+++ b/fw/fe310/eos/eve/widget/freew.c
@@ -34,6 +34,13 @@ void eve_freew_update(EVEFreeWidget *widget, eve_freew_touch_t touch, eve_freew_
if (putc) widget->w.putc = putc;
}
+void eve_freew_tag(EVEFreeWidget *widget) {
+ if (widget->tagN != EVE_TAG_NOTAG) {
+ eve_cmd_dl(TAG(widget->tagN));
+ widget->tagN++;
+ }
+}
+
int eve_freew_touch(EVEWidget *_widget, EVEPage *page, uint8_t tag0, int touch_idx) {
EVEFreeWidget *widget = (EVEFreeWidget *)_widget;
EVETouch *t;
@@ -55,7 +62,8 @@ uint8_t eve_freew_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0) {
EVEFreeWidget *widget = (EVEFreeWidget *)_widget;
widget->tag0 = tag0;
- widget->tagN = widget->_draw(widget, page, tag0);
+ widget->tagN = tag0;
+ widget->_draw(widget, page);
return widget->tagN;
}
diff --git a/fw/fe310/eos/eve/widget/freew.h b/fw/fe310/eos/eve/widget/freew.h
index 49f896f..3347e68 100644
--- a/fw/fe310/eos/eve/widget/freew.h
+++ b/fw/fe310/eos/eve/widget/freew.h
@@ -3,7 +3,7 @@
struct EVEFreeWidget;
typedef int (*eve_freew_touch_t) (struct EVEFreeWidget *, EVEPage *, EVETouch *, uint16_t, uint8_t, int);
-typedef uint8_t (*eve_freew_draw_t) (struct EVEFreeWidget *, EVEPage *, uint8_t);
+typedef void (*eve_freew_draw_t) (struct EVEFreeWidget *, EVEPage *);
typedef struct EVEFreeWidget {
EVEWidget w;
@@ -23,5 +23,6 @@ int eve_freew_create(EVEFreeWidget *widget, EVERect *g, EVEFreeSpec *spec);
void eve_freew_init(EVEFreeWidget *widget, EVERect *g, eve_freew_touch_t touch, eve_freew_draw_t draw, eve_kbd_input_handler_t putc);
void eve_freew_update(EVEFreeWidget *widget, eve_freew_touch_t touch, eve_freew_draw_t draw, eve_kbd_input_handler_t putc);
+void eve_freew_tag(EVEFreeWidget *widget);
int eve_freew_touch(EVEWidget *_widget, EVEPage *page, uint8_t tag0, int touch_idx);
-uint8_t eve_freew_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0); \ No newline at end of file
+uint8_t eve_freew_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0);
diff --git a/fw/fe310/eos/eve/widget/strw.c b/fw/fe310/eos/eve/widget/strw.c
index e973575..4344e7c 100644
--- a/fw/fe310/eos/eve/widget/strw.c
+++ b/fw/fe310/eos/eve/widget/strw.c
@@ -195,7 +195,12 @@ static void _draw_str(EVEStrWidget *widget, EVEWindow *window, uint16_t ch, uint
if (!s) eve_cmd_dl(COLOR_MASK(0 ,0 ,0 ,0));
eve_cmd_dl(VERTEX2F(x + x1, _widget->g.y));
eve_cmd_dl(VERTEX2F(x + x2, _widget->g.y + widget->font->h));
- if (!s) eve_cmd_dl(COLOR_MASK(1 ,1 ,1 ,1));
+ if (!s) {
+ eve_cmd_dl(COLOR_MASK(1 ,1 ,1 ,1));
+ eve_cmd_dl(BEGIN(EVE_LINES));
+ eve_cmd_dl(VERTEX2F(x + x1, _widget->g.y + widget->font->h));
+ eve_cmd_dl(VERTEX2F(x + x2, _widget->g.y + widget->font->h));
+ }
eve_cmd_dl(END());
if (len) {
if (s) eve_cmd_dl(COLOR_RGBC(window->color_bg));
diff --git a/fw/fe310/eos/eve/widget/textw.c b/fw/fe310/eos/eve/widget/textw.c
index 5835a57..dd11c11 100644
--- a/fw/fe310/eos/eve/widget/textw.c
+++ b/fw/fe310/eos/eve/widget/textw.c
@@ -202,7 +202,12 @@ static void _draw_line(EVETextWidget *widget, EVEWindow *window, uint16_t l, uin
if (!s) eve_cmd_dl(COLOR_MASK(0 ,0 ,0 ,0));
eve_cmd_dl(VERTEX2F(_widget->g.x + x1, _widget->g.y + l * widget->font->h));
eve_cmd_dl(VERTEX2F(_widget->g.x + x2, _widget->g.y + (l + 1) * widget->font->h));
- if (!s) eve_cmd_dl(COLOR_MASK(1 ,1 ,1 ,1));
+ if (!s) {
+ eve_cmd_dl(COLOR_MASK(1 ,1 ,1 ,1));
+ eve_cmd_dl(BEGIN(EVE_LINES));
+ eve_cmd_dl(VERTEX2F(_widget->g.x + x1, _widget->g.y + (l + 1) * widget->font->h));
+ eve_cmd_dl(VERTEX2F(_widget->g.x + x2, _widget->g.y + (l + 1) * widget->font->h));
+ }
eve_cmd_dl(END());
if (len) {
if (s) eve_cmd_dl(COLOR_RGBC(window->color_bg));