parameters: (self, clientPt, screenPt, createDC)
return_statement: return True
docstring: Common method between :meth:`DoEndResizeAction` and :meth:`OnLeftUp_Resize`.
docstring_summary: Common method between :meth:`DoEndResizeAction` and :meth:`OnLeftUp_Resize`.
docstring_tokens: Common method between : meth : DoEndResizeAction and : meth : OnLeftUp_Resize .
function: def RestrictResize(self, clientPt, screenPt, createDC):
          """ Common method between :meth:`DoEndResizeAction` and :meth:`OnLeftUp_Resize`. """
  
          dock = self._action_part.dock
          pane = self._action_part.pane
  
          if createDC:
              if wx.Platform == "__WXMAC__":
                  dc = wx.ClientDC(self._frame)
              else:
                  dc = wx.ScreenDC()
  
              DrawResizeHint(dc, self._action_rect)
              self._action_rect = wx.Rect()
  
          newPos = clientPt - self._action_offset
  
          if self._action_part.type == AuiDockUIPart.typeDockSizer:
              minPix, maxPix = self.CalculateDockSizerLimits(dock)
          else:
              if not self._action_part.pane:
                  return
              minPix, maxPix = self.CalculatePaneSizerLimits(dock, pane)
  
          if self._action_part.orientation == wx.HORIZONTAL:
              newPos.y = Clip(newPos.y, minPix, maxPix)
          else:
              newPos.x = Clip(newPos.x, minPix, maxPix)
  
          if self._action_part.type == AuiDockUIPart.typeDockSizer:
  
              partnerDock = self.GetPartnerDock(dock)
              sash_size = self._art.GetMetric(AUI_DOCKART_SASH_SIZE)
              new_dock_size = 0
              direction = dock.dock_direction
  
              if direction == AUI_DOCK_LEFT:
                  new_dock_size = newPos.x - dock.rect.x
  
              elif direction == AUI_DOCK_TOP:
                  new_dock_size = newPos.y - dock.rect.y
  
              elif direction == AUI_DOCK_RIGHT:
                  new_dock_size = dock.rect.x + dock.rect.width - newPos.x - sash_size
  
              elif direction == AUI_DOCK_BOTTOM:
                  new_dock_size = dock.rect.y + dock.rect.height - newPos.y - sash_size
  
              deltaDockSize = new_dock_size - dock.size
  
              if partnerDock:
                  if deltaDockSize > partnerDock.size - sash_size:
                      deltaDockSize = partnerDock.size - sash_size
  
                  partnerDock.size -= deltaDockSize
  
              dock.size += deltaDockSize
              self.Update()
  
          else:
  
              # determine the new pixel size that the user wants
              # this will help us recalculate the pane's proportion
              if dock.IsHorizontal():
                  oldPixsize = pane.rect.width
                  newPixsize = oldPixsize + newPos.x - self._action_part.rect.x
  
              else:
                  oldPixsize = pane.rect.height
                  newPixsize = oldPixsize + newPos.y - self._action_part.rect.y
  
              totalPixsize, totalProportion = self.GetTotalPixSizeAndProportion(dock)
              partnerPane = self.GetPartnerPane(dock, pane)
  
              # prevent division by zero
              if totalPixsize <= 0 or totalProportion <= 0 or not partnerPane:
                  return
  
              # adjust for the surplus
              while (oldPixsize > 0 and totalPixsize > 10 and \
                    oldPixsize*totalProportion/totalPixsize < pane.dock_proportion):
  
                  totalPixsize -= 1
  
              # calculate the new proportion of the pane
  
              newProportion = newPixsize*totalProportion/totalPixsize
              newProportion = Clip(newProportion, 1, totalProportion)
              deltaProp = newProportion - pane.dock_proportion
  
              if partnerPane.dock_proportion - deltaProp < 1:
                  deltaProp = partnerPane.dock_proportion - 1
                  newProportion = pane.dock_proportion + deltaProp
  
              # borrow the space from our neighbor pane to the
              # right or bottom (depending on orientation)
              partnerPane.dock_proportion -= deltaProp
              pane.dock_proportion = newProportion
  
              self.Update()
  
          return True
function_tokens: def RestrictResize ( self , clientPt , screenPt , createDC ) : dock = self . _action_part . dock pane = self . _action_part . pane if createDC : if wx . Platform == "__WXMAC__" : dc = wx . ClientDC ( self . _frame ) else : dc = wx . ScreenDC ( ) DrawResizeHint ( dc , self . _action_rect ) self . _action_rect = wx . Rect ( ) newPos = clientPt - self . _action_offset if self . _action_part . type == AuiDockUIPart . typeDockSizer : minPix , maxPix = self . CalculateDockSizerLimits ( dock ) else : if not self . _action_part . pane : return minPix , maxPix = self . CalculatePaneSizerLimits ( dock , pane ) if self . _action_part . orientation == wx . HORIZONTAL : newPos . y = Clip ( newPos . y , minPix , maxPix ) else : newPos . x = Clip ( newPos . x , minPix , maxPix ) if self . _action_part . type == AuiDockUIPart . typeDockSizer : partnerDock = self . GetPartnerDock ( dock ) sash_size = self . _art . GetMetric ( AUI_DOCKART_SASH_SIZE ) new_dock_size = 0 direction = dock . dock_direction if direction == AUI_DOCK_LEFT : new_dock_size = newPos . x - dock . rect . x elif direction == AUI_DOCK_TOP : new_dock_size = newPos . y - dock . rect . y elif direction == AUI_DOCK_RIGHT : new_dock_size = dock . rect . x + dock . rect . width - newPos . x - sash_size elif direction == AUI_DOCK_BOTTOM : new_dock_size = dock . rect . y + dock . rect . height - newPos . y - sash_size deltaDockSize = new_dock_size - dock . size if partnerDock : if deltaDockSize > partnerDock . size - sash_size : deltaDockSize = partnerDock . size - sash_size partnerDock . size -= deltaDockSize dock . size += deltaDockSize self . Update ( ) else : # determine the new pixel size that the user wants # this will help us recalculate the pane's proportion if dock . IsHorizontal ( ) : oldPixsize = pane . rect . width newPixsize = oldPixsize + newPos . x - self . _action_part . rect . x else : oldPixsize = pane . rect . height newPixsize = oldPixsize + newPos . y - self . _action_part . rect . y totalPixsize , totalProportion = self . GetTotalPixSizeAndProportion ( dock ) partnerPane = self . GetPartnerPane ( dock , pane ) # prevent division by zero if totalPixsize <= 0 or totalProportion <= 0 or not partnerPane : return # adjust for the surplus while ( oldPixsize > 0 and totalPixsize > 10 and oldPixsize * totalProportion / totalPixsize < pane . dock_proportion ) : totalPixsize -= 1 # calculate the new proportion of the pane newProportion = newPixsize * totalProportion / totalPixsize newProportion = Clip ( newProportion , 1 , totalProportion ) deltaProp = newProportion - pane . dock_proportion if partnerPane . dock_proportion - deltaProp < 1 : deltaProp = partnerPane . dock_proportion - 1 newProportion = pane . dock_proportion + deltaProp # borrow the space from our neighbor pane to the # right or bottom (depending on orientation) partnerPane . dock_proportion -= deltaProp pane . dock_proportion = newProportion self . Update ( ) return True