davemds pushed a commit to branch master.

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

commit 4e57019e1ea1c5227859435b210a00d8d1824665
Author: Dave Andreoli <[email protected]>
Date:   Tue Aug 9 21:10:16 2016 +0200

    New 1.18 API: elm.Entry.select_allow
    
    with test
---
 efl/elementary/entry.pxi          | 18 ++++++++++++++++++
 efl/elementary/entry_cdef.pxi     |  2 ++
 examples/elementary/test_entry.py |  8 ++++++--
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/efl/elementary/entry.pxi b/efl/elementary/entry.pxi
index 628b89c..8cc0678 100644
--- a/efl/elementary/entry.pxi
+++ b/efl/elementary/entry.pxi
@@ -687,6 +687,24 @@ cdef class Entry(LayoutClass):
         elm_entry_select_region_get(self.obj, &start, &end)
         return (start, end)
 
+    property select_allow:
+        """Whether selection in the entry is allowed.
+
+        :type: bool
+
+        .. versionadded:: 1.18
+
+        """
+        def __get__(self):
+            return bool(elm_entry_select_allow_get(self.obj))
+        def __set__(self, bint allow):
+            elm_entry_select_allow_set(self.obj, allow)
+
+    def select_allow_set(self, bint allow):
+        elm_entry_select_allow_set(self.obj, allow)
+    def select_allow_get(self):
+        return bool(elm_entry_select_allow_get(self.obj))
+
     def cursor_next(self):
         """This moves the cursor one place to the right within the entry.
 
diff --git a/efl/elementary/entry_cdef.pxi b/efl/elementary/entry_cdef.pxi
index 66d7f38..15e550a 100644
--- a/efl/elementary/entry_cdef.pxi
+++ b/efl/elementary/entry_cdef.pxi
@@ -170,6 +170,8 @@ cdef extern from "Elementary.h":
     Elm_Wrap_Type           elm_entry_line_wrap_get(const Evas_Object *obj)
     void                    elm_entry_editable_set(Evas_Object *obj, Eina_Bool 
editable)
     Eina_Bool               elm_entry_editable_get(const Evas_Object *obj)
+    void                    elm_entry_select_allow_set(Evas_Object *obj, 
Eina_Bool allow)
+    Eina_Bool               elm_entry_select_allow_get(const Evas_Object *obj)
     void                    elm_entry_select_none(Evas_Object *obj)
     void                    elm_entry_select_all(Evas_Object *obj)
     void                    elm_entry_select_region_set(Evas_Object *obj, int 
start, int end)
diff --git a/examples/elementary/test_entry.py 
b/examples/elementary/test_entry.py
index f1693b7..880f4fb 100644
--- a/examples/elementary/test_entry.py
+++ b/examples/elementary/test_entry.py
@@ -105,8 +105,7 @@ def entry_clicked(obj, item=None):
     bx2.pack_end(bt)
     bt.show()
 
-    ck = Check(win, text="Context menu disabled")#, 
size_hint_weight=EXPAND_HORIZ,
-                  # size_hint_align=FILL_BOTH)
+    ck = Check(win, text="Context menu disabled")
     ck.callback_changed_add(my_entry_bt_5)
     bx2.pack_end(ck)
     ck.show()
@@ -128,6 +127,11 @@ def entry_clicked(obj, item=None):
     bt.callback_clicked_add(my_entry_bt_7, en)
     bx2.pack_end(bt)
     bt.show()
+
+    ck = Check(win, text="Select allow", state=True)
+    ck.callback_changed_add(lambda c: setattr(en, "select_allow", c.state))
+    bx2.pack_end(ck)
+    ck.show()
     
     bx.pack_end(bx2)
     bx2.show()

-- 


Reply via email to