summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-08-03 16:37:25 +0200
committerDave Andreoli <dave@gurumeditation.it>2015-08-03 16:37:25 +0200
commitf3df1b4cc9ea68859d245d5bf3a9d3d0285f0d27 (patch)
tree8fa0b7551913b324fd5c3fc31f638c8060fb4d5d
parent7f5c30c7fd5844924e564e5d586c87f4a4658dbd (diff)
New 1.15 API: Scroller.wheel_disabled, with test
-rw-r--r--efl/elementary/scroller.pxi22
-rw-r--r--efl/elementary/scroller_cdef.pxi3
-rw-r--r--examples/elementary/test_scroller.py8
3 files changed, 33 insertions, 0 deletions
diff --git a/efl/elementary/scroller.pxi b/efl/elementary/scroller.pxi
index 887a722..e15d8aa 100644
--- a/efl/elementary/scroller.pxi
+++ b/efl/elementary/scroller.pxi
@@ -495,6 +495,28 @@ cdef class Scrollable(Object):
495 def propagate_events_get(self): 495 def propagate_events_get(self):
496 return bool(elm_scroller_propagate_events_get(self.obj)) 496 return bool(elm_scroller_propagate_events_get(self.obj))
497 497
498 property wheel_disabled:
499 """Enable or disable mouse wheel to be used to scroll the scroller.
500
501 Mouse wheel can be used to scroll up and down the scroller.
502 Wheel is enabled by default.
503
504 :type: bool
505
506 .. versionadded:: 1.15
507
508 """
509 def __get__(self):
510 return bool(elm_scroller_wheel_disabled_get(self.obj))
511
512 def __set__(self, disabled):
513 elm_scroller_wheel_disabled_set(self.obj, disabled)
514
515 def wheel_disabled_set(self, disabled):
516 elm_scroller_wheel_disabled_set(self.obj, disabled)
517 def wheel_disabled_get(self):
518 return bool(elm_scroller_wheel_disabled_get(self.obj))
519
498 property gravity: 520 property gravity:
499 """Scrolling gravity on a scroller 521 """Scrolling gravity on a scroller
500 522
diff --git a/efl/elementary/scroller_cdef.pxi b/efl/elementary/scroller_cdef.pxi
index 6be91e2..ca70051 100644
--- a/efl/elementary/scroller_cdef.pxi
+++ b/efl/elementary/scroller_cdef.pxi
@@ -58,3 +58,6 @@ cdef extern from "Elementary.h":
58 Elm_Scroller_Movement_Block elm_scroller_movement_block_get(const Evas_Object *obj) 58 Elm_Scroller_Movement_Block elm_scroller_movement_block_get(const Evas_Object *obj)
59 void elm_scroller_loop_set(Evas_Object *obj, Eina_Bool loop_h, Eina_Bool loop_v) 59 void elm_scroller_loop_set(Evas_Object *obj, Eina_Bool loop_h, Eina_Bool loop_v)
60 void elm_scroller_loop_get(const Evas_Object *obj, Eina_Bool *loop_h, Eina_Bool *loop_v) 60 void elm_scroller_loop_get(const Evas_Object *obj, Eina_Bool *loop_h, Eina_Bool *loop_v)
61 void elm_scroller_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled)
62 Eina_Bool elm_scroller_wheel_disabled_get(const Evas_Object *obj)
63
diff --git a/examples/elementary/test_scroller.py b/examples/elementary/test_scroller.py
index 6178a79..2c3aab8 100644
--- a/examples/elementary/test_scroller.py
+++ b/examples/elementary/test_scroller.py
@@ -70,6 +70,9 @@ def cb_loop_v(chk, scroller):
70 h, v = scroller.loop 70 h, v = scroller.loop
71 scroller.loop = h, chk.state 71 scroller.loop = h, chk.state
72 72
73def cb_wheel_disabled(chk, scroller):
74 scroller.wheel_disabled = chk.state
75
73 76
74def scroller_clicked(obj): 77def scroller_clicked(obj):
75 win = StandardWindow("scroller", "Scroller", autodel=True, size=(320, 320)) 78 win = StandardWindow("scroller", "Scroller", autodel=True, size=(320, 320))
@@ -155,6 +158,11 @@ def scroller_clicked(obj):
155 box.pack_end(ck) 158 box.pack_end(ck)
156 ck.show() 159 ck.show()
157 160
161 ck = Check(box, text="Wheel disabled")
162 ck.callback_changed_add(cb_wheel_disabled, sc)
163 box.pack_end(ck)
164 ck.show()
165
158 bt = Button(win, text="to 300 300", size_hint_expand=EXPAND_BOTH, 166 bt = Button(win, text="to 300 300", size_hint_expand=EXPAND_BOTH,
159 size_hint_align=(0.1, 0.1)) 167 size_hint_align=(0.1, 0.1))
160 bt.callback_clicked_add(my_scroller_go_300_300, sc) 168 bt.callback_clicked_add(my_scroller_go_300_300, sc)