1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
7 test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
9 Evas_Object *win, *bg, *bx, *ic, *ck;
12 win = elm_win_add(NULL, "checks", ELM_WIN_BASIC);
13 elm_win_title_set(win, "Checks");
14 elm_win_autodel_set(win, EINA_TRUE);
17 elm_win_resize_object_add(win, bg);
18 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
21 bx = elm_box_add(win);
22 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
23 elm_win_resize_object_add(win, bx);
26 ic = elm_icon_add(win);
27 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
28 elm_icon_file_set(ic, buf, NULL);
29 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
30 ck = elm_check_add(win);
31 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
32 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
33 elm_object_text_set(ck, "Icon sized to check");
34 elm_object_content_set(ck, ic);
35 elm_check_state_set(ck, 1);
36 elm_box_pack_end(bx, ck);
40 ic = elm_icon_add(win);
41 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
42 elm_icon_file_set(ic, buf, NULL);
43 elm_icon_scale_set(ic, 0, 0);
44 ck = elm_check_add(win);
45 elm_object_text_set(ck, "Icon no scale");
46 elm_object_content_set(ck, ic);
47 elm_box_pack_end(bx, ck);
51 ck = elm_check_add(win);
52 elm_object_text_set(ck, "Label Only");
53 elm_box_pack_end(bx, ck);
56 ic = elm_icon_add(win);
57 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
58 elm_icon_file_set(ic, buf, NULL);
59 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
60 ck = elm_check_add(win);
61 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
62 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
63 elm_object_text_set(ck, "Disabled check");
64 elm_object_content_set(ck, ic);
65 elm_check_state_set(ck, 1);
66 elm_box_pack_end(bx, ck);
67 elm_object_disabled_set(ck, 1);
71 ic = elm_icon_add(win);
72 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
73 elm_icon_file_set(ic, buf, NULL);
74 elm_icon_scale_set(ic, 0, 0);
75 ck = elm_check_add(win);
76 elm_object_content_set(ck, ic);
77 elm_box_pack_end(bx, ck);
81 evas_object_show(win);