Merge branch 'intefl/svn_merge' of ssh://165.213.149.219:29418/slp/pkgs/e/elementary...
[framework/uifw/elementary.git] / src / bin / test_radio.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_radio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
8 {
9    Evas_Object *win, *bg, *bx, *ic, *rd, *rdg;
10    char buf[PATH_MAX];
11
12    win = elm_win_add(NULL, "radios", ELM_WIN_BASIC);
13    elm_win_title_set(win, "Radios");
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", elm_app_data_dir_get());
28    elm_icon_file_set(ic, buf, NULL);
29    evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
30
31    rd = elm_radio_add(win);
32    elm_radio_state_value_set(rd, 0);
33    evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
34    evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, 0.5);
35    elm_object_text_set(rd, "Icon sized to radio");
36    elm_object_part_content_set(rd, "icon", ic);
37    elm_box_pack_end(bx, rd);
38    evas_object_show(rd);
39    evas_object_show(ic);
40    rdg = rd;
41
42    ic = elm_icon_add(win);
43    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
44    elm_icon_file_set(ic, buf, NULL);
45 <<<<<<< HEAD
46    elm_icon_scale_set(ic, 0, 0);
47 =======
48    elm_icon_resizable_set(ic, 0, 0);
49 >>>>>>> remotes/origin/upstream
50
51    rd = elm_radio_add(win);
52    elm_radio_state_value_set(rd, 1);
53    elm_radio_group_add(rd, rdg);
54    elm_object_text_set(rd, "Icon no scale");
55    elm_object_part_content_set(rd, "icon", ic);
56    elm_box_pack_end(bx, rd);
57    evas_object_show(rd);
58    evas_object_show(ic);
59
60    rd = elm_radio_add(win);
61    elm_radio_state_value_set(rd, 2);
62    elm_radio_group_add(rd, rdg);
63    elm_object_text_set(rd, "Label Only");
64    elm_box_pack_end(bx, rd);
65    evas_object_show(rd);
66
67    rd = elm_radio_add(win);
68    elm_radio_state_value_set(rd, 3);
69    elm_radio_group_add(rd, rdg);
70    elm_object_text_set(rd, "Disabled");
71 <<<<<<< HEAD
72    elm_object_disabled_set(rd, 1);
73 =======
74    elm_object_disabled_set(rd, EINA_TRUE);
75 >>>>>>> remotes/origin/upstream
76    elm_box_pack_end(bx, rd);
77    evas_object_show(rd);
78
79    ic = elm_icon_add(win);
80    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
81    elm_icon_file_set(ic, buf, NULL);
82 <<<<<<< HEAD
83    elm_icon_scale_set(ic, 0, 0);
84 =======
85    elm_icon_resizable_set(ic, 0, 0);
86 >>>>>>> remotes/origin/upstream
87
88    rd = elm_radio_add(win);
89    elm_radio_state_value_set(rd, 4);
90    elm_radio_group_add(rd, rdg);
91    elm_object_part_content_set(rd, "icon", ic);
92    elm_box_pack_end(bx, rd);
93    evas_object_show(rd);
94    evas_object_show(ic);
95
96    ic = elm_icon_add(win);
97    snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
98    elm_icon_file_set(ic, buf, NULL);
99 <<<<<<< HEAD
100    elm_icon_scale_set(ic, 0, 0);
101 =======
102    elm_icon_resizable_set(ic, 0, 0);
103 >>>>>>> remotes/origin/upstream
104
105    rd = elm_radio_add(win);
106    elm_radio_state_value_set(rd, 5);
107    elm_radio_group_add(rd, rdg);
108    elm_object_part_content_set(rd, "icon", ic);
109 <<<<<<< HEAD
110    elm_object_disabled_set(rd, 1);
111 =======
112    elm_object_disabled_set(rd, EINA_TRUE);
113 >>>>>>> remotes/origin/upstream
114    elm_box_pack_end(bx, rd);
115    evas_object_show(rd);
116    evas_object_show(ic);
117
118    elm_radio_value_set(rdg, 2);
119
120    evas_object_show(win);
121 }
122 #endif