New 1.16 API: various next_item_get/set
This commit is contained in:
parent
ed5f93850f
commit
8ad08e8ef8
|
@ -858,6 +858,44 @@ cdef class Object(SmartObject):
|
|||
def focused_object_get(self):
|
||||
return object_from_instance(elm_object_focused_object_get(self.obj))
|
||||
|
||||
def focus_next_item_get(self, Elm_Focus_Direction direction):
|
||||
"""Get next object item which was set with specific focus direction.
|
||||
|
||||
Get next object item which was set by :func:`focus_next_item_set`
|
||||
with specific focus direction.
|
||||
|
||||
:return: Focus next object item or ``None``, if there is no focus next
|
||||
object item.
|
||||
:rtype: :class:`ObjectItem`
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
"""
|
||||
return _object_item_to_python(
|
||||
elm_object_focus_next_item_get(self.obj, direction))
|
||||
|
||||
def focus_next_item_set(self, ObjectItem next,
|
||||
Elm_Focus_Direction direction):
|
||||
""" Set next object item with specific focus direction.
|
||||
|
||||
When focus next object item is set with specific focus direction, this
|
||||
object item will be the first candidate when finding next focusable
|
||||
object or item. If the focus next object item is set, it is preference
|
||||
to focus next object. Focus next object item can be registered with six
|
||||
directions that are previous, next, up, down, right, and left.
|
||||
|
||||
:param next: Focus next object item
|
||||
:type next: :class:`ObjectItem`
|
||||
:param dir: Focus direction
|
||||
:type dir: :ref:`Elm_Focus_Direction`
|
||||
|
||||
:see: :py:func:`focus_next_item_get`
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
"""
|
||||
elm_object_focus_next_item_set(self.obj, next.item, direction)
|
||||
|
||||
property focused_item:
|
||||
"""The focused object item in an object tree.
|
||||
|
||||
|
|
|
@ -176,6 +176,8 @@ cdef extern from "Elementary.h":
|
|||
Eina_Bool elm_object_tree_focus_allow_get(const Evas_Object *obj)
|
||||
Eina_Bool elm_object_focus_highlight_style_set(Evas_Object *obj, const char *style)
|
||||
const char * elm_object_focus_highlight_style_get(const Evas_Object *obj)
|
||||
Elm_Object_Item * elm_object_focus_next_item_get(const Evas_Object *obj, Elm_Focus_Direction dir)
|
||||
void elm_object_focus_next_item_set(Evas_Object *obj, Elm_Object_Item *next_item, Elm_Focus_Direction dir)
|
||||
Elm_Object_Item * elm_object_focused_item_get(const Evas_Object *obj)
|
||||
void elm_object_focus_move_policy_set(Evas_Object *obj, Elm_Focus_Move_Policy policy)
|
||||
Elm_Focus_Move_Policy elm_object_focus_move_policy_get(Evas_Object *obj)
|
||||
|
|
|
@ -641,6 +641,80 @@ cdef class ObjectItem(object):
|
|||
def focus_get(self):
|
||||
return elm_object_item_focus_get(self.item)
|
||||
|
||||
def focus_next_object_get(self, Elm_Focus_Direction direction):
|
||||
"""Get next object which was set with specific focus direction.
|
||||
|
||||
:param dir: Focus direction
|
||||
:type dir: :ref:`Elm_Focus_Direction`
|
||||
:return: Focus next object or None, if there is no focus next object.
|
||||
:rtype: :class:`Object`
|
||||
|
||||
:see: :func:`focus_next_object_set`
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
"""
|
||||
return object_from_instance(
|
||||
elm_object_item_focus_next_object_get(self.item, direction)
|
||||
)
|
||||
|
||||
def focus_next_object_set(self, evasObject next,
|
||||
Elm_Focus_Direction direction):
|
||||
"""Set next object with specific focus direction.
|
||||
|
||||
When focus next object is set with specific focus direction, this object
|
||||
will be the first candidate when finding next focusable object. Focus
|
||||
next object can be registered with six directions that are previous,
|
||||
next, up, down, right, and left.
|
||||
|
||||
:param next: Focus next object
|
||||
:type next: :class:`Object`
|
||||
:param dir: Focus direction
|
||||
:type dir: :ref:`Elm_Focus_Direction`
|
||||
|
||||
:see: :py:func:`focus_next_object_get`
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
"""
|
||||
elm_object_item_focus_next_object_set(self.item, next.obj, direction)
|
||||
|
||||
def focus_next_item_get(self, Elm_Focus_Direction direction):
|
||||
"""Get next object item which was set with specific focus direction.
|
||||
|
||||
:return: Focus next object item or ``None``, if there is no focus next
|
||||
object item.
|
||||
:rtype: :class:`ObjectItem`
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
"""
|
||||
return _object_item_to_python(
|
||||
elm_object_item_focus_next_item_get(self.item, direction))
|
||||
|
||||
def focus_next_item_set(self, ObjectItem next,
|
||||
Elm_Focus_Direction direction):
|
||||
""" Set next object item with specific focus direction.
|
||||
|
||||
When focus next object item is set with specific focus direction, this
|
||||
object item will be the first candidate when finding next focusable
|
||||
object or item. If the focus next object item is set, it is preference
|
||||
to focus next object. Focus next object item can be registered with six
|
||||
directions that are previous, next, up, down, right, and left.
|
||||
|
||||
:param next: Focus next object item
|
||||
:type next: :class:`ObjectItem`
|
||||
:param dir: Focus direction
|
||||
:type dir: :ref:`Elm_Focus_Direction`
|
||||
|
||||
:see: :py:func:`focus_next_item_get`
|
||||
|
||||
.. versionadded:: 1.16
|
||||
|
||||
"""
|
||||
elm_object_item_focus_next_item_set(self.item, next.item, direction)
|
||||
|
||||
|
||||
|
||||
# TODO: Accessibility
|
||||
# def access_unregister(self):
|
||||
|
|
|
@ -44,6 +44,11 @@ cdef extern from "Elementary.h":
|
|||
Eina_Bool elm_object_item_cursor_engine_only_get(const Elm_Object_Item *it)
|
||||
void elm_object_item_focus_set(Elm_Object_Item *it, Eina_Bool focused)
|
||||
Eina_Bool elm_object_item_focus_get(const Elm_Object_Item *it)
|
||||
Evas_Object * elm_object_item_focus_next_object_get(Elm_Object_Item *it, Elm_Focus_Direction dir)
|
||||
void elm_object_item_focus_next_object_set(Elm_Object_Item *it, Evas_Object *next, Elm_Focus_Direction dir)
|
||||
Elm_Object_Item * elm_object_item_focus_next_item_get(Elm_Object_Item *it, Elm_Focus_Direction dir)
|
||||
void elm_object_item_focus_next_item_set(Elm_Object_Item *it, Elm_Object_Item *next_item, Elm_Focus_Direction dir)
|
||||
|
||||
|
||||
|
||||
#TODO: Evas_Object * elm_object_item_access_register(Elm_Object_Item *item)
|
||||
|
|
Loading…
Reference in New Issue