parameters: (self, panes, docks, uiparts, spacer_only=False, oncheck=True)
docstring: Layouts all the UI structures in the interface.
  
          :param `panes`: a list of :class:`AuiPaneInfo` instances;
          :param `docks`: a list of :class:`AuiDockInfo` classes;
          :param `uiparts`: a list of UI parts in the interface;
          :param bool `spacer_only`: whether to add a simple spacer or a real window;
          :param bool `oncheck`: whether to store the results in a class member or not.
docstring_summary: Layouts all the UI structures in the interface.
docstring_tokens: Layouts all the UI structures in the interface .
function: def LayoutAll(self, panes, docks, uiparts, spacer_only=False, oncheck=True):
          """
          Layouts all the UI structures in the interface.
  
          :param `panes`: a list of :class:`AuiPaneInfo` instances;
          :param `docks`: a list of :class:`AuiDockInfo` classes;
          :param `uiparts`: a list of UI parts in the interface;
          :param bool `spacer_only`: whether to add a simple spacer or a real window;
          :param bool `oncheck`: whether to store the results in a class member or not.
          """
  
          container = wx.BoxSizer(wx.VERTICAL)
  
          pane_border_size = self._art.GetMetric(AUI_DOCKART_PANE_BORDER_SIZE)
          caption_size = self._art.GetMetric(AUI_DOCKART_CAPTION_SIZE)
          cli_size = self._frame.GetClientSize()
  
          # empty all docks out
          for dock in docks:
              dock.panes = []
              if dock.fixed:
                  # always reset fixed docks' sizes, because
                  # the contained windows may have been resized
                  dock.size = 0
  
          dock_count = len(docks)
  
          # iterate through all known panes, filing each
          # of them into the appropriate dock. If the
          # pane does not exist in the dock, add it
          for p in panes:
  
              # don't layout hidden panes.
              if p.IsShown():
  
                  # find any docks with the same dock direction, dock layer, and
                  # dock row as the pane we are working on
                  arr = FindDocks(docks, p.dock_direction, p.dock_layer, p.dock_row)
  
                  if arr:
                      dock = arr[0]
  
                  else:
                      # dock was not found, so we need to create a new one
                      d = AuiDockInfo()
                      d.dock_direction = p.dock_direction
                      d.dock_layer = p.dock_layer
                      d.dock_row = p.dock_row
                      docks.append(d)
                      dock = docks[-1]
  
                      if p.HasFlag(p.needsRestore) and not p.HasFlag(p.wasMaximized):
  
                          isHor = dock.IsHorizontal()
                          sashSize = self._art.GetMetric(AUI_DOCKART_SASH_SIZE)
  
                          # get the sizes of any docks that might
                          # overlap with our restored dock
  
                          # make list of widths or heights from the size in the dock rects
                          sizes = [d.rect[2:][isHor] for \
                                   d in docks if d.IsOk() and \
                                   (d.IsHorizontal() == isHor) and \
                                   not d.toolbar and \
                                   d.dock_direction != AUI_DOCK_CENTER]
  
                          frameRect = GetInternalFrameRect(self._frame, self._docks)
  
                          # set max size allowing for sashes and absolute minimum
                          maxsize = frameRect[2:][isHor] - sum(sizes) - (len(sizes)*10) - (sashSize*len(sizes))
                          dock.size = min(p.previousDockSize,maxsize)
  
                      else:
                          dock.size = 0
  
                  if p.HasFlag(p.wasMaximized):
                      self.MaximizePane(p, savesizes=False)
                      p.SetFlag(p.wasMaximized, False)
  
                  if p.HasFlag(p.needsRestore):
                      if p.previousDockPos is not None:
                          DoInsertPane(dock.panes, dock.dock_direction, dock.dock_layer, dock.dock_row, p.previousDockPos)
                          p.dock_pos = p.previousDockPos
                          p.previousDockPos = None
                      p.SetFlag(p.needsRestore, False)
  
                  if p.IsDocked():
                      # remove the pane from any existing docks except this one
                      docks = RemovePaneFromDocks(docks, p, dock)
  
                      # pane needs to be added to the dock,
                      # if it doesn't already exist
                      if not FindPaneInDock(dock, p.window):
                          dock.panes.append(p)
                  else:
                      # remove the pane from any existing docks
                      docks = RemovePaneFromDocks(docks, p)
  
          # remove any empty docks
          docks = [dock for dock in docks if dock.panes]
  
          dock_count = len(docks)
          # configure the docks further
          for ii, dock in enumerate(docks):
              # sort the dock pane array by the pane's
              # dock position (dock_pos), in ascending order
              dock.panes.sort(PaneSortFunc)
              dock_pane_count = len(dock.panes)
  
              # for newly created docks, set up their initial size
              if dock.size == 0:
                  size = 0
                  for pane in dock.panes:
                      pane_size = pane.best_size
                      if pane_size == wx.Size(-1, -1):
                          pane_size = pane.min_size
                      if pane_size == wx.Size(-1, -1) and pane.window:
                          pane_size = pane.window.GetSize()
                      if dock.IsHorizontal():
                          size = max(pane_size.y, size)
                      else:
                          size = max(pane_size.x, size)
  
                  # add space for the border (two times), but only
                  # if at least one pane inside the dock has a pane border
                  for pane in dock.panes:
                      if pane.HasBorder():
                          size = size + pane_border_size*2
                          break
  
                  # if pane is on the top or bottom, add the caption height,
                  # but only if at least one pane inside the dock has a caption
                  if dock.IsHorizontal():
                      for pane in dock.panes:
                          if pane.HasCaption() and not pane.HasCaptionLeft():
                              size = size + caption_size
                              break
                  else:
                      for pane in dock.panes:
                          if pane.HasCaptionLeft() and not pane.HasCaption():
                              size = size + caption_size
                              break
  
                  # new dock's size may not be more than the dock constraint
                  # parameter specifies.  See SetDockSizeConstraint()
                  max_dock_x_size = int(self._dock_constraint_x*float(cli_size.x))
                  max_dock_y_size = int(self._dock_constraint_y*float(cli_size.y))
                  if cli_size <= wx.Size(20, 20):
                      max_dock_x_size = 10000
                      max_dock_y_size = 10000
  
                  if dock.IsHorizontal():
                      size = min(size, max_dock_y_size)
                  else:
                      size = min(size, max_dock_x_size)
  
                  # absolute minimum size for a dock is 10 pixels
                  if size < 10:
                      size = 10
  
                  dock.size = size
  
              # determine the dock's minimum size
              plus_border = False
              plus_caption = False
              plus_caption_left = False
              dock_min_size = 0
              for pane in dock.panes:
                  if pane.min_size != wx.Size(-1, -1):
                      if pane.HasBorder():
                          plus_border = True
                      if pane.HasCaption():
                          plus_caption = True
                      if pane.HasCaptionLeft():
                          plus_caption_left = True
                      if dock.IsHorizontal():
                          if pane.min_size.y > dock_min_size:
                              dock_min_size = pane.min_size.y
                      else:
                          if pane.min_size.x > dock_min_size:
                              dock_min_size = pane.min_size.x
  
              if plus_border:
                  dock_min_size += pane_border_size*2
              if plus_caption and dock.IsHorizontal():
                  dock_min_size += caption_size
              if plus_caption_left and dock.IsVertical():
                  dock_min_size += caption_size
  
              dock.min_size = dock_min_size
  
              # if the pane's current size is less than it's
              # minimum, increase the dock's size to it's minimum
              if dock.size < dock.min_size:
                  dock.size = dock.min_size
  
              # determine the dock's mode (fixed or proportional)
              # determine whether the dock has only toolbars
              action_pane_marked = False
              dock.fixed = True
              dock.toolbar = True
              for pane in dock.panes:
                  if not pane.IsFixed():
                      dock.fixed = False
                  if not pane.IsToolbar():
                      dock.toolbar = False
                  if pane.HasFlag(AuiPaneInfo.optionDockFixed):
                      dock.fixed = True
                  if pane.HasFlag(AuiPaneInfo.actionPane):
                      action_pane_marked = True
  
              # if the dock mode is proportional and not fixed-pixel,
              # reassign the dock_pos to the sequential 0, 1, 2, 3
              # e.g. remove gaps like 1, 2, 30, 500
              if not dock.fixed:
                  for jj in xrange(dock_pane_count):
                      pane = dock.panes[jj]
                      pane.dock_pos = jj
  
              # if the dock mode is fixed, and none of the panes
              # are being moved right now, make sure the panes
              # do not overlap each other.  If they do, we will
              # adjust the panes' positions
              if dock.fixed and not action_pane_marked:
                  pane_positions, pane_sizes = self.GetPanePositionsAndSizes(dock)
                  offset = 0
                  for jj in xrange(dock_pane_count):
                      pane = dock.panes[jj]
                      pane.dock_pos = pane_positions[jj]
                      amount = pane.dock_pos - offset
                      if amount >= 0:
                          offset += amount
                      else:
                          pane.dock_pos += -amount
  
                      offset += pane_sizes[jj]
                      dock.panes[jj] = pane
  
              if oncheck:
                  self._docks[ii] = dock
  
          # shrink docks if needed
  ##        docks = self.SmartShrink(docks, AUI_DOCK_TOP)
  ##        docks = self.SmartShrink(docks, AUI_DOCK_LEFT)
  
          if oncheck:
              self._docks = docks
  
          # discover the maximum dock layer
          max_layer = 0
          dock_count = len(docks)
  
          for ii in xrange(dock_count):
              max_layer = max(max_layer, docks[ii].dock_layer)
  
          # clear out uiparts
          uiparts = []
  
          # create a bunch of box sizers,
          # from the innermost level outwards.
          cont = None
          middle = None
  
          if oncheck:
              docks = self._docks
  
          for layer in xrange(max_layer+1):
              # find any docks in this layer
              arr = FindDocks(docks, -1, layer, -1)
              # if there aren't any, skip to the next layer
              if not arr:
                  continue
  
              old_cont = cont
  
              # create a container which will hold this layer's
              # docks (top, bottom, left, right)
              cont = wx.BoxSizer(wx.VERTICAL)
  
              # find any top docks in this layer
              arr = FindDocks(docks, AUI_DOCK_TOP, layer, -1)
              for row in arr:
                  uiparts = self.LayoutAddDock(cont, row, uiparts, spacer_only)
  
              # fill out the middle layer (which consists
              # of left docks, content area and right docks)
  
              middle = wx.BoxSizer(wx.HORIZONTAL)
  
              # find any left docks in this layer
              arr = FindDocks(docks, AUI_DOCK_LEFT, layer, -1)
              for row in arr:
                  uiparts = self.LayoutAddDock(middle, row, uiparts, spacer_only)
  
              # add content dock (or previous layer's sizer
              # to the middle
              if not old_cont:
                  # find any center docks
                  arr = FindDocks(docks, AUI_DOCK_CENTER, -1, -1)
                  if arr:
                      for row in arr:
                         uiparts = self.LayoutAddDock(middle, row, uiparts, spacer_only)
  
                  elif not self._has_maximized:
                      # there are no center docks, add a background area
                      sizer_item = middle.Add((1, 1), 1, wx.EXPAND)
                      part = AuiDockUIPart()
                      part.type = AuiDockUIPart.typeBackground
                      part.pane = None
                      part.dock = None
                      part.button = None
                      part.cont_sizer = middle
                      part.sizer_item = sizer_item
                      uiparts.append(part)
              else:
                  middle.Add(old_cont, 1, wx.EXPAND)
  
              # find any right docks in this layer
              arr = FindDocks(docks, AUI_DOCK_RIGHT, layer, -1, reverse=True)
              for row in arr:
                  uiparts = self.LayoutAddDock(middle, row, uiparts, spacer_only)
  
              if len(middle.GetChildren()) > 0:
                  cont.Add(middle, 1, wx.EXPAND)
  
              # find any bottom docks in this layer
              arr = FindDocks(docks, AUI_DOCK_BOTTOM, layer, -1, reverse=True)
              for row in arr:
                      uiparts = self.LayoutAddDock(cont, row, uiparts, spacer_only)
  
          if not cont:
              # no sizer available, because there are no docks,
              # therefore we will create a simple background area
              cont = wx.BoxSizer(wx.VERTICAL)
              sizer_item = cont.Add((1, 1), 1, wx.EXPAND)
              part = AuiDockUIPart()
              part.type = AuiDockUIPart.typeBackground
              part.pane = None
              part.dock = None
              part.button = None
              part.cont_sizer = middle
              part.sizer_item = sizer_item
              uiparts.append(part)
  
          if oncheck:
              self._uiparts = uiparts
              self._docks = docks
  
          container.Add(cont, 1, wx.EXPAND)
  
          if oncheck:
              return container
          else:
              return container, panes, docks, uiparts
