rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=19e4afca8103c636cb6e7acac31a1a1481950fcd

commit 19e4afca8103c636cb6e7acac31a1a1481950fcd
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Wed Mar 30 19:06:25 2016 +0300

    live_widget_common: naviframe to set as demo content
---
 .../ui/live_view/elementary/live_widget_common.c   | 62 ++++++++++++++++++++--
 src/bin/ui/property_demo_swallow.c                 |  1 +
 src/bin/ui/workspace/demo_group.h                  |  1 +
 3 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/src/bin/ui/live_view/elementary/live_widget_common.c 
b/src/bin/ui/live_view/elementary/live_widget_common.c
index 37bb03a..0ecff75 100644
--- a/src/bin/ui/live_view/elementary/live_widget_common.c
+++ b/src/bin/ui/live_view/elementary/live_widget_common.c
@@ -69,6 +69,43 @@ _gen_content_get(void *data __UNUSED__,
    elm_object_text_set(content, _("User Text"));
    return content;
 }
+static void
+_pop_page_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info 
__UNUSED__)
+{
+   Evas_Object *nf = data;
+
+   assert(nf != NULL);
+
+   elm_naviframe_item_pop(nf);
+}
+
+static void
+_next_page_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info 
__UNUSED__)
+{
+   Evas_Object *nf = (Evas_Object *)data, *bt;
+
+   bt = elm_button_add(nf);
+   elm_object_text_set(bt, _("Back"));
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_smart_callback_add(bt, "clicked", _pop_page_cb, nf);
+   evas_object_show(bt);
+
+   elm_naviframe_item_push(nf, _("Page Next"), bt, NULL, NULL, NULL);
+}
+
+static void
+_prev_page_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info 
__UNUSED__)
+{
+   Evas_Object *nf = (Evas_Object *)data, *bt;
+
+   bt = elm_button_add(nf);
+   elm_object_text_set(bt, _("Back"));
+   evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
+   evas_object_smart_callback_add(bt, "clicked", _pop_page_cb, nf);
+   evas_object_show(bt);
+
+   elm_naviframe_item_push(nf, _("Page Prev"), NULL, bt, NULL, NULL);
+}
 Evas_Object *
 object_generate(Demo_Part *part, Evas_Object *object)
 {
@@ -240,7 +277,7 @@ object_generate(Demo_Part *part, Evas_Object *object)
               elm_object_content_set(content, table);
               evas_object_show(table);
               break;
-            case WIDGET_TOOLBAR:
+           case WIDGET_TOOLBAR:
               content = elm_toolbar_add(object);
 
               elm_toolbar_shrink_mode_set(content, ELM_TOOLBAR_SHRINK_EXPAND);
@@ -269,8 +306,8 @@ object_generate(Demo_Part *part, Evas_Object *object)
                 {
                    bt = elm_button_add(content);
                    elm_object_text_set(bt, _("User Text"));
-                   bt = elm_button_add(content);
-                   elm_object_text_set(bt, _("User Text"));
+                   bt2 = elm_button_add(content);
+                   elm_object_text_set(bt2, _("User Text"));
                    elm_list_item_append(content, _("No icons"), bt, bt2, NULL, 
NULL);
                 }
               break;
@@ -313,6 +350,25 @@ object_generate(Demo_Part *part, Evas_Object *object)
                    evas_object_show(bt);
                 }
               break;
+            case WIDGET_NAVIFRAME:
+              content = elm_naviframe_add(object);
+              evas_object_size_hint_weight_set(content, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
+              elm_naviframe_prev_btn_auto_pushed_set(content, false);
+              item = elm_naviframe_item_push(content, _("Page 1"), NULL, NULL, 
NULL, NULL);
+              elm_object_item_part_text_set(item, "subtitle", _("Subtitle 1"));
+              elm_object_item_part_text_set(item, "title", _("Main Page"));
+              evas_object_data_set(content, "main_page", item);
+
+              bt = elm_button_add(content);
+              elm_object_text_set(bt, _("Prev page"));
+              elm_object_part_content_set(content, "elm.swallow.prev_btn", bt);
+              evas_object_smart_callback_add(bt, "clicked", _prev_page_cb, 
content);
+
+              bt2 = elm_button_add(content);
+              elm_object_text_set(bt2, _("Next page"));
+              elm_object_part_content_set(content, "elm.swallow.next_btn", 
bt2);
+              evas_object_smart_callback_add(bt2, "clicked", _next_page_cb, 
content);
+              break;
           }
      }
    return content;
diff --git a/src/bin/ui/property_demo_swallow.c 
b/src/bin/ui/property_demo_swallow.c
index 1d54872..04fa87c 100644
--- a/src/bin/ui/property_demo_swallow.c
+++ b/src/bin/ui/property_demo_swallow.c
@@ -86,6 +86,7 @@ static const char *widget_type[] = { N_("button"),
                                      N_("grid"),
                                      N_("table"),
                                      N_("box"),
+                                     N_("naviframe"),
                                      N_("genlist"),
                                      N_("gengrid"),
                                      N_("scroller"),
diff --git a/src/bin/ui/workspace/demo_group.h 
b/src/bin/ui/workspace/demo_group.h
index 6e0fbfb..bbd77e5 100644
--- a/src/bin/ui/workspace/demo_group.h
+++ b/src/bin/ui/workspace/demo_group.h
@@ -69,6 +69,7 @@ typedef enum _Swallow_Content_Widget_Type
    WIDGET_GRID, /**< grid widget */
    WIDGET_TABLE, /**< table widget */
    WIDGET_BOX, /**< box widget */
+   WIDGET_NAVIFRAME, /**< box widget */
    WIDGET_GENLIST, /**<genlist widget */
    WIDGET_GENGRID, /**<gengrid widget */
    WIDGET_SCROLLER, /**<scroller widget */

-- 


Reply via email to