summaryrefslogtreecommitdiff
path: root/examples/elementary/test_spinner.py
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2013-10-03 07:15:05 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2013-10-03 07:41:46 +0300
commit0004c58c9bb69aa30f27376b2ad07e86b653502d (patch)
treec3d5878fb9ff5cbd73aea437ec9549b39c119dfa /examples/elementary/test_spinner.py
parent9413b157b960d1023ccb91f31764f0dd92e0265f (diff)
Elementary: Fix tests config and spinner
Diffstat (limited to 'examples/elementary/test_spinner.py')
-rw-r--r--examples/elementary/test_spinner.py82
1 files changed, 63 insertions, 19 deletions
diff --git a/examples/elementary/test_spinner.py b/examples/elementary/test_spinner.py
index 2e8379b..323227d 100644
--- a/examples/elementary/test_spinner.py
+++ b/examples/elementary/test_spinner.py
@@ -27,37 +27,81 @@ def spinner_clicked(obj):
27 bx.show() 27 bx.show()
28 28
29 sp = Spinner(win) 29 sp = Spinner(win)
30 sp.label_format_set("%1.1f units") 30 sp.editable = True
31 sp.step_set(1.3) 31 sp.label_format = "%1.1f units"
32 sp.wrap_set(1) 32 sp.step = 1.3
33 sp.min_max_set(-50.0, 250.0) 33 sp.wrap = True
34 sp.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5) 34 sp.min_max = -50.0, 250.0
35 sp.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 35 sp.size_hint_align = evas.EVAS_HINT_FILL, 0.5
36 sp.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
36 bx.pack_end(sp) 37 bx.pack_end(sp)
37 sp.show() 38 sp.show()
38 39
39 sp = Spinner(win) 40 sp = Spinner(win)
40 sp.label_format_set("%1.1f units") 41 sp.label_format = "Base 5.5, Round 2 : %1.1f"
41 sp.step_set(1.3) 42 sp.min_max = -100.0, 100.0
42 sp.wrap_set(1) 43 sp.round = 2
43 sp.style_set("vertical"); 44 sp.base = 5.5
44 sp.min_max_set(-50.0, 250.0) 45 sp.value = 5.5
45 sp.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5) 46 sp.size_hint_align = evas.EVAS_HINT_FILL, 0.5
46 sp.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 47 sp.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
47 bx.pack_end(sp) 48 bx.pack_end(sp)
48 sp.show() 49 sp.show()
49 50
50 sp = Spinner(win) 51 sp = Spinner(win)
51 sp.label_format_set("Disabled %.0f") 52 sp.label_format = "Percentage %%%1.2f something"
52 sp.disabled_set(1) 53 sp.step = 5.0
53 sp.min_max_set(-50.0, 250.0) 54 sp.min_max = 0.0, 100.0
54 sp.size_hint_align_set(evas.EVAS_HINT_FILL, 0.5) 55 sp.size_hint_align = evas.EVAS_HINT_FILL, 0.5
55 sp.size_hint_weight_set(evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND) 56 sp.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
56 bx.pack_end(sp) 57 bx.pack_end(sp)
57 sp.show() 58 sp.show()
58 59
59 win.show() 60 sp = Spinner(win)
61 sp.label_format = "%1.1f units"
62 sp.step = 1.3
63 sp.wrap = True
64 sp.style = "vertical"
65 sp.min_max = -50.0, 250.0
66 sp.size_hint_align = evas.EVAS_HINT_FILL, 0.5
67 sp.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
68 bx.pack_end(sp)
69 sp.show()
60 70
71 sp = Spinner(win)
72 sp.label_format = "Disabled %.0f"
73 sp.disabled = True
74 sp.min_max = -50.0, 250.0
75 sp.size_hint_align = evas.EVAS_HINT_FILL, 0.5
76 sp.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
77 bx.pack_end(sp)
78 sp.show()
79
80 sp = Spinner(win)
81 sp.wrap = True
82 sp.min_max = 1, 12
83 sp.value = 1
84 sp.label_format = "%.0f"
85 sp.editable = False
86 sp.special_value_add(1, "January")
87 sp.special_value_add(2, "February")
88 sp.special_value_add(3, "March")
89 sp.special_value_add(4, "April")
90 sp.special_value_add(5, "May")
91 sp.special_value_add(6, "June")
92 sp.special_value_add(7, "July")
93 sp.special_value_add(8, "August")
94 sp.special_value_add(9, "September")
95 sp.special_value_add(10, "October")
96 sp.special_value_add(11, "November")
97 sp.special_value_add(12, "December")
98 sp.size_hint_align = evas.EVAS_HINT_FILL, 0.5
99 sp.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
100 bx.pack_end(sp)
101 sp.show()
102
103 win.resize(300, 300)
104 win.show()
61 105
62if __name__ == "__main__": 106if __name__ == "__main__":
63 elementary.init() 107 elementary.init()