summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2012-03-19 07:27:49 +0000
committerDaniel Juyung Seo <seojuyung2@gmail.com>2012-03-19 07:27:49 +0000
commit5660f0227ca91a1b58bd01d622f910bc737f8864 (patch)
tree345c0715837297cc5f1a78ee06bc82ac2e62573e /src/bin
parent893d553d5db4ea49ba2671892800d6f5f8e9d37c (diff)
elm test_check: Revised codes.
SVN revision: 69504
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/test.c6
-rw-r--r--src/bin/test_check.c46
2 files changed, 20 insertions, 32 deletions
diff --git a/src/bin/test.c b/src/bin/test.c
index 699f6d47f..99f18da98 100644
--- a/src/bin/test.c
+++ b/src/bin/test.c
@@ -34,7 +34,7 @@ void test_clock(void *data, Evas_Object *obj, void *event_info);
34void test_clock2(void *data, Evas_Object *obj, void *event_info); 34void test_clock2(void *data, Evas_Object *obj, void *event_info);
35void test_clock3(void *data, Evas_Object *obj, void *event_info); 35void test_clock3(void *data, Evas_Object *obj, void *event_info);
36void test_check(void *data, Evas_Object *obj, void *event_info); 36void test_check(void *data, Evas_Object *obj, void *event_info);
37void test_check2(void *data, Evas_Object *obj, void *event_info); 37void test_check_toggle(void *data, Evas_Object *obj, void *event_info);
38void test_radio(void *data, Evas_Object *obj, void *event_info); 38void test_radio(void *data, Evas_Object *obj, void *event_info);
39void test_layout(void *data, Evas_Object *obj, void *event_info); 39void test_layout(void *data, Evas_Object *obj, void *event_info);
40void test_layout2(void *data, Evas_Object *obj, void *event_info); 40void test_layout2(void *data, Evas_Object *obj, void *event_info);
@@ -505,8 +505,8 @@ add_tests:
505 ADD_TEST(NULL, "Range Values", "Progressbar", test_progressbar); 505 ADD_TEST(NULL, "Range Values", "Progressbar", test_progressbar);
506 506
507 //------------------------------// 507 //------------------------------//
508 ADD_TEST(NULL, "Booleans", "Checks", test_check); 508 ADD_TEST(NULL, "Booleans", "Check", test_check);
509 ADD_TEST(NULL, "Booleans", "Checks 2", test_check2); 509 ADD_TEST(NULL, "Booleans", "Check Toggle", test_check_toggle);
510 510
511 //------------------------------// 511 //------------------------------//
512 ADD_TEST(NULL, "Popups", "Ctxpopup", test_ctxpopup); 512 ADD_TEST(NULL, "Popups", "Ctxpopup", test_ctxpopup);
diff --git a/src/bin/test_check.c b/src/bin/test_check.c
index 6760d5bd6..4f319276d 100644
--- a/src/bin/test_check.c
+++ b/src/bin/test_check.c
@@ -24,18 +24,12 @@ state_changed_cb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
24void 24void
25test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 25test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
26{ 26{
27 Evas_Object *win, *bg, *bx, *ic, *ck, *ck0; 27 Evas_Object *win, *bx, *ic, *ck, *ck0;
28 char buf[PATH_MAX]; 28 char buf[PATH_MAX];
29 29
30 win = elm_win_add(NULL, "checks", ELM_WIN_BASIC); 30 win = elm_win_util_standard_add("check", "Check");
31 elm_win_title_set(win, "Checks");
32 elm_win_autodel_set(win, EINA_TRUE); 31 elm_win_autodel_set(win, EINA_TRUE);
33 32
34 bg = elm_bg_add(win);
35 elm_win_resize_object_add(win, bg);
36 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
37 evas_object_show(bg);
38
39 bx = elm_box_add(win); 33 bx = elm_box_add(win);
40 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 34 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
41 elm_win_resize_object_add(win, bx); 35 elm_win_resize_object_add(win, bx);
@@ -50,7 +44,7 @@ test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
50 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5); 44 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
51 elm_object_text_set(ck, "Icon sized to check"); 45 elm_object_text_set(ck, "Icon sized to check");
52 elm_object_part_content_set(ck, "icon", ic); 46 elm_object_part_content_set(ck, "icon", ic);
53 elm_check_state_set(ck, 1); 47 elm_check_state_set(ck, EINA_TRUE);
54 elm_box_pack_end(bx, ck); 48 elm_box_pack_end(bx, ck);
55 evas_object_show(ck); 49 evas_object_show(ck);
56 evas_object_show(ic); 50 evas_object_show(ic);
@@ -60,9 +54,9 @@ test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
60 ic = elm_icon_add(win); 54 ic = elm_icon_add(win);
61 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); 55 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
62 elm_icon_file_set(ic, buf, NULL); 56 elm_icon_file_set(ic, buf, NULL);
63 elm_icon_resizable_set(ic, 0, 0); 57 elm_icon_resizable_set(ic, EINA_FALSE, EINA_FALSE);
64 ck = elm_check_add(win); 58 ck = elm_check_add(win);
65 elm_object_text_set(ck, "Icon no scale"); 59 elm_object_text_set(ck, "Icon not resizable");
66 elm_object_part_content_set(ck, "icon", ic); 60 elm_object_part_content_set(ck, "icon", ic);
67 elm_box_pack_end(bx, ck); 61 elm_box_pack_end(bx, ck);
68 evas_object_show(ck); 62 evas_object_show(ck);
@@ -76,13 +70,13 @@ test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
76 evas_object_show(ck); 70 evas_object_show(ck);
77 71
78 ck = elm_check_add(win); 72 ck = elm_check_add(win);
79 elm_object_text_set(ck, "Using State Pointer"); 73 elm_object_text_set(ck, "Use State Pointer");
80 elm_check_state_pointer_set(ck, &eb); 74 elm_check_state_pointer_set(ck, &eb);
81 elm_box_pack_end(bx, ck); 75 elm_box_pack_end(bx, ck);
82 evas_object_show(ck); 76 evas_object_show(ck);
83 77
84 ck = elm_check_add(win); 78 ck = elm_check_add(win);
85 elm_object_text_set(ck, "Check State Pointer Value"); 79 elm_object_text_set(ck, "Print State Pointer Value");
86 elm_box_pack_end(bx, ck); 80 elm_box_pack_end(bx, ck);
87 evas_object_show(ck); 81 evas_object_show(ck);
88 evas_object_smart_callback_add(ck, "changed", state_changed_cb, NULL); 82 evas_object_smart_callback_add(ck, "changed", state_changed_cb, NULL);
@@ -96,16 +90,16 @@ test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
96 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5); 90 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
97 elm_object_text_set(ck, "Disabled check"); 91 elm_object_text_set(ck, "Disabled check");
98 elm_object_part_content_set(ck, "icon", ic); 92 elm_object_part_content_set(ck, "icon", ic);
99 elm_check_state_set(ck, 1); 93 elm_check_state_set(ck, EINA_TRUE);
100 elm_box_pack_end(bx, ck); 94 elm_box_pack_end(bx, ck);
101 elm_object_disabled_set(ck, 1); 95 elm_object_disabled_set(ck, EINA_TRUE);
102 evas_object_show(ck); 96 evas_object_show(ck);
103 evas_object_show(ic); 97 evas_object_show(ic);
104 98
105 ic = elm_icon_add(win); 99 ic = elm_icon_add(win);
106 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); 100 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
107 elm_icon_file_set(ic, buf, NULL); 101 elm_icon_file_set(ic, buf, NULL);
108 elm_icon_resizable_set(ic, 0, 0); 102 elm_icon_resizable_set(ic, EINA_FALSE, EINA_FALSE);
109 ck = elm_check_add(win); 103 ck = elm_check_add(win);
110 elm_object_part_content_set(ck, "icon", ic); 104 elm_object_part_content_set(ck, "icon", ic);
111 elm_box_pack_end(bx, ck); 105 elm_box_pack_end(bx, ck);
@@ -116,20 +110,14 @@ test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
116} 110}
117 111
118void 112void
119test_check2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 113test_check_toggle(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
120{ 114{
121 Evas_Object *win, *bg, *bx, *ic, *tg; 115 Evas_Object *win, *bx, *ic, *tg;
122 char buf[PATH_MAX]; 116 char buf[PATH_MAX];
123 117
124 win = elm_win_add(NULL, "check2", ELM_WIN_BASIC); 118 win = elm_win_util_standard_add("check-toggle", "Check Toggle");
125 elm_win_title_set(win, "Checks 2");
126 elm_win_autodel_set(win, EINA_TRUE); 119 elm_win_autodel_set(win, EINA_TRUE);
127 120
128 bg = elm_bg_add(win);
129 elm_win_resize_object_add(win, bg);
130 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
131 evas_object_show(bg);
132
133 bx = elm_box_add(win); 121 bx = elm_box_add(win);
134 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 122 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
135 elm_win_resize_object_add(win, bx); 123 elm_win_resize_object_add(win, bx);
@@ -156,7 +144,7 @@ test_check2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
156 ic = elm_icon_add(win); 144 ic = elm_icon_add(win);
157 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); 145 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
158 elm_icon_file_set(ic, buf, NULL); 146 elm_icon_file_set(ic, buf, NULL);
159 elm_icon_resizable_set(ic, 0, 0); 147 elm_icon_resizable_set(ic, EINA_FALSE, EINA_FALSE);
160 148
161 tg = elm_check_add(win); 149 tg = elm_check_add(win);
162 elm_object_style_set(tg, "toggle"); 150 elm_object_style_set(tg, "toggle");
@@ -169,11 +157,11 @@ test_check2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
169 ic = elm_icon_add(win); 157 ic = elm_icon_add(win);
170 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); 158 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
171 elm_icon_file_set(ic, buf, NULL); 159 elm_icon_file_set(ic, buf, NULL);
172 elm_icon_resizable_set(ic, 0, 0); 160 elm_icon_resizable_set(ic, EINA_FALSE, EINA_FALSE);
173 161
174 tg = elm_check_add(win); 162 tg = elm_check_add(win);
175 elm_object_style_set(tg, "toggle"); 163 elm_object_style_set(tg, "toggle");
176 elm_object_text_set(tg, "Icon no scale"); 164 elm_object_text_set(tg, "Disabled toggle");
177 elm_object_part_content_set(tg, "icon", ic); 165 elm_object_part_content_set(tg, "icon", ic);
178 elm_object_disabled_set(tg, EINA_TRUE); 166 elm_object_disabled_set(tg, EINA_TRUE);
179 elm_box_pack_end(bx, tg); 167 elm_box_pack_end(bx, tg);
@@ -191,7 +179,7 @@ test_check2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
191 ic = elm_icon_add(win); 179 ic = elm_icon_add(win);
192 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); 180 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
193 elm_icon_file_set(ic, buf, NULL); 181 elm_icon_file_set(ic, buf, NULL);
194 elm_icon_resizable_set(ic, 0, 0); 182 elm_icon_resizable_set(ic, EINA_FALSE, EINA_FALSE);
195 183
196 tg = elm_check_add(win); 184 tg = elm_check_add(win);
197 elm_object_style_set(tg, "toggle"); 185 elm_object_style_set(tg, "toggle");