wx.SizerItem

Inheritance diagram for 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

Known Subclasses

wx.GBSizerItem

Class API

Methods

__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


CalcMin()

Calculates the minimum desired size for the item, including any space needed by borders.


Returns:

wx.Size


DeleteWindows()
Destroy the window or the windows in a subsizer, depending on the type of item.

DetachSizer()
Enable deleting the SizerItem without destroying the contained sizer.

GetBorder()

Return the border attribute.


Returns:

int


GetFlag()

Return the flags attribute.


Returns:

int


GetMinSize()

Get the minimum size needed for the item.


Returns:

wx.Size


GetMinSizeWithBorder()

Get the minimum size needed for the item with space for the borders added, if needed.


Returns:

wx.Size


GetPosition()

What is the current position of the item, as set in the last Layout().


Returns:

wx.Point


GetProportion()

Get the proportion item attribute.


Returns:

int


GetRatio()

Get the ration item attribute.


Returns:

float


GetRect()

Get the rectangle of the item on the parent window, excluding borders.


Returns:

wx.Rect


GetSize()

Get the current size of the item, as set in the last Layout().


Returns:

wx.Size


GetSizer()

If this item is tracking a sizer, return it. Returns None otherwise.


Returns:

wx.Sizer


GetSpacer()

If this item is tracking a spacer, return its size.


Returns:

wx.Size


GetUserData()

Get the userData item attribute.


Returns:

PyObject


GetWindow()

If this item is tracking a window then return it. Returns None otherwise.


Returns:

wx.Window


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


IsSizer()

Is this item a sizer?


Returns:

bool


IsSpacer()

Is this item a spacer?


Returns:

bool


IsWindow()

Is this item a window?


Returns:

bool


SetBorder(border)

Set the border item attribute.

Parameters:

  • border (int)

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:


SetFlag(flag)

Set the flag item attribute.

Parameters:

  • flag (int)

SetInitSize(x, y)

Parameters:

  • x (int)
  • y (int)

SetProportion(proportion)

Set the proportion item attribute.

Parameters:

  • proportion (int)

SetRatio(width)

Set the ratio item attribute.

Parameters:

  • width (int)

SetRatioSize(size)

Set the ratio item attribute.

Parameters:


SetRatioWH(width, height)

Set the ratio item attribute.

Parameters:

  • width (int)
  • height (int)

SetSizer(sizer)

Set the sizer tracked by this item.

Parameters:


SetSpacer(size)

Set the size of the spacer tracked by this item.

Parameters:


SetUserData(userData)

Associate a Python object with this sizer item.

Parameters:

  • userData (PyObject)

SetWindow(window)

Set the window to be tracked by this item.

Parameters:


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

Border
See GetBorder and SetBorder
Flag
See GetFlag and SetFlag
MinSize
See GetMinSize
MinSizeWithBorder
See GetMinSizeWithBorder
Position
See GetPosition
Proportion
See GetProportion and SetProportion
Ratio
See GetRatio and SetRatio
Rect
See GetRect
Size
See GetSize
Sizer
See GetSizer and SetSizer
Spacer
See GetSpacer and SetSpacer
UserData
See GetUserData and SetUserData
Window
See GetWindow and SetWindow