forked from enlightenment/efl
Improve win dialog test to also include a test for standard_win
This commit is contained in:
parent
e3baf4d3c1
commit
9981b19303
|
@ -530,7 +530,7 @@ add_tests:
|
||||||
ADD_TEST(NULL, "Window / Background", "Window Socket", test_win_socket);
|
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 Plug", test_win_plug);
|
||||||
ADD_TEST(NULL, "Window / Background", "Window WM Rotation", test_win_wm_rotation);
|
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, "Window / Background", "Window Standard/Dialog", test_win_dialog);
|
||||||
|
|
||||||
//------------------------------//
|
//------------------------------//
|
||||||
ADD_TEST(NULL, "Images", "Icon", test_icon);
|
ADD_TEST(NULL, "Images", "Icon", test_icon);
|
||||||
|
|
|
@ -3,22 +3,46 @@
|
||||||
#endif
|
#endif
|
||||||
#include <Elementary.h>
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
test_win_dialog(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
_bt_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Evas_Object *win, *bt;
|
Evas_Object *dia, *lb;
|
||||||
Evas_Object *parent = data;
|
Evas_Object *parent = data;
|
||||||
|
|
||||||
win = elm_win_util_dialog_add(parent, "window-dia", "Dialog Window");
|
dia = elm_win_util_dialog_add(parent, "window-dia", "A Dialog Window");
|
||||||
|
elm_win_autodel_set(dia, EINA_TRUE);
|
||||||
|
|
||||||
|
lb = elm_label_add(dia);
|
||||||
|
elm_object_text_set(lb, "This is a Dialog Window");
|
||||||
|
evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_win_resize_object_add(dia, lb);
|
||||||
|
evas_object_show(lb);
|
||||||
|
|
||||||
|
evas_object_resize(dia, 200, 150);
|
||||||
|
evas_object_show(dia);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
test_win_dialog(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
|
{
|
||||||
|
Evas_Object *win, *box, *bt;
|
||||||
|
|
||||||
|
win = elm_win_util_standard_add("window-dia", "A Standard Window");
|
||||||
elm_win_autodel_set(win, EINA_TRUE);
|
elm_win_autodel_set(win, EINA_TRUE);
|
||||||
|
|
||||||
|
box = elm_box_add(win);
|
||||||
|
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_win_resize_object_add(win, box);
|
||||||
|
evas_object_show(box);
|
||||||
|
|
||||||
bt = elm_button_add(win);
|
bt = elm_button_add(win);
|
||||||
elm_object_text_set(bt, "This is a dialog window");
|
elm_object_text_set(bt, "Create a new dialog");
|
||||||
evas_object_size_hint_fill_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_smart_callback_add(bt, "clicked", _bt_clicked_cb, win);
|
||||||
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
elm_box_pack_end(box, bt);
|
||||||
elm_win_resize_object_add(win, bt);
|
|
||||||
evas_object_show(bt);
|
evas_object_show(bt);
|
||||||
|
|
||||||
evas_object_resize(win, 320, 160);
|
evas_object_resize(win, 400, 400);
|
||||||
evas_object_show(win);
|
evas_object_show(win);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue