elm test: Refactoring. Changed 1 to EINA_TRUE for Eina_Bool parameter of elm_win_auto...
[framework/uifw/elementary.git] / src / bin / test_check.c
1 #include <Elementary.h>
2 #ifdef HAVE_CONFIG_H
3 # include "elementary_config.h"
4 #endif
5 #ifndef ELM_LIB_QUICKLAUNCH
6 void
7 test_check(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
8 {
9    Evas_Object *win, *bg, *bx, *ic, *ck;
10    char buf[PATH_MAX];
11
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);
15
16    bg = elm_bg_add(win);
17    elm_win_resize_object_add(win, bg);
18    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
19    evas_object_show(bg);
20
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);
24    evas_object_show(bx);
25
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_check_icon_set(ck, ic);
35    elm_check_state_set(ck, 1);
36    elm_box_pack_end(bx, ck);
37    evas_object_show(ck);
38    evas_object_show(ic);
39
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_check_icon_set(ck, ic);
47    elm_box_pack_end(bx, ck);
48    evas_object_show(ck);
49    evas_object_show(ic);
50
51    ck = elm_check_add(win);
52    elm_object_text_set(ck, "Label Only");
53    elm_box_pack_end(bx, ck);
54    evas_object_show(ck);
55
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_check_icon_set(ck, ic);
65    elm_check_state_set(ck, 1);
66    elm_box_pack_end(bx, ck);
67    elm_object_disabled_set(ck, 1);
68    evas_object_show(ck);
69    evas_object_show(ic);
70
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_check_icon_set(ck, ic);
77    elm_box_pack_end(bx, ck);
78    evas_object_show(ck);
79    evas_object_show(ic);
80
81    evas_object_show(win);
82 }
83 #endif