davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=f3df1b4cc9ea68859d245d5bf3a9d3d0285f0d27

commit f3df1b4cc9ea68859d245d5bf3a9d3d0285f0d27
Author: Dave Andreoli <d...@gurumeditation.it>
Date:   Mon Aug 3 16:37:25 2015 +0200

    New 1.15 API: Scroller.wheel_disabled, with test
---
 efl/elementary/scroller.pxi          | 22 ++++++++++++++++++++++
 efl/elementary/scroller_cdef.pxi     |  3 +++
 examples/elementary/test_scroller.py |  8 ++++++++
 3 files changed, 33 insertions(+)

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)

-- 


Reply via email to