From: Enlightenment S. <no-...@en...> - 2010-09-20 21:58:14
|
Log: Set cursors when editing size and position of a part on Editje Part handlers were modified to be elm layouts and set X cursors. Author: bdilly Date: 2010-09-20 14:58:07 -0700 (Mon, 20 Sep 2010) New Revision: 52520 Modified: trunk/editje/editje/desktop.py trunk/editje/editje/desktop_handler.py trunk/editje/editje/desktop_part_handlers.py Modified: trunk/editje/editje/desktop.py =================================================================== --- trunk/editje/editje/desktop.py 2010-09-20 21:19:49 UTC (rev 52519) +++ trunk/editje/editje/desktop.py 2010-09-20 21:58:07 UTC (rev 52520) @@ -19,6 +19,7 @@ import evas.decorators import edje import elementary +from elementary import cursors from controller import Controller, View from desktop_handler import Handler @@ -182,7 +183,7 @@ #Group Handler self.group_handler = GroupResizeHandler( - self.controller.e, self.parent_view, self.evas, self.theme, + self.controller.e, self.parent_view, self.theme, self.group_resize, self.padding_update, self._operation_stack_cb) self.listener_member_push(self.group_handler) @@ -219,7 +220,7 @@ self.listener_member_push(self.highlight) def handler_args_list(): - return (self.controller.e, self.parent_view, self.evas, self.theme, + return (self.controller.e, self.parent_view, self.theme, self._inform_rel1_changed, self._inform_rel2_changed, self._operation_stack_cb) @@ -491,10 +492,12 @@ class GroupResizeHandler(Handler, GroupListener): - def __init__(self, editable_grp, desktop_scroller, canvas, theme_file, + cursor = cursors.ELM_CURSOR_BOTTOM_RIGHT_CORNER + + def __init__(self, editable_grp, desktop_scroller, theme_file, group_resize_cb, padding_update_cb, op_stack_cb=None, group="editje/desktop/handler"): - Handler.__init__(self, editable_grp, desktop_scroller, canvas, + Handler.__init__(self, editable_grp, desktop_scroller, theme_file, group, op_stack_cb) GroupListener.__init__(self) self._group_resize_cb, self._padding_update_cb = \ Modified: trunk/editje/editje/desktop_handler.py =================================================================== --- trunk/editje/editje/desktop_handler.py 2010-09-20 21:19:49 UTC (rev 52519) +++ trunk/editje/editje/desktop_handler.py 2010-09-20 21:58:07 UTC (rev 52520) @@ -17,19 +17,25 @@ import evas import ecore -import edje +import elementary +from elementary import cursors -class Handler(edje.Edje): - def __init__(self, editable_grp, desktop_scroller, canvas, theme_file=None, +class Handler(elementary.Layout): + cursor = cursors.ELM_CURSOR_X + + def __init__(self, editable_grp, desktop_scroller, theme_file=None, group=None, op_stack_cb=None): - if not editable_grp or not desktop_scroller or not canvas or \ + if not editable_grp or not desktop_scroller or \ not theme_file or not group or not op_stack_cb: raise TypeError( "You must provide valid editable_grp, desktop_scroller, " - "canvas, theme_file, group and operation_stack_callback " + "theme_file, group and operation_stack_callback " "parameters to Handler objects.") - edje.Edje.__init__(self, canvas, file=theme_file, group=group) + elementary.Layout.__init__(self, desktop_scroller) + self.file_set(theme_file, group) + self.size = self.edje.size_min_get() + self.cursor_set(self.cursor) self.on_mouse_down_add(self.__mouse_down_cb) self._move_animator = None self._desktop_scroller = desktop_scroller Modified: trunk/editje/editje/desktop_part_handlers.py =================================================================== --- trunk/editje/editje/desktop_part_handlers.py 2010-09-20 21:19:49 UTC (rev 52519) +++ trunk/editje/editje/desktop_part_handlers.py 2010-09-20 21:58:07 UTC (rev 52520) @@ -18,15 +18,16 @@ from desktop_handler import Handler from desktop_part_listener import PartListener from operation import Operation +from elementary import cursors class PartHandler(Handler, PartListener): - def __init__(self, editable_grp, desktop_scroller, canvas, theme_file, + def __init__(self, editable_grp, desktop_scroller, theme_file, rel1_move_offset_inform_cb=None, rel2_move_offset_inform_cb=None, op_stack_cb=None, group="editje/desktop/part/resize_handler"): Handler.__init__( - self, editable_grp, desktop_scroller, canvas, theme_file, group, + self, editable_grp, desktop_scroller, theme_file, group, op_stack_cb) PartListener.__init__(self) self._rel1_move_offset_inform_cb = rel1_move_offset_inform_cb @@ -57,12 +58,14 @@ class PartHandler_Move(PartHandler): - def __init__(self, editable_grp, desktop_scroller, canvas, theme_file, + cursor = cursors.ELM_CURSOR_FLEUR + + def __init__(self, editable_grp, desktop_scroller, theme_file, rel1_move_offset_inform_cb=None, rel2_move_offset_inform_cb=None, op_stack_cb=None, group="editje/desktop/part/move_handler"): PartHandler.__init__( - self, editable_grp, desktop_scroller, canvas, theme_file, + self, editable_grp, desktop_scroller, theme_file, rel1_move_offset_inform_cb, rel2_move_offset_inform_cb, op_stack_cb, group) self.size = (10, 10) @@ -105,6 +108,8 @@ class PartHandler_T(PartHandler): + cursor = cursors.ELM_CURSOR_TOP_SIDE + def part_move(self, obj): self.bottom_center = obj.top_center if obj.size[0] < 10: @@ -143,6 +148,8 @@ class PartHandler_TL(PartHandler): + cursor = cursors.ELM_CURSOR_TOP_LEFT_CORNER + def part_move(self, obj): self.show() self.bottom_right = obj.top_left @@ -178,6 +185,8 @@ class PartHandler_TR(PartHandler): + cursor = cursors.ELM_CURSOR_TOP_RIGHT_CORNER + def part_move(self, obj): self.show() self.bottom_left = obj.top_right @@ -216,6 +225,8 @@ class PartHandler_B(PartHandler): + cursor = cursors.ELM_CURSOR_BOTTOM_SIDE + def part_move(self, obj): self.top_center = obj.bottom_center if obj.size[0] < 10: @@ -254,6 +265,8 @@ class PartHandler_BR(PartHandler): + cursor = cursors.ELM_CURSOR_BOTTOM_RIGHT_CORNER + def part_move(self, obj): self.show() self.top_left = obj.bottom_right @@ -289,6 +302,8 @@ class PartHandler_BL(PartHandler): + cursor = cursors.ELM_CURSOR_BOTTOM_LEFT_CORNER + def part_move(self, obj): self.show() self.top_right = obj.bottom_left @@ -327,6 +342,8 @@ class PartHandler_L(PartHandler): + cursor = cursors.ELM_CURSOR_LEFT_SIDE + def part_move(self, obj): self.right_center = obj.left_center if obj.size[1] < 10: @@ -365,6 +382,8 @@ class PartHandler_R(PartHandler): + cursor = cursors.ELM_CURSOR_RIGHT_SIDE + def part_move(self, obj): self.left_center = obj.right_center if obj.size[1] < 10: |