1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
8 _navi_pop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
10 elm_naviframe_item_pop(data);
14 _title_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
16 printf("Title Clicked!\n");
20 _title_visible(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
22 elm_naviframe_item_title_visible_set(data,
23 !elm_naviframe_item_title_visible_get(data));
27 _page4(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
29 Evas_Object *bt, *bt2, *ic, *nf = data;
33 bt = elm_button_add(nf);
34 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
36 ic = elm_icon_add(nf);
37 snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png", elm_app_data_dir_get());
38 elm_icon_file_set(ic, buf, NULL);
39 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
41 bt = elm_button_add(nf);
42 evas_object_smart_callback_add(bt, "clicked", _page5, nf);
43 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
44 elm_object_content_part_set(bt, "icon", ic);
46 bt2 = elm_button_add(nf);
47 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
48 elm_object_text_set(bt2, "Naviframe Test");
50 ic = elm_icon_add(nf);
51 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
52 elm_icon_file_set(ic, buf, NULL);
53 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
55 it = elm_naviframe_item_push(nf,
61 ic = elm_icon_add(nf);
62 snprintf(buf, sizeof(buf), "%s/images/logo_small.png",
63 elm_app_data_dir_get());
64 elm_icon_file_set(ic, buf, NULL);
65 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
66 elm_object_item_content_part_set(it, "icon", ic);
67 elm_naviframe_item_title_visible_set(it, EINA_FALSE);
68 evas_object_smart_callback_add(bt2, "clicked", _title_visible, it);
72 _page3(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
74 Evas_Object *bt, *bt2, *bt3, *ic, *nf = data;
78 bt = elm_button_add(nf);
79 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
80 elm_object_text_set(bt, "Prev");
81 evas_object_smart_callback_add(bt, "clicked", _navi_pop, nf);
83 bt2 = elm_button_add(nf);
84 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
85 elm_object_text_set(bt2, "Next");
86 evas_object_smart_callback_add(bt2, "clicked", _page4, nf);
88 bt3 = elm_button_add(nf);
89 evas_object_size_hint_align_set(bt3, EVAS_HINT_FILL, EVAS_HINT_FILL);
90 elm_object_text_set(bt3, "Naviframe Test");
92 ic = elm_icon_add(nf);
93 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
94 elm_icon_file_set(ic, buf, NULL);
95 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
97 elm_object_item_content_part_set(it, "icon", ic);
101 _page2(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
103 Evas_Object *bt, *bt2, *ic, *nf = data;
107 bt = elm_button_add(nf);
108 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
109 evas_object_smart_callback_add(bt, "clicked", _page3, nf);
111 bt2 = elm_button_add(nf);
112 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
113 elm_object_text_set(bt2, "Naviframe Test");
115 ic = elm_icon_add(nf);
116 snprintf(buf, sizeof(buf), "%s/images/icon_right_arrow.png", elm_app_data_dir_get());
117 elm_icon_file_set(ic, buf, NULL);
118 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
119 elm_object_content_part_set(bt, "icon", ic);
121 content = _content_new(nf, img2);
123 it = elm_naviframe_item_push(nf, "Page 2", NULL, bt, content, NULL);
124 elm_object_item_text_part_set(it, "subtitle", "Here is sub-title part!");
128 test_naviframe(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
130 Evas_Object *win, *bg, *nf, *btn;
132 win = elm_win_add(NULL, "naviframe", ELM_WIN_BASIC);
133 elm_win_title_set(win, "Naviframe");
134 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
135 elm_win_autodel_set(win, EINA_TRUE);
137 bg = elm_bg_add(win);
138 elm_win_resize_object_add(win, bg);
139 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
140 evas_object_show(bg);
142 nf = elm_naviframe_add(win);
143 elm_win_resize_object_add(win, nf);
144 evas_object_show(nf);
145 evas_object_smart_callback_add(nf, "title,clicked", _title_clicked, 0);
147 btn = elm_button_add(nf);
148 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
149 evas_object_smart_callback_add(btn, "clicked", _page2, nf);
150 elm_object_text_set(btn, "Naviframe Test");
151 evas_object_show(btn);
153 elm_naviframe_item_push(nf,
160 evas_object_resize(win, 400, 600);
161 evas_object_show(win);