back to gui 

wxSizerFlags

generated from ../src/mod_gui/misc/sizerflag.cpp

Normally, when you add an item to a sizer via add, you have to specify a lot of flags and parameters which can be unwieldy. This is where wxSizerFlags comes in: it allows you to specify all parameters using the named methods instead. For example, instead of


   sizer.add(ctrl, 0, wxStretch.EXPAND, 10);
  
you can now write

   sizer.add(ctrl, wxSizerFlags().expand().border(10));
  
This is more readable and also allows you to create wxSizerFlags objects which can be reused for several sizer items.

   wxSizerFlags flagsExpand = new wxSizerFlags(1);
   flagsExpand.Expand().Border(10);

   sizer.add(ctrl1, flagsExpand);
   sizer.add(ctrl2, flagsExpand);
  
Note that by specification, all methods of wxSizerFlags return the wxSizerFlags object itself to allowing chaining multiple methods calls like in the examples above.

Constants

Constructor

wxSizerFlags

wxSizerFlags(Proportion = 0)
 
Name Type Default Description
Proportion Integer 0

Creates the wxSizer with the proportion. The constructor can also be called without the 'new' keyword.

Methods

align

align(Align = 0) : wxSizerFlags
 
Name Type Default Description
Align Integer 0 See wxAlignment

Sets the alignment of this wxSizerFlags.

border

border(Direction = wxDirection.ALL) : wxSizerFlags
 
Name Type Default Description
Direction Integer wxDirection.ALL See wxDirection
border(Direction, 
       BorderInPixels) : wxSizerFlags
 
Name Type Default Description
Direction Integer
BorderInPixels Integer

Sets the wxSizerFlags to have a border of a number of pixels specified by BorderInPixels with the directions specified by Direction.

center

center() : wxSizerFlags
 

Sets the object of the wxSizerFlags to center itself in the area it is given.

doubleBorder

doubleBorder(Direction = wxDirection.ALL) : wxSizerFlags
 
Name Type Default Description
Direction Integer wxDirection.ALL See wxDirection

Sets the border in the given direction having twice the default border size.

doubleHorzBorder

doubleHorzBorder() : wxSizerFlags
 

Sets the border in left and right directions having twice the default border size.

expand

expand() : wxSizerFlags
 

Sets the object of the wxSizerFlags to expand to fill as much area as it can.

fixedMinSize

fixedMinSize() : wxSizerFlags
 

Set the wxStretch.FIXED_MINSIZE flag which indicates that the initial size of the window should be also set as its minimal size.

left

left() : wxSizerFlags
 

Aligns the object to the left, shortcut for 'align(wxAlignment.LEFT)'

proportion

proportion(Proportion = 0) : wxSizerFlags
 
Name Type Default Description
Proportion Integer 0

Sets the proportion of this wxSizerFlags.

right

right() : wxSizerFlags
 

Aligns the object to the right, shortcut for 'align(wxAlignment.RIGHT)'

shaped

shaped() : wxSizerFlags
 

Set the wxStretch.SHAPED which indicates that the elements should always keep the fixed width to height ratio equal to its original value.

tripleBorder

tripleBorder(Direction = wxDirection.ALL) : wxSizerFlags
 
Name Type Default Description
Direction Integer wxDirection.ALL See wxDirection

Sets the border in the given direction having thrice the default border size.




Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.