aboutsummaryrefslogtreecommitdiffstats
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
parentNew 1.15 signal for Entry: context,open (diff)
downloadpython-efl-f3df1b4cc9ea68859d245d5bf3a9d3d0285f0d27.tar.gz
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):
def propagate_events_get(self):
return bool(elm_scroller_propagate_events_get(self.obj))
+ property wheel_disabled:
+ """Enable or disable mouse wheel to be used to scroll the scroller.
+
+ Mouse wheel can be used to scroll up and down the scroller.
+ Wheel is enabled by default.
+
+ :type: bool
+
+ .. versionadded:: 1.15
+
+ """
+ def __get__(self):
+ return bool(elm_scroller_wheel_disabled_get(self.obj))
+
+ def __set__(self, disabled):
+ elm_scroller_wheel_disabled_set(self.obj, disabled)
+
+ def wheel_disabled_set(self, disabled):
+ elm_scroller_wheel_disabled_set(self.obj, disabled)
+ def wheel_disabled_get(self):
+ return bool(elm_scroller_wheel_disabled_get(self.obj))
+
property gravity:
"""Scrolling gravity on a scroller
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":
Elm_Scroller_Movement_Block elm_scroller_movement_block_get(const Evas_Object *obj)
void elm_scroller_loop_set(Evas_Object *obj, Eina_Bool loop_h, Eina_Bool loop_v)
void elm_scroller_loop_get(const Evas_Object *obj, Eina_Bool *loop_h, Eina_Bool *loop_v)
+ void elm_scroller_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled)
+ Eina_Bool elm_scroller_wheel_disabled_get(const Evas_Object *obj)
+
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):
h, v = scroller.loop
scroller.loop = h, chk.state
+def cb_wheel_disabled(chk, scroller):
+ scroller.wheel_disabled = chk.state
+
def scroller_clicked(obj):
win = StandardWindow("scroller", "Scroller", autodel=True, size=(320, 320))
@@ -155,6 +158,11 @@ def scroller_clicked(obj):
box.pack_end(ck)
ck.show()
+ ck = Check(box, text="Wheel disabled")
+ ck.callback_changed_add(cb_wheel_disabled, sc)
+ box.pack_end(ck)
+ ck.show()
+
bt = Button(win, text="to 300 300", size_hint_expand=EXPAND_BOTH,
size_hint_align=(0.1, 0.1))
bt.callback_clicked_add(my_scroller_go_300_300, sc)