diff options
author | Uros Majstorovic <majstor@majstor.org> | 2020-08-24 18:12:41 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2020-08-24 18:12:41 +0200 |
commit | d7bdbcf7e6881065200b21a02522a68cf4fb9881 (patch) | |
tree | 67712572568ae37a215d872bf1921939b7164a20 /fw/fe310/eos/eve/screen | |
parent | 1e5eb7cb910e6f23c69c2c986b6373e9f9abb980 (diff) |
fixed bug in form constructor; free widget improved
Diffstat (limited to 'fw/fe310/eos/eve/screen')
-rw-r--r-- | fw/fe310/eos/eve/screen/form.c | 12 | ||||
-rw-r--r-- | fw/fe310/eos/eve/screen/form.h | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/fw/fe310/eos/eve/screen/form.c b/fw/fe310/eos/eve/screen/form.c index 52cfdc6..5837a99 100644 --- a/fw/fe310/eos/eve/screen/form.c +++ b/fw/fe310/eos/eve/screen/form.c @@ -109,7 +109,7 @@ void eve_form_update_g(EVEPage *page, EVEWidget *_widget) { widget->label->g.x = 0; widget->label->g.y = h; } - if (w + widget->g.w >= form->p.v.window->g.w) { + if (w + widget->g.w > form->p.v.window->g.w) { h += _h; w = 0; _h = 0; @@ -123,3 +123,13 @@ void eve_form_update_g(EVEPage *page, EVEWidget *_widget) { widget = eve_widget_next(widget); } } + +EVEWidget *eve_form_widget(EVEForm *form, uint16_t idx) { + EVEWidget *w = form->widget; + int i; + + for (i=0; i<idx; i++) { + w = eve_widget_next(w); + } + return w; +} diff --git a/fw/fe310/eos/eve/screen/form.h b/fw/fe310/eos/eve/screen/form.h index 91a4f8a..b6e59ff 100644 --- a/fw/fe310/eos/eve/screen/form.h +++ b/fw/fe310/eos/eve/screen/form.h @@ -13,3 +13,4 @@ int eve_form_touch(EVEView *v, uint8_t tag0, int touch_idx); uint8_t eve_form_draw(EVEView *v, uint8_t tag0); int eve_form_handle_evt(EVEPage *page, struct EVEWidget *widget, EVETouch *touch, uint16_t evt, uint8_t tag0, int touch_idx); void eve_form_update_g(EVEPage *page, struct EVEWidget *widget); +struct EVEWidget *eve_form_widget(EVEForm *form, uint16_t idx); |