parameters: (self, event)
docstring: Handles the ``EVT_AUINOTEBOOK_DRAG_MOTION`` event for :class:`AuiNotebook`.
  
          :param `event`: a :class:`AuiNotebookEvent` event to be processed.
docstring_summary: Handles the ``EVT_AUINOTEBOOK_DRAG_MOTION`` event for :class:`AuiNotebook`.
docstring_tokens: Handles the EVT_AUINOTEBOOK_DRAG_MOTION event for : class : AuiNotebook .
function: def OnTabDragMotion(self, event):
          """
          Handles the ``EVT_AUINOTEBOOK_DRAG_MOTION`` event for :class:`AuiNotebook`.
  
          :param `event`: a :class:`AuiNotebookEvent` event to be processed.
          """
  
          self._curpage = event.GetSelection()
  
          tabs = event.GetEventObject()
          if not tabs.GetEnabled(event.GetSelection()):
              return
  
          if self._textCtrl is not None:
              self._textCtrl.StopEditing()
  
          screen_pt = wx.GetMousePosition()
          client_pt = self.ScreenToClient(screen_pt)
          zero = wx.Point(0, 0)
  
          src_tabs = event.GetEventObject()
          dest_tabs = self.GetTabCtrlFromPoint(client_pt)
  
          if dest_tabs == src_tabs:
  
              # always hide the hint for inner-tabctrl drag
              self._mgr.HideHint()
  
              # if tab moving is not allowed, leave
              if not self._agwFlags & AUI_NB_TAB_MOVE:
                  return
  
              pt = dest_tabs.ScreenToClient(screen_pt)
  
              # this is an inner-tab drag/reposition
              dest_location_tab = dest_tabs.TabHitTest(pt.x, pt.y)
  
              if dest_location_tab:
  
                  src_idx = event.GetSelection()
                  dest_idx = dest_tabs.GetIdxFromWindow(dest_location_tab)
  
                  # prevent jumpy drag
                  if (src_idx == dest_idx) or dest_idx == -1 or \
                     (src_idx > dest_idx and self._last_drag_x <= pt.x) or \
                     (src_idx < dest_idx and self._last_drag_x >= pt.x):
  
                      self._last_drag_x = pt.x
                      return
  
                  src_tab = dest_tabs.GetWindowFromIdx(src_idx)
                  dest_tabs.MovePage(src_tab, dest_idx)
                  self._tabs.MovePage(self._tabs.GetPage(src_idx).window, dest_idx)
                  dest_tabs.SetActivePage(dest_idx)
                  dest_tabs.DoShowHide()
                  dest_tabs.Refresh()
                  self._last_drag_x = pt.x
  
              return
  
          # if external drag is allowed, check if the tab is being dragged
          # over a different AuiNotebook control
          if self._agwFlags & AUI_NB_TAB_EXTERNAL_MOVE:
  
              tab_ctrl = wx.FindWindowAtPoint(screen_pt)
  
              # if we aren't over any window, stop here
              if not tab_ctrl:
                  if self._agwFlags & AUI_NB_TAB_FLOAT:
                      if self.IsMouseWellOutsideWindow():
                          hintRect = wx.RectPS(screen_pt, (400, 300))
                          # Use CallAfter so we overwrite the hint that might be
                          # shown by our superclass:
                          wx.CallAfter(self._mgr.ShowHint, hintRect)
                  return
  
              # make sure we are not over the hint window
              if not isinstance(tab_ctrl, wx.Frame):
                  while tab_ctrl:
                      if isinstance(tab_ctrl, AuiTabCtrl):
                          break
  
                      tab_ctrl = tab_ctrl.GetParent()
  
                  if tab_ctrl:
                      nb = tab_ctrl.GetParent()
  
                      if nb != self:
  
                          hint_rect = tab_ctrl.GetClientRect()
                          hint_rect.x, hint_rect.y = tab_ctrl.ClientToScreenXY(hint_rect.x, hint_rect.y)
                          self._mgr.ShowHint(hint_rect)
                          return
  
              else:
  
                  if not dest_tabs:
                      # we are either over a hint window, or not over a tab
                      # window, and there is no where to drag to, so exit
                      return
  
          if self._agwFlags & AUI_NB_TAB_FLOAT:
              if self.IsMouseWellOutsideWindow():
                  hintRect = wx.RectPS(screen_pt, (400, 300))
                  # Use CallAfter so we overwrite the hint that might be
                  # shown by our superclass:
                  wx.CallAfter(self._mgr.ShowHint, hintRect)
                  return
  
          # if there are less than two panes, split can't happen, so leave
          if self._tabs.GetPageCount() < 2:
              return
  
          # if tab moving is not allowed, leave
          if not self._agwFlags & AUI_NB_TAB_SPLIT:
              return
  
          if dest_tabs:
  
              hint_rect = dest_tabs.GetRect()
              hint_rect.x, hint_rect.y = self.ClientToScreenXY(hint_rect.x, hint_rect.y)
              self._mgr.ShowHint(hint_rect)
  
          else:
              rect = self._mgr.CalculateHintRect(self._dummy_wnd, client_pt, zero)
              if rect.IsEmpty():
                  self._mgr.HideHint()
                  return
  
              hit_wnd = wx.FindWindowAtPoint(screen_pt)
              if hit_wnd and not isinstance(hit_wnd, AuiNotebook):
                  tab_frame = self.GetTabFrameFromWindow(hit_wnd)
                  if tab_frame:
                      hint_rect = wx.Rect(*tab_frame._rect)
                      hint_rect.x, hint_rect.y = self.ClientToScreenXY(hint_rect.x, hint_rect.y)
                      rect.Intersect(hint_rect)
                      self._mgr.ShowHint(rect)
                  else:
                      self._mgr.DrawHintRect(self._dummy_wnd, client_pt, zero)
              else:
                  self._mgr.DrawHintRect(self._dummy_wnd, client_pt, zero)
