1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
7 test_spinner(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
9 Evas_Object *win, *bg, *bx, *sp;
11 win = elm_win_add(NULL, "spinner", ELM_WIN_BASIC);
12 elm_win_title_set(win, "Spinner");
13 elm_win_autodel_set(win, EINA_TRUE);
16 elm_win_resize_object_add(win, bg);
17 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
20 bx = elm_box_add(win);
21 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
22 elm_win_resize_object_add(win, bx);
25 sp = elm_spinner_add(win);
26 elm_spinner_label_format_set(sp, "%1.1f units");
27 elm_spinner_step_set(sp, 1.3);
28 elm_spinner_wrap_set(sp, 1);
29 elm_spinner_min_max_set(sp, -50.0, 250.0);
30 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
31 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
32 elm_box_pack_end(bx, sp);
35 sp = elm_spinner_add(win);
36 elm_spinner_label_format_set(sp, "Percentage %%%1.2f something");
37 elm_spinner_step_set(sp, 5.0);
38 elm_spinner_wrap_set(sp, 1);
39 elm_spinner_min_max_set(sp, 0.0, 100.0);
40 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
41 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
42 elm_box_pack_end(bx, sp);
45 sp = elm_spinner_add(win);
46 elm_spinner_label_format_set(sp, "%1.1f units");
47 elm_spinner_step_set(sp, 1.3);
48 elm_spinner_wrap_set(sp, 1);
49 elm_object_style_set (sp, "vertical");
50 elm_spinner_min_max_set(sp, -50.0, 250.0);
51 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
52 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
53 elm_box_pack_end(bx, sp);
56 sp = elm_spinner_add(win);
57 elm_spinner_label_format_set(sp, "Disabled %.0f");
58 elm_object_disabled_set(sp, 1);
59 elm_spinner_min_max_set(sp, -50.0, 250.0);
60 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
61 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
62 elm_box_pack_end(bx, sp);
65 sp = elm_spinner_add(win);
66 elm_spinner_min_max_set(sp, 1, 12);
67 elm_spinner_label_format_set(sp, "%.0f");
68 elm_spinner_step_set(sp, 1.0);
69 elm_spinner_editable_set(sp, EINA_FALSE);
70 elm_spinner_special_value_add(sp, 1, "January");
71 elm_spinner_special_value_add(sp, 2, "February");
72 elm_spinner_special_value_add(sp, 3, "March");
73 elm_spinner_special_value_add(sp, 4, "April");
74 elm_spinner_special_value_add(sp, 5, "May");
75 elm_spinner_special_value_add(sp, 6, "June");
76 elm_spinner_special_value_add(sp, 7, "July");
77 elm_spinner_special_value_add(sp, 8, "August");
78 elm_spinner_special_value_add(sp, 9, "September");
79 elm_spinner_special_value_add(sp, 10, "October");
80 elm_spinner_special_value_add(sp, 11, "November");
81 elm_spinner_special_value_add(sp, 12, "December");
82 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
83 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
84 elm_box_pack_end(bx, sp);
87 evas_object_show(win);