elm test - add dialog window test

This commit is contained in:
Carsten Haitzler 2014-08-25 17:11:02 +09:00
parent 73bb594b38
commit 2f66f5a581
3 changed files with 33 additions and 1 deletions

View File

@ -136,6 +136,7 @@ test_win_socket.c \
test_win_plug.c \
test_win_state.c \
test_win_wm_rotation.c \
test_win_dialog.c \
test.h
elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la \

View File

@ -246,6 +246,7 @@ void test_dnd_types(void *data, Evas_Object *obj, void *event_info);
void test_task_switcher(void *data, Evas_Object *obj, void *event_info);
void test_application_server_message(void *data, Evas_Object *obj, void *event_info);
void test_application_server_phone(void *data, Evas_Object *obj, void *event_info);
void test_win_dialog(void *data, Evas_Object *obj, void *event_info);
Evas_Object *win, *tbx; // TODO: refactoring
void *tt;
@ -344,7 +345,7 @@ _menu_create(const char *option_str)
}
elm_box_pack_end(tbx2, bt);
evas_object_show(bt);
evas_object_smart_callback_add(bt, "clicked", t->cb, NULL);
evas_object_smart_callback_add(bt, "clicked", t->cb, win);
pcat = t->category;
if (t == tt) tt = cfr;
}
@ -524,6 +525,7 @@ add_tests:
ADD_TEST(NULL, "Window / Background", "Window Socket", test_win_socket);
ADD_TEST(NULL, "Window / Background", "Window Plug", test_win_plug);
ADD_TEST(NULL, "Window / Background", "Window WM Rotation", test_win_wm_rotation);
ADD_TEST(NULL, "Window / Background", "Window Dialog", test_win_dialog);
//------------------------------//
ADD_TEST(NULL, "Images", "Icon", test_icon);

View File

@ -0,0 +1,29 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#include <Elementary.h>
void
test_win_dialog(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *win, *bg, *bt;
win = elm_win_add(data, "window-dialog", ELM_WIN_DIALOG_BASIC);
elm_win_title_set(win, "Window Dialog");
elm_win_autodel_set(win, EINA_TRUE);
bg = elm_bg_add(win);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
bt = elm_button_add(win);
elm_object_text_set(bt, "OK");
evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bt);
evas_object_show(bt);
evas_object_resize(win, 320, 160);
evas_object_show(win);
}