def do_resize(self, evt, wx_obj, xxx_todo_changeme):
(n, w, s, e) = xxx_todo_changeme<EOL>pos = wx_obj.ScreenToClient(wx.GetMousePosition())<EOL>x, y = pos<EOL>if evt.ShiftDown():     <EOL><INDENT>x = x / GRID_SIZE[<NUM_LIT:0>] * GRID_SIZE[<NUM_LIT:0>]<EOL>y = y / GRID_SIZE[<NUM_LIT:1>] * GRID_SIZE[<NUM_LIT:1>]<EOL><DEDENT>pos = wx.Point(x, y)<EOL>if not self.resizing or self.resizing != (wx_obj, (n, w, s, e)):<EOL><INDENT>self.pos = list(pos)                        <EOL>self.resizing = (wx_obj, (n, w, s, e))      <EOL><DEDENT>else:<EOL><INDENT>delta = pos - self.pos <EOL>if DEBUG: print("<STR_LIT>", n, w, s, e)<EOL>if n or w or s or e:<EOL><INDENT>x = wx_obj.Position[<NUM_LIT:0>] + e * delta[<NUM_LIT:0>]<EOL>y = wx_obj.Position[<NUM_LIT:1>] + n * delta[<NUM_LIT:1>]<EOL>if w or e:<EOL><INDENT>if not isinstance(wx_obj, wx.TopLevelWindow):<EOL><INDENT>width = wx_obj.Size[<NUM_LIT:0>] + (w - e) * delta[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>width = wx_obj.ClientSize[<NUM_LIT:0>] + (w - e) * delta[<NUM_LIT:0>]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>width = None<EOL><DEDENT>if n or s:<EOL><INDENT>height = wx_obj.Size[<NUM_LIT:1>] + (s - n) * delta[<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>height = None<EOL><DEDENT><DEDENT>else:<EOL><INDENT>x = wx_obj.Position[<NUM_LIT:0>] + delta[<NUM_LIT:0>]<EOL>y = wx_obj.Position[<NUM_LIT:1>] + delta[<NUM_LIT:1>]<EOL>width = height = None<EOL><DEDENT>new_pos = (x, y)<EOL>new_size = (width, height)<EOL>if new_size != wx_obj.GetSize() or new_pos != wx_obj.GetPosition():<EOL><INDENT>wx_obj.obj.margin_left = <NUM_LIT:0><EOL>wx_obj.obj.margin_right = <NUM_LIT:0><EOL>wx_obj.obj.margin_top = <NUM_LIT:0><EOL>wx_obj.obj.margin_bottom = <NUM_LIT:0><EOL>wx_obj.obj.pos = new_pos      <EOL>if width is not None and height is not None:<EOL><INDENT>wx_obj.obj.width = width<EOL>wx_obj.obj.height = height<EOL><DEDENT>elif width is not None:<EOL><INDENT>wx_obj.obj.width = width<EOL><DEDENT>elif height is not None:<EOL><INDENT>wx_obj.obj.height = height<EOL><DEDENT>if w:<EOL><INDENT>self.pos[<NUM_LIT:0>] = pos[<NUM_LIT:0>]        <EOL><DEDENT>if s:<EOL><INDENT>self.pos[<NUM_LIT:1>] = pos[<NUM_LIT:1>]        <EOL><DEDENT><DEDENT><DEDENT>
Called by SelectionTag