From df87186480c026526e6cea5056fdde69e2bd1b2f Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 18 May 2014 09:51:56 +1000 Subject: Implement text entry and text box widgets. --- src/libraries/winFang.c | 17 ++++++++++++++++- src/purkle/purkle.c | 10 ---------- 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/libraries/winFang.c b/src/libraries/winFang.c index 0d1622d..b6ceee9 100644 --- a/src/libraries/winFang.c +++ b/src/libraries/winFang.c @@ -447,11 +447,25 @@ Widget *widgetAdd(winFang *win, char *type , char *title, int x, int y, int w, i eo_key_data_set("Widget", result, NULL) ); + if (strcmp(WT_ENTRY, type) == 0) + { + eo_do(result->obj, + elm_obj_entry_scrollable_set(EINA_TRUE), + elm_obj_entry_editable_set(EINA_TRUE) + ); + } + else if (strcmp(WT_TEXTBOX, type) == 0) + { + eo_do(result->obj, + elm_obj_entry_scrollable_set(EINA_TRUE), + elm_obj_entry_editable_set(EINA_FALSE) + ); + } + if (x < 0) elm_layout_box_append(win->win, WF_BOX, result->obj); else elm_grid_pack(win->grid, result->obj, x, y, w, h); - winFangCalcMinSize(win); if (title) { @@ -459,6 +473,7 @@ Widget *widgetAdd(winFang *win, char *type , char *title, int x, int y, int w, i elm_object_text_set(result->obj, result->label); evas_object_name_set(result->obj, title); } + winFangCalcMinSize(win); } return result; diff --git a/src/purkle/purkle.c b/src/purkle/purkle.c index a9b1652..7d7e24d 100644 --- a/src/purkle/purkle.c +++ b/src/purkle/purkle.c @@ -15,17 +15,7 @@ static winFang *purkleAdd(winFang *parent, int w, int h, EPhysics_World *world) me = winFangAdd(parent, 300, 26, w, h, "chatter box", "purkle", world); history = widgetAdd(me, WT_TEXTBOX, "History is shown here", -1, -1, -1, -1); - eo_do(history->obj, - elm_obj_entry_scrollable_set(EINA_TRUE), - elm_obj_entry_editable_set(EINA_FALSE) - ); - entry = widgetAdd(me, WT_ENTRY, "", -1, -1, -1, -1); - eo_do(entry->obj, - elm_obj_entry_scrollable_set(EINA_TRUE), - elm_obj_entry_editable_set(EINA_TRUE) - ); - winFangCalcMinSize(me); return me; -- cgit v1.1