summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-25 17:11:02 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-25 17:11:02 +0900
commitc80b90a5975293bd85a036ec7187a331a05c19dc (patch)
treec53affee881dc9e5e6107150e32c5b5dad730d44 /src/bin
parentd6729ff894d2317fd322d0dceb3ffb287b16d48f (diff)
elm test - add dialog window test
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/Makefile.am1
-rw-r--r--src/bin/test.c4
-rw-r--r--src/bin/test_win_dialog.c29
3 files changed, 33 insertions, 1 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 50e79ef64..f4f6e4600 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -136,6 +136,7 @@ test_win_socket.c \
136test_win_plug.c \ 136test_win_plug.c \
137test_win_state.c \ 137test_win_state.c \
138test_win_wm_rotation.c \ 138test_win_wm_rotation.c \
139test_win_dialog.c \
139test.h 140test.h
140 141
141elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la \ 142elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la \
diff --git a/src/bin/test.c b/src/bin/test.c
index 11045a19f..72c80ef20 100644
--- a/src/bin/test.c
+++ b/src/bin/test.c
@@ -246,6 +246,7 @@ void test_dnd_types(void *data, Evas_Object *obj, void *event_info);
246void test_task_switcher(void *data, Evas_Object *obj, void *event_info); 246void test_task_switcher(void *data, Evas_Object *obj, void *event_info);
247void test_application_server_message(void *data, Evas_Object *obj, void *event_info); 247void test_application_server_message(void *data, Evas_Object *obj, void *event_info);
248void test_application_server_phone(void *data, Evas_Object *obj, void *event_info); 248void test_application_server_phone(void *data, Evas_Object *obj, void *event_info);
249void test_win_dialog(void *data, Evas_Object *obj, void *event_info);
249 250
250Evas_Object *win, *tbx; // TODO: refactoring 251Evas_Object *win, *tbx; // TODO: refactoring
251void *tt; 252void *tt;
@@ -344,7 +345,7 @@ _menu_create(const char *option_str)
344 } 345 }
345 elm_box_pack_end(tbx2, bt); 346 elm_box_pack_end(tbx2, bt);
346 evas_object_show(bt); 347 evas_object_show(bt);
347 evas_object_smart_callback_add(bt, "clicked", t->cb, NULL); 348 evas_object_smart_callback_add(bt, "clicked", t->cb, win);
348 pcat = t->category; 349 pcat = t->category;
349 if (t == tt) tt = cfr; 350 if (t == tt) tt = cfr;
350 } 351 }
@@ -524,6 +525,7 @@ add_tests:
524 ADD_TEST(NULL, "Window / Background", "Window Socket", test_win_socket); 525 ADD_TEST(NULL, "Window / Background", "Window Socket", test_win_socket);
525 ADD_TEST(NULL, "Window / Background", "Window Plug", test_win_plug); 526 ADD_TEST(NULL, "Window / Background", "Window Plug", test_win_plug);
526 ADD_TEST(NULL, "Window / Background", "Window WM Rotation", test_win_wm_rotation); 527 ADD_TEST(NULL, "Window / Background", "Window WM Rotation", test_win_wm_rotation);
528 ADD_TEST(NULL, "Window / Background", "Window Dialog", test_win_dialog);
527 529
528 //------------------------------// 530 //------------------------------//
529 ADD_TEST(NULL, "Images", "Icon", test_icon); 531 ADD_TEST(NULL, "Images", "Icon", test_icon);
diff --git a/src/bin/test_win_dialog.c b/src/bin/test_win_dialog.c
new file mode 100644
index 000000000..1eb78e346
--- /dev/null
+++ b/src/bin/test_win_dialog.c
@@ -0,0 +1,29 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4#include <Elementary.h>
5
6void
7test_win_dialog(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
8{
9 Evas_Object *win, *bg, *bt;
10
11 win = elm_win_add(data, "window-dialog", ELM_WIN_DIALOG_BASIC);
12 elm_win_title_set(win, "Window Dialog");
13 elm_win_autodel_set(win, EINA_TRUE);
14
15 bg = elm_bg_add(win);
16 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
17 elm_win_resize_object_add(win, bg);
18 evas_object_show(bg);
19
20 bt = elm_button_add(win);
21 elm_object_text_set(bt, "OK");
22 evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
23 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
24 elm_win_resize_object_add(win, bt);
25 evas_object_show(bt);
26
27 evas_object_resize(win, 320, 160);
28 evas_object_show(win);
29}