************ wx.SizerItem ************ Inheritance diagram for `wx.SizerItem`: | .. inheritance-diagram:: wx.SizerItem | Description =========== The `wx.SizerItem` class is used to track the position, size and other attributes of each item managed by a `wx.Sizer `_. It is not usually necessary to use this class because the sizer elements can also be identified by their positions or window or sizer pointers but sometimes it may be more convenient to use it directly. Also, custom classes derived from `wx.PySizer `_ will probably need to use the collection of `wx.SizerItems` held by `wx.Sizer` when calculating layout. Derived From ^^^^^^^^^^^^^ * `wx.Object `_ Known Subclasses ^^^^^^^^^^^^^^^^ `wx.GBSizerItem `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `CalcMin <#CalcMin>`_ * `DeleteWindows <#DeleteWindows>`_ * `DetachSizer <#DetachSizer>`_ * `GetBorder <#GetBorder>`_ * `GetFlag <#GetFlag>`_ * `GetMinSize <#GetMinSize>`_ * `GetMinSizeWithBorder <#GetMinSizeWithBorder>`_ * `GetPosition <#GetPosition>`_ * `GetProportion <#GetProportion>`_ * `GetRatio <#GetRatio>`_ * `GetRect <#GetRect>`_ * `GetSize <#GetSize>`_ * `GetSizer <#GetSizer>`_ * `GetSpacer <#GetSpacer>`_ * `GetUserData <#GetUserData>`_ * `GetWindow <#GetWindow>`_ * `IsShown <#IsShown>`_ * `IsSizer <#IsSizer>`_ * `IsSpacer <#IsSpacer>`_ * `IsWindow <#IsWindow>`_ * `SetBorder <#SetBorder>`_ * `SetDimension <#SetDimension>`_ * `SetFlag <#SetFlag>`_ * `SetInitSize <#SetInitSize>`_ * `SetProportion <#SetProportion>`_ * `SetRatio <#SetRatio>`_ * `SetRatioSize <#SetRatioSize>`_ * `SetRatioWH <#SetRatioWH>`_ * `SetSizer <#SetSizer>`_ * `SetSpacer <#SetSpacer>`_ * `SetUserData <#SetUserData>`_ * `SetWindow <#SetWindow>`_ * `Show <#Show>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Border <#Border>`_ * `Flag <#Flag>`_ * `MinSize <#MinSize>`_ * `MinSizeWithBorder <#MinSizeWithBorder>`_ * `Position <#Position>`_ * `Proportion <#Proportion>`_ * `Ratio <#Ratio>`_ * `Rect <#Rect>`_ * `Size <#Size>`_ * `Sizer <#Sizer>`_ * `Spacer <#Spacer>`_ * `UserData <#UserData>`_ * `Window <#Window>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__() Constructs an empty `wx.SizerItem`. Either a window, sizer or spacer size will need to be set before this item can be used in a Sizer. You will probably never need to create a `wx.SizerItem` directly as they are created automatically when the sizer's `Add `_, `Insert `_ or `Prepend `_ methods are called. | **Returns:** `wx.SizerItem `_ .. seealso:: `wx.SizerItemSpacer <../wxFunctions.html#SizerItemSpacer>`_, `wx.SizerItemWindow <../wxFunctions.html#SizerItemWindow>`_, `wx.SizerItemSizer <../wxFunctions.html#SizerItemSizer>`_ -------- .. method:: CalcMin() Calculates the minimum desired size for the item, including any space needed by borders. | **Returns:** `wx.Size `_ -------- .. method:: DeleteWindows() Destroy the window or the windows in a subsizer, depending on the type of item. -------- .. method:: DetachSizer() Enable deleting the SizerItem without destroying the contained sizer. -------- .. method:: GetBorder() Return the border attribute. | **Returns:** `int` -------- .. method:: GetFlag() Return the flags attribute. | **Returns:** `int` -------- .. method:: GetMinSize() Get the minimum size needed for the item. | **Returns:** `wx.Size `_ -------- .. method:: GetMinSizeWithBorder() Get the minimum size needed for the item with space for the borders added, if needed. | **Returns:** `wx.Size `_ -------- .. method:: GetPosition() What is the current position of the item, as set in the last `Layout()`. | **Returns:** `wx.Point `_ -------- .. method:: GetProportion() Get the proportion item attribute. | **Returns:** `int` -------- .. method:: GetRatio() Get the ration item attribute. | **Returns:** `float` -------- .. method:: GetRect() Get the rectangle of the item on the parent window, excluding borders. | **Returns:** `wx.Rect `_ -------- .. method:: GetSize() Get the current size of the item, as set in the last `Layout()`. | **Returns:** `wx.Size `_ -------- .. method:: GetSizer() If this item is tracking a sizer, return it. Returns ``None`` otherwise. | **Returns:** `wx.Sizer `_ -------- .. method:: GetSpacer() If this item is tracking a spacer, return its size. | **Returns:** `wx.Size `_ -------- .. method:: GetUserData() Get the userData item attribute. | **Returns:** `PyObject` -------- .. method:: GetWindow() If this item is tracking a window then return it. Returns ``None`` otherwise. | **Returns:** `wx.Window `_ -------- .. method:: IsShown() Returns ``True`` if this item is a window or a spacer and it is shown or if this item is a sizer and not all its elements are hidden. In other words, for sizer items, all of the child elements must be hidden for the sizer itself to be considered hidden. | **Returns:** `bool` -------- .. method:: IsSizer() Is this item a sizer? | **Returns:** `bool` -------- .. method:: IsSpacer() Is this item a spacer? | **Returns:** `bool` -------- .. method:: IsWindow() Is this item a window? | **Returns:** `bool` -------- .. method:: SetBorder(border) Set the border item attribute. **Parameters:** * `border` (int) -------- .. method:: SetDimension(pos, size) Set the position and size of the space allocated to the sizer, and adjust the position and size of the item to be within that space taking alignment and borders into account. **Parameters:** * `pos` (`wx.Point `_) * `size` (`wx.Size `_) -------- .. method:: SetFlag(flag) Set the flag item attribute. **Parameters:** * `flag` (int) -------- .. method:: SetInitSize(x, y) | **Parameters:** * `x` (int) * `y` (int) -------- .. method:: SetProportion(proportion) Set the proportion item attribute. **Parameters:** * `proportion` (int) -------- .. method:: SetRatio(width) Set the ratio item attribute. **Parameters:** * `width` (int) -------- .. method:: SetRatioSize(size) Set the ratio item attribute. **Parameters:** * `size` (`wx.Size `_) -------- .. method:: SetRatioWH(width, height) Set the ratio item attribute. **Parameters:** * `width` (int) * `height` (int) -------- .. method:: SetSizer(sizer) Set the sizer tracked by this item. **Parameters:** * `sizer` (`wx.Sizer `_) -------- .. method:: SetSpacer(size) Set the size of the spacer tracked by this item. **Parameters:** * `size` (`wx.Size `_) -------- .. method:: SetUserData(userData) Associate a Python object with this sizer item. **Parameters:** * `userData` (PyObject) -------- .. method:: SetWindow(window) Set the window to be tracked by this item. **Parameters:** * `window` (`wx.Window `_) -------- .. method:: Show() Set the show item attribute, which sizers use to determine if the item is to be made part of the layout or not. If the item is tracking a window then it is shown or hidden as needed. -------- Properties ^^^^^^^^^^ .. attribute:: Border See `GetBorder <#GetBorder>`_ and `SetBorder <#SetBorder>`_ .. attribute:: Flag See `GetFlag <#GetFlag>`_ and `SetFlag <#SetFlag>`_ .. attribute:: MinSize See `GetMinSize <#GetMinSize>`_ .. attribute:: MinSizeWithBorder See `GetMinSizeWithBorder <#GetMinSizeWithBorder>`_ .. attribute:: Position See `GetPosition <#GetPosition>`_ .. attribute:: Proportion See `GetProportion <#GetProportion>`_ and `SetProportion <#SetProportion>`_ .. attribute:: Ratio See `GetRatio <#GetRatio>`_ and `SetRatio <#SetRatio>`_ .. attribute:: Rect See `GetRect <#GetRect>`_ .. attribute:: Size See `GetSize <#GetSize>`_ .. attribute:: Sizer See `GetSizer <#GetSizer>`_ and `SetSizer <#SetSizer>`_ .. attribute:: Spacer See `GetSpacer <#GetSpacer>`_ and `SetSpacer <#SetSpacer>`_ .. attribute:: UserData See `GetUserData <#GetUserData>`_ and `SetUserData <#SetUserData>`_ .. attribute:: Window See `GetWindow <#GetWindow>`_ and `SetWindow <#SetWindow>`_