wx.Sizer Class Reference

Inheritance diagram for wx.Sizer:

wx.Object wx.BoxSizer wx.GridSizer wx.StaticBoxSizer wx.FlexGridSizer wx.GridBagSizer

List of all members.

Public Member Functions

void Add (int width, int height, int proportion, SizerFlag flag, int border, Object userData)
void Add (int width, int height, int proportion, SizerFlag flag, int border)
void Add (int width, int height)
void Add (Sizer sizer, int proportion, SizerFlag flag, int border, Object userData)
void Add (Sizer sizer, int proportion, SizerFlag flag, int border)
void Add (Sizer sizer, int proportion, SizerFlag flag)
void Add (Sizer sizer)
void Add (Window window, int proportion, SizerFlag flag, int border, Object userData)
void Add (Window window, int proportion, SizerFlag flag, int border)
void Add (Window window, int proportion, SizerFlag flag)
void Add (Window window)
virtual Size CalcMin ()
void Clear (bool delete_windows)
void DeleteWindows ()
bool Detach (int index)
bool Detach (Sizer sizer)
bool Detach (Window window)
Size Fit (Window window)
void FitInside (Window window)
void Hide (Sizer sizer)
void Hide (Window window)
void Insert (int before, int width, int height, int option, SizerFlag flag, int border, Object userData)
void Insert (int before, Sizer sizer, int option, SizerFlag flag, int border, Object userData)
void Insert (int before, Window window, int option, SizerFlag flag, int border, Object userData)
bool IsShown (Sizer sizer)
bool IsShown (Window window)
void Layout ()
void Prepend (int width, int height, int option, SizerFlag flag, int border, Object userData)
void Prepend (Sizer sizer, int option, SizerFlag flag, int border, Object userData)
void Prepend (Window window, int option, SizerFlag flag, int border, Object userData)
void Prepend (Window window, int option, SizerFlag flag, int border)
void Prepend (Window window, int option, SizerFlag flag)
void Prepend (Window window, int option)
void Prepend (Window window)
virtual void RecalcSizes ()
bool Remove (int pos)
bool Remove (Sizer sizer)
bool Remove (Window window)
void SetDimension (int x, int y, int width, int height)
bool SetItemMinSize (int pos, Size size)
bool SetItemMinSize (Sizer sizer, Size size)
bool SetItemMinSize (Window window, Size size)
void SetMinSize (Size size)
void SetSizeHints (Window window)
void SetVirtualSizeHints (Window window)
void Show (bool show)
void Show (Sizer sizer, bool show)
void Show (Window window, bool show)

Properties

Size MinSize [get]
Point Position [get]
Size Size [get]


Detailed Description

wx.Sizer is the abstract base class used for laying out subwindows in a window. You cannot use wx.Sizer directly; instead, you will have to use one of the sizer classes derived from it. Currently there are wx.BoxSizer, wx.StaticBoxSizer, wx.GridSizer wx.FlexGridSizer and wx.GridBagSizer.

The layout algorithm used by sizers in wxWidgets is closely related to layout in other GUI toolkits, such as Java's AWT, the GTK toolkit or the Qt toolkit. It is based upon the idea of the individual subwindows reporting their minimal required size and their ability to get stretched if the size of the parent window has changed. This will most often mean that the programmer does not set the original size of a dialog in the beginning, rather the dialog will be assigned a sizer and this sizer will be queried about the recommended size. The sizer in turn will query its children, which can be normal windows, empty space or other sizers, so that a hierarchy of sizers can be constructed. Note that wx.Sizer does not derive from wxWindow and thus does not interfere with tab ordering and requires very little resources compared to a real window on screen.

What makes sizers so well fitted for use in wxWidgets is the fact that every control reports its own minimal size and the algorithm can handle differences in font sizes or different window (dialog item) sizes on different platforms without problems. If e.g. the standard font as well as the overall design of Motif widgets requires more space than on Windows, the initial dialog size will automatically be bigger on Motif than on Windows.

Sizers may also be used to control the layout of custom drawn items on the window. The Add, Insert, and Prepend functions return a pointer to the newly added wxSizerItem. Just add empty space of the desired size and attributes, and then use the wxSizerItem.GetRect method to determine where the drawing operations should take place.

Please notice that sizers, like child windows, are owned by the library and will be deleted by it which implies that they must be allocated on the heap. However if you create a sizer and do not add it to another sizer or window, the library wouldn't be able to delete such an orphan sizer and in this, and only this, case it should be deleted explicitly.


Member Function Documentation

void wx.Sizer.Add ( int  width,
int  height,
int  proportion,
SizerFlag  flag,
int  border,
Object  userData 
)

Adds free space.

Parameters:
width Width of the free space.
height Height of the inserted space.
proportion 1 for components that increase their size with the composite.
flag Bit-flags from wx.Stretch, wx.Orientation and wx.Alignment.
border width of blank space around the inserted window.

void wx.Sizer.Add ( int  width,
int  height,
int  proportion,
SizerFlag  flag,
int  border 
)

Adds free space.

Parameters:
width Width of the free space.
height Height of the inserted space.
proportion 1 for components that increase their size with the composite.
flag Bit-flags from wx.Stretch, wx.Orientation and wx.Alignment.
border width of blank space around the inserted window.

void wx.Sizer.Add ( int  width,
int  height 
)

Adds free space.

Parameters:
width Width of the free space.
height Height of the inserted space.

void wx.Sizer.Add ( Sizer  sizer,
int  proportion,
SizerFlag  flag,
int  border,
Object  userData 
)

void wx.Sizer.Add ( Sizer  sizer,
int  proportion,
SizerFlag  flag,
int  border 
)

