************* wx.SizerFlags ************* Inheritance diagram for `wx.SizerFlags`: | .. inheritance-diagram:: wx.SizerFlags | Description =========== 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. Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `Align <#Align>`_ * `Border <#Border>`_ * `Bottom <#Bottom>`_ * `Center <#Center>`_ * `Centre <#Centre>`_ * `DoubleBorder <#DoubleBorder>`_ * `DoubleHorzBorder <#DoubleHorzBorder>`_ * `Expand <#Expand>`_ * `FixedMinSize <#FixedMinSize>`_ * `GetBorderInPixels <#GetBorderInPixels>`_ * `GetDefaultBorder <#GetDefaultBorder>`_ * `GetFlags <#GetFlags>`_ * `GetProportion <#GetProportion>`_ * `HorzBorder <#HorzBorder>`_ * `Left <#Left>`_ * `Proportion <#Proportion>`_ * `ReserveSpaceEvenIfHidden <#ReserveSpaceEvenIfHidden>`_ * `Right <#Right>`_ * `Shaped <#Shaped>`_ * `Top <#Top>`_ * `TripleBorder <#TripleBorder>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(proportion=0) Constructs the flags object with the specified proportion. **Parameters:** * `proportion` (int) | **Returns:** `wx.SizerFlags `_ -------- .. method:: Align(align=0) Sets the alignment of this `wx.SizerFlags` to `align`. **Parameters:** * `align` (int) | **Returns:** `wx.SizerFlags `_ .. note:: Note that if this method is not called, the `wx.SizerFlags` has no specified alignment. .. seealso:: `Left <#Left>`_, `Right <#Right>`_, `Centre <#Centre>`_ -------- .. method:: Border(direction=wx.ALL, borderinpixels=-1) Sets the `wx.SizerFlags` to have a border of a number of pixels specified by `borderinpixels` with the directions specified by `direction`. **Parameters:** * `direction` (int) * `borderinpixels` (int) | **Returns:** `wx.SizerFlags `_ -------- .. method:: Bottom() Aligns the object to the bottom of the available space, a shortcut for calling `Align <#Align>`_ (``wx.ALIGN_BOTTOM``). | **Returns:** `wx.SizerFlags `_ -------- .. method:: Center() Sets the object of the `wx.SizerFlags` to center itself in the area it is given. | **Returns:** `wx.SizerFlags `_ -------- .. method:: Centre() `Center <#Center>`_ for people with the other dialect of english. | **Returns:** `wx.SizerFlags `_ -------- .. method:: DoubleBorder(direction=wx.ALL) Sets the border in the given `direction` having twice the default border size. **Parameters:** * `direction` (int) | **Returns:** `wx.SizerFlags `_ -------- .. method:: DoubleHorzBorder() Sets the border in left and right directions having twice the default border size. | **Returns:** `wx.SizerFlags `_ -------- .. method:: Expand() Sets the object of the `wx.SizerFlags` to expand to fill as much area as it can. | **Returns:** `wx.SizerFlags `_ -------- .. method:: FixedMinSize() Set the ``wx.FIXED_MINSIZE`` flag which indicates that the initial size of the window should be also set as its minimal size. | **Returns:** `wx.SizerFlags `_ -------- .. method:: GetBorderInPixels() Returns the border value in pixels to be used in the sizer item. | **Returns:** `int` -------- .. method:: GetDefaultBorder() Returns the border used by default in `Border <#Border>`_ method. | **Returns:** `int` -------- .. method:: GetFlags() Returns the flags value to be used in the sizer item. | **Returns:** `int` -------- .. method:: GetProportion() Returns the proportion value to be used in the sizer item. | **Returns:** `int` -------- .. method:: HorzBorder() Sets the left and right borders to the default border size. | **Returns:** `wx.SizerFlags `_ -------- .. method:: Left() Aligns the object to the left, shortcut for `Align <#Align>`_ (``wx.ALIGN_LEFT``). | **Returns:** `wx.SizerFlags `_ .. seealso:: `Align <#Align>`_ -------- .. method:: Proportion(proportion=0) Sets the proportion of this `wx.SizerFlags` to `proportion`. **Parameters:** * `proportion` (int) | **Returns:** `wx.SizerFlags `_ -------- .. method:: ReserveSpaceEvenIfHidden() 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:** `wx.SizerFlags `_ .. seealso:: `wx.Sizer.Add `_ -------- .. method:: Right() Aligns the object to the right, shortcut for `Align <#Align>`_ (``wx.ALIGN_RIGHT``). | **Returns:** `wx.SizerFlags `_ .. seealso:: `Align <#Align>`_ -------- .. method:: Shaped() 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:** `wx.SizerFlags `_ -------- .. method:: Top() Aligns the object to the top of the available space, a shortcut for calling `Align <#Align>`_ (``wx.ALIGN_TOP``). | **Returns:** `wx.SizerFlags `_ -------- .. method:: TripleBorder(direction=wx.ALL) Sets the border in the given `direction` having thrice the default border size. **Parameters:** * `direction` (int) | **Returns:** `wx.SizerFlags `_