Inheritance diagram for wx.SizerFlags:
Normally, when you add an item to a sizer via wx.Sizer.Add, you have to specify a lot of flags and parameters which can be unwieldy. This is where wx.SizerFlags comes in: it allows you to specify all parameters using the named methods instead. For example, instead of:
sizer.Add(ctrl, 0, wx.EXPAND | wx.BORDER, 10)
You can now write:
sizer.Add(ctrl, wx.SizerFlags().Expand().Border(10))
This is more readable and also allows you to create wx.SizerFlags objects which can be reused for several sizer items:
flagsExpand = wx.SizerFlags(1)
flagsExpand.Expand().Border(10)
sizer.Add(ctrl1, flagsExpand)
sizer.Add(ctrl2, flagsExpand)
Note
Note that by specification, all methods of wx.SizerFlags return the wx.SizerFlags object itself to allowing chaining multiple methods calls like in the examples above.
Constructs the flags object with the specified proportion.
Parameters:
Returns:
Sets the alignment of this wx.SizerFlags to align.
Parameters:
Returns:
Note
Note that if this method is not called, the wx.SizerFlags has no specified alignment.
Sets the wx.SizerFlags to have a border of a number of pixels specified by borderinpixels with the directions specified by direction.
Parameters:
Returns:
Aligns the object to the bottom of the available space, a shortcut for calling Align (wx.ALIGN_BOTTOM).
Returns:
Sets the object of the wx.SizerFlags to center itself in the area it is given.
Returns:
Sets the border in the given direction having twice the default border size.
Parameters:
Returns:
Sets the border in left and right directions having twice the default border size.
Returns:
Sets the object of the wx.SizerFlags to expand to fill as much area as it can.
Returns:
Set the wx.FIXED_MINSIZE flag which indicates that the initial size of the window should be also set as its minimal size.
Returns:
Returns the border value in pixels to be used in the sizer item.
Returns:
int
Returns the flags value to be used in the sizer item.
Returns:
int
Returns the proportion value to be used in the sizer item.
Returns:
int
Sets the left and right borders to the default border size.
Returns:
See also
Sets the proportion of this wx.SizerFlags to proportion.
Parameters:
Returns:
Set the wx.RESERVE_SPACE_EVEN_IF_HIDDEN flag in wx.Sizer.
Normally wx.Sizers don’t allocate space for hidden windows or other items. This flag overrides this behavior so that sufficient space is allocated for the window even if it isn’t visible. This makes it possible to dynamically show and hide controls without resizing parent dialog, for example.
This function is new since wxWidgets version 2.8.8
Returns:
See also
See also
Set the wx.SHAPED flag which indicates that the elements should always keep the fixed width to height ratio equal to its original value.
Returns:
Aligns the object to the top of the available space, a shortcut for calling Align (wx.ALIGN_TOP).
Returns:
Sets the border in the given direction having thrice the default border size.
Parameters:
Returns: