elementary: Updated test_bubble.c to do API testing
[framework/uifw/elementary.git] / src / bin / test_spinner.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_spinner(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
8 {
9    Evas_Object *win, *bg, *bx, *sp;
10
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);
14
15    bg = elm_bg_add(win);
16    elm_win_resize_object_add(win, bg);
17    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
18    evas_object_show(bg);
19
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);
23    evas_object_show(bx);
24
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, ELM_WRAP_CHAR);
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);
33    evas_object_show(sp);
34
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, ELM_WRAP_CHAR);
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);
43    evas_object_show(sp);
44
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, ELM_WRAP_CHAR);
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);
54    evas_object_show(sp);
55
56    sp = elm_spinner_add(win);
57    elm_spinner_label_format_set(sp, "Disabled %.0f");
58    elm_object_disabled_set(sp, EINA_TRUE);
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);
63    evas_object_show(sp);
64
65    sp = elm_spinner_add(win);
66    elm_spinner_wrap_set(sp, EINA_TRUE);
67    elm_spinner_min_max_set(sp, 1, 12);
68    elm_spinner_value_set(sp, 1);
69    elm_spinner_step_set(sp, 0.05);
70    elm_spinner_base_set(sp, 1);
71    elm_spinner_round_set(sp, 1);
72    elm_spinner_label_format_set(sp, "%.0f");
73    elm_spinner_editable_set(sp, EINA_FALSE);
74    elm_spinner_special_value_add(sp, 1, "January");
75    elm_spinner_special_value_add(sp, 2, "February");
76    elm_spinner_special_value_add(sp, 3, "March");
77    elm_spinner_special_value_add(sp, 4, "April");
78    elm_spinner_special_value_add(sp, 5, "May");
79    elm_spinner_special_value_add(sp, 6, "June");
80    elm_spinner_special_value_add(sp, 7, "July");
81    elm_spinner_special_value_add(sp, 8, "August");
82    elm_spinner_special_value_add(sp, 9, "September");
83    elm_spinner_special_value_add(sp, 10, "October");
84    elm_spinner_special_value_add(sp, 11, "November");
85    elm_spinner_special_value_add(sp, 12, "December");
86    evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
87    evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
88    elm_box_pack_end(bx, sp);
89    evas_object_show(sp);
90
91    evas_object_show(win);
92 }
93 #endif