summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/widget/freew.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/eve/widget/freew.c')
-rw-r--r--fw/fe310/eos/eve/widget/freew.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/fw/fe310/eos/eve/widget/freew.c b/fw/fe310/eos/eve/widget/freew.c
index e7591da..11b8e50 100644
--- a/fw/fe310/eos/eve/widget/freew.c
+++ b/fw/fe310/eos/eve/widget/freew.c
@@ -33,7 +33,9 @@ uint8_t eve_freew_draw(EVEWidget *_widget, uint8_t tag0) {
_widget->tag0 = tag0;
_widget->tagN = tag0;
+ eve_cmd_dl(SAVE_CONTEXT());
widget->_draw(widget);
+ eve_cmd_dl(RESTORE_CONTEXT());
return _widget->tagN;
}
@@ -43,15 +45,24 @@ int eve_freew_touch(EVEWidget *_widget, EVETouch *touch, uint16_t evt) {
int ret;
ret = widget->_touch(widget, touch, evt);
- if (ret) eve_widget_set_focus(_widget, NULL);
return ret;
}
-void eve_freew_tag(EVEFreeWidget *widget) {
+uint8_t eve_freew_tag(EVEFreeWidget *widget) {
EVEWidget *_widget = &widget->w;
+ uint8_t ret = EVE_NOTAG;
if (_widget->tagN != EVE_NOTAG) {
- eve_cmd_dl(TAG(_widget->tagN));
+ ret = _widget->tagN;
+ eve_cmd_dl(TAG(ret));
_widget->tagN++;
}
+
+ return ret;
}
+
+uint8_t eve_widget_tag_index(EVEFreeWidget *widget, uint8_t tag) {
+ EVEWidget *_widget = &widget->w;
+
+ return tag - _widget->tag0;
+} \ No newline at end of file