def on_timer(self, evt):
ctrl_is_down = wx.GetKeyState(wx.WXK_CONTROL)<EOL>shift_is_down = wx.GetKeyState(wx.WXK_SHIFT)<EOL>ms = wx.GetMouseState()<EOL>new_pos = None<EOL>if self._key_state != (ctrl_is_down, shift_is_down):<EOL><INDENT>self._key_state = (ctrl_is_down, shift_is_down)<EOL>self._click_ms_x, self._click_ms_y = ms.x, ms.y<EOL>self._click_frame_x, self._click_frame_y = self.pos<EOL>self._click_frame_width, self._click_frame_height = self.size<EOL>self._click_opacity = self.opacity<EOL>self._last_ms = ms.x, ms.y<EOL>width, height = self.size<EOL>self._quad_signal_x = <NUM_LIT:1> if (self._click_ms_x -<EOL>self._click_frame_x) / width > <NUM_LIT> else -<NUM_LIT:1><EOL>self._quad_signal_y = <NUM_LIT:1> if (self._click_ms_y -<EOL>self._click_frame_y) / height > <NUM_LIT> else -<NUM_LIT:1><EOL><DEDENT>if (wx.__version__ >= "<STR_LIT:3>" and ms.leftIsDown) or(wx.__version__ <  "<STR_LIT:3>" and ms.leftDown):<EOL><INDENT>if self._last_ms != (ms.x, ms.y): <EOL><INDENT>self._last_ms = (ms.x, ms.y)<EOL>delta_x = ms.x - self._click_ms_x<EOL>delta_y = ms.y - self._click_ms_y<EOL>if shift_is_down:<EOL><INDENT>self.opacity = max(MIN_OPACITY,<EOL>min(MAX_OPACITY, self._click_opacity - delta_y)<EOL>)<EOL><DEDENT>if ctrl_is_down:<EOL><INDENT>new_w = max(MIN_WIDTH, self._click_frame_width +<EOL><NUM_LIT:2> * delta_x * self._quad_signal_x<EOL>)<EOL>new_h = max(MIN_HEIGHT, self._click_frame_height +<EOL><NUM_LIT:2> * delta_y * self._quad_signal_y<EOL>)<EOL>self.size = new_w, new_h<EOL>center_x = self._click_frame_x + self._click_frame_width / <NUM_LIT:2><EOL>center_y = self._click_frame_y + self._click_frame_height / <NUM_LIT:2><EOL>new_pos = (center_x - new_w / <NUM_LIT:2>,<EOL>center_y - new_h / <NUM_LIT:2>)<EOL><DEDENT>if not (ctrl_is_down or shift_is_down):<EOL><INDENT>new_pos = (self._click_frame_x + delta_x,<EOL>self._click_frame_y + delta_y)<EOL><DEDENT><DEDENT>if new_pos is not None:<EOL><INDENT>self.pos = new_pos<EOL><DEDENT>self._timer.Start(MOUSE_TIMER_WATCH, True)<EOL><DEDENT>
Keep watching the mouse displacement via timer
Needed since EVT_MOVE doesn't happen once the mouse gets outside the
frame