void wx.Sizer.Add ( Sizer  sizer,
int  proportion,
SizerFlag  flag 
)

void wx.Sizer.Add ( Sizer  sizer  ) 

void wx.Sizer.Add ( Window  window,
int  proportion,
SizerFlag  flag,
int  border,
Object  userData 
)

Adds a component to the sizer.

Parameters:
proportion 1 for components that increase their size with the composite.
flag Bit-flags from wx.Stretch, wx.Orientation and wx.Alignment.
border width of blank space around the inserted window.

void wx.Sizer.Add ( Window  window,
int  proportion,
SizerFlag  flag,
int  border 
)

Adds a component to the sizer.

Parameters:
proportion 1 for components that increase their size with the composite.
flag Bit-flags from wx.Stretch, wx.Orientation and wx.Alignment.
border width of blank space around the inserted window.

void wx.Sizer.Add ( Window  window,
int  proportion,
SizerFlag  flag 
)

Adds a component to the sizer.

Parameters:
proportion 1 for components that increase their size with the composite.
flag Bit-flags from wx.Stretch, wx.Orientation and wx.Alignment.

void wx.Sizer.Add ( Window  window  ) 

virtual Size wx.Sizer.CalcMin (  )  [virtual]

Reimplemented in wx.FlexGridSizer, and wx.GridSizer.

void wx.Sizer.Clear ( bool  delete_windows  ) 

void wx.Sizer.DeleteWindows (  ) 

bool wx.Sizer.Detach ( int  index  ) 

bool wx.Sizer.Detach ( Sizer  sizer  ) 

bool wx.Sizer.Detach ( Window  window  ) 

Size wx.Sizer.Fit ( Window  window  ) 

Tell the sizer to resize the window to match the sizer's minimal size. This is commonly done in the constructor of the window itself, see sample in the description of wx.BoxSizer. Returns the new size.

For a top level window this is the total window size, not client size.

Parameters:
window 
Returns:

void wx.Sizer.FitInside ( Window  window  ) 

Tell the sizer to resize the virtual size of the window to match the sizer's minimal size. This will not alter the on screen size of the window, but may cause the addition/removal/alteration of scrollbars required to view the virtual area in windows which manage it.

Parameters:
window 

void wx.Sizer.Hide ( Sizer  sizer  ) 

void wx.Sizer.Hide ( Window  window  ) 

void wx.Sizer.Insert ( int  before,
int  width,
int  height,
int  option,
SizerFlag  flag,
int  border,
Object  userData 
)

void wx.Sizer.Insert ( int  before,
Sizer  sizer,
int  option,
SizerFlag  flag,
int  border,
Object  userData 
)

void wx.Sizer.Insert ( int  before,
Window  window,
int  option,
SizerFlag  flag,
int  border,
Object  userData 
)

bool wx.Sizer.IsShown ( Sizer  sizer  ) 

bool wx.Sizer.IsShown ( Window  window  ) 

void wx.Sizer.Layout (  ) 

void wx.Sizer.Prepend ( int  width,
int  height,
int  option,
SizerFlag  flag,
int  border,
Object  userData 
)

void wx.Sizer.Prepend ( Sizer  sizer,
int  option,
SizerFlag  flag,
int  border,
Object  userData 
)

void wx.Sizer.Prepend ( Window  window,
int  option,
SizerFlag  flag,
int  border,
Object  userData 
)

void wx.Sizer.Prepend ( Window  window,
int  option,
SizerFlag  flag,
int  border 
)

void wx.Sizer.Prepend ( Window  window,
int  option,
SizerFlag  flag 
)

void wx.Sizer.Prepend ( Window  window,
int  option 
)

void wx.Sizer.Prepend ( Window  window  ) 

virtual void wx.Sizer.RecalcSizes (  )  [virtual]

Reimplemented in wx.BoxSizer, wx.FlexGridSizer, and wx.GridSizer.

bool wx.Sizer.Remove ( int  pos  ) 

bool wx.Sizer.Remove ( Sizer  sizer  ) 

bool wx.Sizer.Remove ( Window  window  ) 

void wx.Sizer.SetDimension ( int  x,
int  y,
int  width,
int  height 
)

bool wx.Sizer.SetItemMinSize ( int  pos,
Size  size 
)

bool wx.Sizer.SetItemMinSize ( Sizer  sizer,
Size  size 
)

bool wx.Sizer.SetItemMinSize ( Window  window,
Size  size 
)

void wx.Sizer.SetMinSize ( Size  size  ) 

void wx.Sizer.SetSizeHints ( Window  window  ) 

This will cause the layout to honour minimal size of window. Note: First assign the sizer. Then, set size hints.

This method first calls wx.Sizer.Fit and then SetSizeHints on the window passed to it. This only makes sense when window is actually a top level window such as a wx.Frame or a wx.Dialog, since SetSizeHints only has any effect in these classes. It does nothing in normal windows or controls.

This method is commonly invoked in the constructor of a toplevel window itself if the toplevel window is resizable.

void wx.Sizer.SetVirtualSizeHints ( Window  window  ) 

void wx.Sizer.Show ( bool  show  ) 

void wx.Sizer.Show ( Sizer  sizer,
bool  show 
)

void wx.Sizer.Show ( Window  window,
bool  show 
)


Property Documentation

Size wx.Sizer.MinSize [get]

Point wx.Sizer.Position [get]

Size wx.Sizer.Size [get]


Manual of the wx.NET   (c) 2003-2011 the wx.NET project at   Get wx.NET at SourceForge.net. Fast, secure and Free Open Source software downloads