parameters: (self, text=None)
docstring: Recreates the :class:`ButtonPanel` sizer accordingly to the alignment specified.
  
          :param string `text`: the text to display as main caption. If `text` is set to ``None``,
           the main caption will not be displayed.
docstring_summary: Recreates the :class:`ButtonPanel` sizer accordingly to the alignment specified.
docstring_tokens: Recreates the : class : ButtonPanel sizer accordingly to the alignment specified .
function: def ReCreateSizer(self, text=None):
          """
          Recreates the :class:`ButtonPanel` sizer accordingly to the alignment specified.
  
          :param string `text`: the text to display as main caption. If `text` is set to ``None``,
           the main caption will not be displayed.
          """
          
          children = self._mainsizer.GetChildren()
          self.RemoveAllButtons()
          self.RemoveAllSeparators()
  
          # Create a new sizer depending on the alignment chosen
          direction = (self.IsVertical() and [wx.VERTICAL] or [wx.HORIZONTAL])[0]            
          self._mainsizer = BoxSizer(direction)
  
          margins = self._art.GetMetric(BP_MARGINS_SIZE)
          # First spacer to create some room before the first text/button/control
          self._mainsizer.Add((margins.x, margins.y), 0)
          
          # Last spacer to create some room before the last text/button/control
          self._mainsizer.Add((margins.x, margins.y), 0)
                  
          # This is needed otherwise SetBarText goes mad        
          self._controlCreated = False
  
          for child in children:
              userData = child.GetUserData()
              if userData:
                  if isinstance(userData, ButtonInfo):
                      # It is a ButtonInfo, can't be anything else
                      self.AddButton(child.GetUserData())
                  elif isinstance(userData, Separator):
                      self.AddSeparator()
                      
              else:
                  if child.IsSpacer():
                      # This is a spacer, expandable or not
                      self.AddSpacer(child.GetSize(), child.GetProportion(),
                                     child.GetFlag())
                  else:
                      # This is a wxPython control
                      self.AddControl(child.GetWindow(), child.GetProportion(),
                                      child.GetFlag(), child.GetBorder())
  
          self.SetSizer(self._mainsizer)
  
          if text is not None:
              self.SetBarText(text)
          
          self.DoLayout()
          
          self.Thaw()
function_tokens: def ReCreateSizer ( self , text = None ) : children = self . _mainsizer . GetChildren ( ) self . RemoveAllButtons ( ) self . RemoveAllSeparators ( ) # Create a new sizer depending on the alignment chosen direction = ( self . IsVertical ( ) and [ wx . VERTICAL ] or [ wx . HORIZONTAL ] ) [ 0 ] self . _mainsizer = BoxSizer ( direction ) margins = self . _art . GetMetric ( BP_MARGINS_SIZE ) # First spacer to create some room before the first text/button/control self . _mainsizer . Add ( ( margins . x , margins . y ) , 0 ) # Last spacer to create some room before the last text/button/control self . _mainsizer . Add ( ( margins . x , margins . y ) , 0 ) # This is needed otherwise SetBarText goes mad         self . _controlCreated = False for child in children : userData = child . GetUserData ( ) if userData : if isinstance ( userData , ButtonInfo ) : # It is a ButtonInfo, can't be anything else self . AddButton ( child . GetUserData ( ) ) elif isinstance ( userData , Separator ) : self . AddSeparator ( ) else : if child . IsSpacer ( ) : # This is a spacer, expandable or not self . AddSpacer ( child . GetSize ( ) , child . GetProportion ( ) , child . GetFlag ( ) ) else : # This is a wxPython control self . AddControl ( child . GetWindow ( ) , child . GetProportion ( ) , child . GetFlag ( ) , child . GetBorder ( ) ) self . SetSizer ( self . _mainsizer ) if text is not None : self . SetBarText ( text ) self . DoLayout ( ) self . Thaw ( )