function_tokens: def OnTabDragMotion ( self , event ) : self . _curpage = event . GetSelection ( ) tabs = event . GetEventObject ( ) if not tabs . GetEnabled ( event . GetSelection ( ) ) : return if self . _textCtrl is not None : self . _textCtrl . StopEditing ( ) screen_pt = wx . GetMousePosition ( ) client_pt = self . ScreenToClient ( screen_pt ) zero = wx . Point ( 0 , 0 ) src_tabs = event . GetEventObject ( ) dest_tabs = self . GetTabCtrlFromPoint ( client_pt ) if dest_tabs == src_tabs : # always hide the hint for inner-tabctrl drag self . _mgr . HideHint ( ) # if tab moving is not allowed, leave if not self . _agwFlags & AUI_NB_TAB_MOVE : return pt = dest_tabs . ScreenToClient ( screen_pt ) # this is an inner-tab drag/reposition dest_location_tab = dest_tabs . TabHitTest ( pt . x , pt . y ) if dest_location_tab : src_idx = event . GetSelection ( ) dest_idx = dest_tabs . GetIdxFromWindow ( dest_location_tab ) # prevent jumpy drag if ( src_idx == dest_idx ) or dest_idx == - 1 or ( src_idx > dest_idx and self . _last_drag_x <= pt . x ) or ( src_idx < dest_idx and self . _last_drag_x >= pt . x ) : self . _last_drag_x = pt . x return src_tab = dest_tabs . GetWindowFromIdx ( src_idx ) dest_tabs . MovePage ( src_tab , dest_idx ) self . _tabs . MovePage ( self . _tabs . GetPage ( src_idx ) . window , dest_idx ) dest_tabs . SetActivePage ( dest_idx ) dest_tabs . DoShowHide ( ) dest_tabs . Refresh ( ) self . _last_drag_x = pt . x return # if external drag is allowed, check if the tab is being dragged # over a different AuiNotebook control if self . _agwFlags & AUI_NB_TAB_EXTERNAL_MOVE : tab_ctrl = wx . FindWindowAtPoint ( screen_pt ) # if we aren't over any window, stop here if not tab_ctrl : if self . _agwFlags & AUI_NB_TAB_FLOAT : if self . IsMouseWellOutsideWindow ( ) : hintRect = wx . RectPS ( screen_pt , ( 400 , 300 ) ) # Use CallAfter so we overwrite the hint that might be # shown by our superclass: wx . CallAfter ( self . _mgr . ShowHint , hintRect ) return # make sure we are not over the hint window if not isinstance ( tab_ctrl , wx . Frame ) : while tab_ctrl : if isinstance ( tab_ctrl , AuiTabCtrl ) : break tab_ctrl = tab_ctrl . GetParent ( ) if tab_ctrl : nb = tab_ctrl . GetParent ( ) if nb != self : hint_rect = tab_ctrl . GetClientRect ( ) hint_rect . x , hint_rect . y = tab_ctrl . ClientToScreenXY ( hint_rect . x , hint_rect . y ) self . _mgr . ShowHint ( hint_rect ) return else : if not dest_tabs : # we are either over a hint window, or not over a tab # window, and there is no where to drag to, so exit return if self . _agwFlags & AUI_NB_TAB_FLOAT : if self . IsMouseWellOutsideWindow ( ) : hintRect = wx . RectPS ( screen_pt , ( 400 , 300 ) ) # Use CallAfter so we overwrite the hint that might be # shown by our superclass: wx . CallAfter ( self . _mgr . ShowHint , hintRect ) return # if there are less than two panes, split can't happen, so leave if self . _tabs . GetPageCount ( ) < 2 : return # if tab moving is not allowed, leave if not self . _agwFlags & AUI_NB_TAB_SPLIT : return if dest_tabs : hint_rect = dest_tabs . GetRect ( ) hint_rect . x , hint_rect . y = self . ClientToScreenXY ( hint_rect . x , hint_rect . y ) self . _mgr . ShowHint ( hint_rect ) else : rect = self . _mgr . CalculateHintRect ( self . _dummy_wnd , client_pt , zero ) if rect . IsEmpty ( ) : self . _mgr . HideHint ( ) return hit_wnd = wx . FindWindowAtPoint ( screen_pt ) if hit_wnd and not isinstance ( hit_wnd , AuiNotebook ) : tab_frame = self . GetTabFrameFromWindow ( hit_wnd ) if tab_frame : hint_rect = wx . Rect ( * tab_frame . _rect ) hint_rect . x , hint_rect . y = self . ClientToScreenXY ( hint_rect . x , hint_rect . y ) rect . Intersect ( hint_rect ) self . _mgr . ShowHint ( rect ) else : self . _mgr . DrawHintRect ( self . _dummy_wnd , client_pt , zero ) else : self . _mgr . DrawHintRect ( self . _dummy_wnd , client_pt , zero )