1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
7 test_radio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
9 Evas_Object *win, *bg, *bx, *ic, *rd, *rdg;
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);
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", 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);
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);
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);
46 elm_icon_scale_set(ic, 0, 0);
48 elm_icon_resizable_set(ic, 0, 0);
49 >>>>>>> remotes/origin/upstream
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);
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);
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");
72 elm_object_disabled_set(rd, 1);
74 elm_object_disabled_set(rd, EINA_TRUE);
75 >>>>>>> remotes/origin/upstream
76 elm_box_pack_end(bx, rd);
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);
83 elm_icon_scale_set(ic, 0, 0);
85 elm_icon_resizable_set(ic, 0, 0);
86 >>>>>>> remotes/origin/upstream
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);
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);
100 elm_icon_scale_set(ic, 0, 0);
102 elm_icon_resizable_set(ic, 0, 0);
103 >>>>>>> remotes/origin/upstream
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);
110 elm_object_disabled_set(rd, 1);
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);
118 elm_radio_value_set(rdg, 2);
120 evas_object_show(win);