function_tokens: def LayoutAll ( self , panes , docks , uiparts , spacer_only = False , oncheck = True ) : container = wx . BoxSizer ( wx . VERTICAL ) pane_border_size = self . _art . GetMetric ( AUI_DOCKART_PANE_BORDER_SIZE ) caption_size = self . _art . GetMetric ( AUI_DOCKART_CAPTION_SIZE ) cli_size = self . _frame . GetClientSize ( ) # empty all docks out for dock in docks : dock . panes = [ ] if dock . fixed : # always reset fixed docks' sizes, because # the contained windows may have been resized dock . size = 0 dock_count = len ( docks ) # iterate through all known panes, filing each # of them into the appropriate dock. If the # pane does not exist in the dock, add it for p in panes : # don't layout hidden panes. if p . IsShown ( ) : # find any docks with the same dock direction, dock layer, and # dock row as the pane we are working on arr = FindDocks ( docks , p . dock_direction , p . dock_layer , p . dock_row ) if arr : dock = arr [ 0 ] else : # dock was not found, so we need to create a new one d = AuiDockInfo ( ) d . dock_direction = p . dock_direction d . dock_layer = p . dock_layer d . dock_row = p . dock_row docks . append ( d ) dock = docks [ - 1 ] if p . HasFlag ( p . needsRestore ) and not p . HasFlag ( p . wasMaximized ) : isHor = dock . IsHorizontal ( ) sashSize = self . _art . GetMetric ( AUI_DOCKART_SASH_SIZE ) # get the sizes of any docks that might # overlap with our restored dock # make list of widths or heights from the size in the dock rects sizes = [ d . rect [ 2 : ] [ isHor ] for d in docks if d . IsOk ( ) and ( d . IsHorizontal ( ) == isHor ) and not d . toolbar and d . dock_direction != AUI_DOCK_CENTER ] frameRect = GetInternalFrameRect ( self . _frame , self . _docks ) # set max size allowing for sashes and absolute minimum maxsize = frameRect [ 2 : ] [ isHor ] - sum ( sizes ) - ( len ( sizes ) * 10 ) - ( sashSize * len ( sizes ) ) dock . size = min ( p . previousDockSize , maxsize ) else : dock . size = 0 if p . HasFlag ( p . wasMaximized ) : self . MaximizePane ( p , savesizes = False ) p . SetFlag ( p . wasMaximized , False ) if p . HasFlag ( p . needsRestore ) : if p . previousDockPos is not None : DoInsertPane ( dock . panes , dock . dock_direction , dock . dock_layer , dock . dock_row , p . previousDockPos ) p . dock_pos = p . previousDockPos p . previousDockPos = None p . SetFlag ( p . needsRestore , False ) if p . IsDocked ( ) : # remove the pane from any existing docks except this one docks = RemovePaneFromDocks ( docks , p , dock ) # pane needs to be added to the dock, # if it doesn't already exist if not FindPaneInDock ( dock , p . window ) : dock . panes . append ( p ) else : # remove the pane from any existing docks docks = RemovePaneFromDocks ( docks , p ) # remove any empty docks docks = [ dock for dock in docks if dock . panes ] dock_count = len ( docks ) # configure the docks further for ii , dock in enumerate ( docks ) : # sort the dock pane array by the pane's # dock position (dock_pos), in ascending order dock . panes . sort ( PaneSortFunc ) dock_pane_count = len ( dock . panes ) # for newly created docks, set up their initial size if dock . size == 0 : size = 0 for pane in dock . panes : pane_size = pane . best_size if pane_size == wx . Size ( - 1 , - 1 ) : pane_size = pane . min_size if pane_size == wx . Size ( - 1 , - 1 ) and pane . window : pane_size = pane . window . GetSize ( ) if dock . IsHorizontal ( ) : size = max ( pane_size . y , size ) else : size = max ( pane_size . x , size ) # add space for the border (two times), but only # if at least one pane inside the dock has a pane border for pane in dock . panes : if pane . HasBorder ( ) : size = size + pane_border_size * 2 break # if pane is on the top or bottom, add the caption height, # but only if at least one pane inside the dock has a caption if dock . IsHorizontal ( ) : for pane in dock . panes : if pane . HasCaption ( ) and not pane . HasCaptionLeft ( ) : size = size + caption_size break else : for pane in dock . panes : if pane . HasCaptionLeft ( ) and not pane . HasCaption ( ) : size = size + caption_size break # new dock's size may not be more than the dock constraint # parameter specifies.  See SetDockSizeConstraint() max_dock_x_size = int ( self . _dock_constraint_x * float ( cli_size . x ) ) max_dock_y_size = int ( self . _dock_constraint_y * float ( cli_size . y ) ) if cli_size <= wx . Size ( 20 , 20 ) : max_dock_x_size = 10000 max_dock_y_size = 10000 if dock . IsHorizontal ( ) : size = min ( size , max_dock_y_size ) else : size = min ( size , max_dock_x_size ) # absolute minimum size for a dock is 10 pixels if size < 10 : size = 10 dock . size = size # determine the dock's minimum size plus_border = False plus_caption = False plus_caption_left = False dock_min_size = 0 for pane in dock . panes : if pane . min_size != wx . Size ( - 1 , - 1 ) : if pane . HasBorder ( ) : plus_border = True if pane . HasCaption ( ) : plus_caption = True if pane . HasCaptionLeft ( ) : plus_caption_left = True if dock . IsHorizontal ( ) : if pane . min_size . y > dock_min_size : dock_min_size = pane . min_size . y else : if pane . min_size . x > dock_min_size : dock_min_size = pane . min_size . x if plus_border : dock_min_size += pane_border_size * 2 if plus_caption and dock . IsHorizontal ( ) : dock_min_size += caption_size if plus_caption_left and dock . IsVertical ( ) : dock_min_size += caption_size dock . min_size = dock_min_size # if the pane's current size is less than it's # minimum, increase the dock's size to it's minimum if dock . size < dock . min_size : dock . size = dock . min_size # determine the dock's mode (fixed or proportional) # determine whether the dock has only toolbars action_pane_marked = False dock . fixed = True dock . toolbar = True for pane in dock . panes : if not pane . IsFixed ( ) : dock . fixed = False if not pane . IsToolbar ( ) : dock . toolbar = False if pane . HasFlag ( AuiPaneInfo . optionDockFixed ) : dock . fixed = True if pane . HasFlag ( AuiPaneInfo . actionPane ) : action_pane_marked = True # if the dock mode is proportional and not fixed-pixel, # reassign the dock_pos to the sequential 0, 1, 2, 3 # e.g. remove gaps like 1, 2, 30, 500 if not dock . fixed : for jj in xrange ( dock_pane_count ) : pane = dock . panes [ jj ] pane . dock_pos = jj # if the dock mode is fixed, and none of the panes # are being moved right now, make sure the panes # do not overlap each other.  If they do, we will # adjust the panes' positions if dock . fixed and not action_pane_marked : pane_positions , pane_sizes = self . GetPanePositionsAndSizes ( dock ) offset = 0 for jj in xrange ( dock_pane_count ) : pane = dock . panes [ jj ] pane . dock_pos = pane_positions [ jj ] amount = pane . dock_pos - offset if amount >= 0 : offset += amount else : pane . dock_pos += - amount offset += pane_sizes [ jj ] dock . panes [ jj ] = pane if oncheck : self . _docks [ ii ] = dock # shrink docks if needed ##        docks = self.SmartShrink(docks, AUI_DOCK_TOP) ##        docks = self.SmartShrink(docks, AUI_DOCK_LEFT) if oncheck : self . _docks = docks # discover the maximum dock layer max_layer = 0 dock_count = len ( docks ) for ii in xrange ( dock_count ) : max_layer = max ( max_layer , docks [ ii ] . dock_layer ) # clear out uiparts uiparts = [ ] # create a bunch of box sizers, # from the innermost level outwards. cont = None middle = None if oncheck : docks = self . _docks for layer in xrange ( max_layer + 1 ) : # find any docks in this layer arr = FindDocks ( docks , - 1 , layer , - 1 ) # if there aren't any, skip to the next layer if not arr : continue old_cont = cont # create a container which will hold this layer's # docks (top, bottom, left, right) cont = wx . BoxSizer ( wx . VERTICAL ) # find any top docks in this layer arr = FindDocks ( docks , AUI_DOCK_TOP , layer , - 1 ) for row in arr : uiparts = self . LayoutAddDock ( cont , row , uiparts , spacer_only ) # fill out the middle layer (which consists # of left docks, content area and right docks) middle = wx . BoxSizer ( wx . HORIZONTAL ) # find any left docks in this layer arr = FindDocks ( docks , AUI_DOCK_LEFT , layer , - 1 ) for row in arr : uiparts = self . LayoutAddDock ( middle , row , uiparts , spacer_only ) # add content dock (or previous layer's sizer # to the middle if not old_cont : # find any center docks arr = FindDocks ( docks , AUI_DOCK_CENTER , - 1 , - 1 ) if arr : for row in arr : uiparts = self . LayoutAddDock ( middle , row , uiparts , spacer_only ) elif not self . _has_maximized : # there are no center docks, add a background area sizer_item = middle . Add ( ( 1 , 1 ) , 1 , wx . EXPAND ) part = AuiDockUIPart ( ) part . type = AuiDockUIPart . typeBackground part . pane = None part . dock = None part . button = None part . cont_sizer = middle part . sizer_item = sizer_item uiparts . append ( part ) else : middle . Add ( old_cont , 1 , wx . EXPAND ) # find any right docks in this layer arr = FindDocks ( docks , AUI_DOCK_RIGHT , layer , - 1 , reverse = True ) for row in arr : uiparts = self . LayoutAddDock ( middle , row , uiparts , spacer_only ) if len ( middle . GetChildren ( ) ) > 0 : cont . Add ( middle , 1 , wx . EXPAND ) # find any bottom docks in this layer arr = FindDocks ( docks , AUI_DOCK_BOTTOM , layer , - 1 , reverse = True ) for row in arr : uiparts = self . LayoutAddDock ( cont , row , uiparts , spacer_only ) if not cont : # no sizer available, because there are no docks, # therefore we will create a simple background area cont = wx . BoxSizer ( wx . VERTICAL ) sizer_item = cont . Add ( ( 1 , 1 ) , 1 , wx . EXPAND ) part = AuiDockUIPart ( ) part . type = AuiDockUIPart . typeBackground part . pane = None part . dock = None part . button = None part . cont_sizer = middle part . sizer_item = sizer_item uiparts . append ( part ) if oncheck : self . _uiparts = uiparts self . _docks = docks container . Add ( cont , 1 , wx . EXPAND ) if oncheck : return container else : return container , panes , docks , uiparts