Package wx :: Class BoxSizer
[frames | no frames]

Type BoxSizer

object --+        
         |        
    Object --+    
             |    
         Sizer --+
                 |
                BoxSizer

Known Subclasses:
StaticBoxSizer, StdDialogButtonSizer

The basic idea behind a box sizer is that windows will most often be laid out in rather simple basic geometry, typically in a row or a column or nested hierarchies of either. A wx.BoxSizer will lay out its items in a simple row or column, depending on the orientation parameter passed to the constructor.

It is the unique feature of a box sizer, that it can grow in both directions (height and width) but can distribute its growth in the main direction (horizontal for a row) unevenly among its children. This is determined by the proportion parameter give to items when they are added to the sizer. It is interpreted as a weight factor, i.e. it can be zero, indicating that the window may not be resized at all, or above zero. If several windows have a value above zero, the value is interpreted relative to the sum of all weight factors of the sizer, so when adding two windows with a value of 1, they will both get resized equally and each will receive half of the available space after the fixed size items have been sized. If the items have unequal proportion settings then they will receive a coresondingly unequal allotment of the free space.


See Also:

wx.StaticBoxSizer

Method Summary
BoxSizer __init__(self, orient)
Constructor for a wx.BoxSizer.
  __repr__(self)
int GetOrientation(self)
Returns the current orientation of the sizer.
  SetOrientation(self, orient)
Resets the orientation of the sizer.
    Inherited from Sizer
wx.SizerItem Add(self, item, proportion, flag, border, userData)
Appends a child item to the sizer.
  AddItem(self, item)
Adds a wx.SizerItem to the sizer.
  AddMany(self, items)
AddMany is a convenience method for adding several items to a sizer at one time.
  AddSizer(self, *args, **kw)
Compatibility alias for Add.
  AddSpacer(self, *args, **kw)
Compatibility alias for Add.
  AddWindow(self, *args, **kw)
Compatibility alias for Add.
Size CalcMin(self)
This method is where the sizer will do the actual calculation of its children's minimal sizes.
  Clear(self, deleteWindows)
Clear all items from the sizer, optionally destroying the window items as well.
  DeleteWindows(self)
Destroy all windows managed by the sizer.
bool Detach(self, item)
Detaches an item from the sizer without destroying it.
Size Fit(self, window)
Tell the sizer to resize the window to match the sizer's minimal size.
  FitInside(self, window)
Tell the sizer to resize the virtual size of the window to match the sizer's minimal size.
list GetChildren(self)
Returns a list of all the wx.SizerItem objects managed by the sizer.
wx.SizerItem GetItem(self, item)
Returns the wx.SizerItem which holds the item given.
Size GetMinSize(self)
Returns the minimal size of the sizer.
  GetMinSizeTuple(self)
Point GetPosition(self)
Returns the current position of the sizer's managed space.
  GetPositionTuple(self)
Size GetSize(self)
Returns the current size of the space managed by the sizer.
  GetSizeTuple(self)
  Hide(self, item, recursive)
A convenience method for Show (item, False, recursive).
wx.SizerItem Insert(self, before, item, proportion, flag, border, userData)
Inserts a new item into the list of items managed by this sizer before the item at index before.
  InsertItem(self, index, item)
Inserts a wx.SizerItem to the sizer at the position given by index.
  InsertSizer(self, *args, **kw)
Compatibility alias for Insert.
  InsertSpacer(self, *args, **kw)
Compatibility alias for Insert.
  InsertWindow(self, *args, **kw)
Compatibility alias for Insert.
  IsShown(self, item)
Determines if the item is currently shown.
  Layout(self)
This method will force the recalculation and layout of the items controlled by the sizer using the current space allocated to the sizer.
wx.SizerItem Prepend(self, item, proportion, flag, border, userData)
Adds a new item to the begining of the list of sizer items managed by this sizer.
  PrependItem(self, item)
Prepends a wx.SizerItem to the sizer.
  PrependSizer(self, *args, **kw)
Compatibility alias for Prepend.
  PrependSpacer(self, *args, **kw)
Compatibility alias for Prepend.
  PrependWindow(self, *args, **kw)
Compatibility alias for Prepend.
  RecalcSizes(self)
Using the sizes calculated by CalcMin reposition and resize all the items managed by this sizer.
bool Remove(self, item)
Removes an item from the sizer and destroys it.
  RemovePos(self, *args, **kw)
Compatibility alias for Remove.
  RemoveSizer(self, *args, **kw)
Compatibility alias for Remove.
  RemoveWindow(self, *args, **kw)
Compatibility alias for Remove.
  SetDimension(self, x, y, width, height)
Call this to force the sizer to take the given dimension and thus force the items owned by the sizer to resize themselves according to the rules defined by the parameter in the Add, Insert or Prepend methods.
  SetItemMinSize(self, item, size)
Sets the minimum size that will be allocated for an item in the sizer.
  SetMinSize(self, size)
Call this to give the sizer a minimal size.
  SetSizeHints(self, window)
Tell the sizer to set (and Fit) the minimal size of the window to match the sizer's minimal size.
  SetVirtualSizeHints(self, window)
Tell the sizer to set the minimal size of the window virtual area to match the sizer's minimal size.
bool Show(self, item, show, recursive)
Shows or hides an item managed by the sizer.
  ShowItems(self, show)
Recursively call wx.SizerItem.Show on all sizer items.
    Inherited from Object
  Destroy(self)
Deletes the C++ object this Python object is a proxy for.
String GetClassName(self)
Returns the class name of the C++ class using wxRTTI.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
Return hash(x)...
  __new__(T, S, ...)
Return a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
Return str(x)...

Method Details

__init__(self, orient=HORIZONTAL)
(Constructor)

Constructor for a wx.BoxSizer. orient may be one of wx.VERTICAL or wx.HORIZONTAL for creating either a column sizer or a row sizer.

Parameters:
orient
           (type=int)

Returns:
BoxSizer
Overrides:
wx.Sizer.__init__

GetOrientation(self)

Returns the current orientation of the sizer.

Returns:
int

SetOrientation(self, orient)

Resets the orientation of the sizer.

Parameters:
orient
           (type=int)


Generated by Epydoc 2.1.20050511.rpd on Sat Jun 16 16:55:06 2007 http://epydoc.sf.net