2 # include "elementary_config.h"
4 #include <Elementary.h>
5 #ifndef ELM_LIB_QUICKLAUNCH
7 test_radio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
9 Evas_Object *win, *bx, *ic, *rd, *rdg;
12 win = elm_win_util_standard_add("radios", "Radios");
13 elm_win_autodel_set(win, EINA_TRUE);
15 bx = elm_box_add(win);
16 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
17 elm_win_resize_object_add(win, bx);
20 ic = elm_icon_add(win);
21 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
22 elm_icon_file_set(ic, buf, NULL);
23 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
25 rd = elm_radio_add(win);
26 elm_radio_state_value_set(rd, 0);
27 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
28 evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, 0.5);
29 elm_object_text_set(rd, "Icon sized to radio");
30 elm_object_part_content_set(rd, "icon", ic);
31 elm_box_pack_end(bx, rd);
36 ic = elm_icon_add(win);
37 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
38 elm_icon_file_set(ic, buf, NULL);
39 elm_icon_resizable_set(ic, 0, 0);
41 rd = elm_radio_add(win);
42 elm_radio_state_value_set(rd, 1);
43 elm_radio_group_add(rd, rdg);
44 elm_object_text_set(rd, "Icon no scale");
45 elm_object_part_content_set(rd, "icon", ic);
46 elm_box_pack_end(bx, rd);
50 rd = elm_radio_add(win);
51 elm_radio_state_value_set(rd, 2);
52 elm_radio_group_add(rd, rdg);
53 elm_object_text_set(rd, "Label Only");
54 elm_box_pack_end(bx, rd);
57 rd = elm_radio_add(win);
58 elm_radio_state_value_set(rd, 3);
59 elm_radio_group_add(rd, rdg);
60 elm_object_text_set(rd, "Disabled");
61 elm_object_disabled_set(rd, EINA_TRUE);
62 elm_box_pack_end(bx, rd);
65 ic = elm_icon_add(win);
66 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
67 elm_icon_file_set(ic, buf, NULL);
68 elm_icon_resizable_set(ic, 0, 0);
70 rd = elm_radio_add(win);
71 elm_radio_state_value_set(rd, 4);
72 elm_radio_group_add(rd, rdg);
73 elm_object_part_content_set(rd, "icon", ic);
74 elm_box_pack_end(bx, rd);
78 ic = elm_icon_add(win);
79 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
80 elm_icon_file_set(ic, buf, NULL);
81 elm_icon_resizable_set(ic, 0, 0);
83 rd = elm_radio_add(win);
84 elm_radio_state_value_set(rd, 5);
85 elm_radio_group_add(rd, rdg);
86 elm_object_part_content_set(rd, "icon", ic);
87 elm_object_disabled_set(rd, EINA_TRUE);
88 elm_box_pack_end(bx, rd);
92 elm_radio_value_set(rdg, 2);
94 evas_object_show(win);