The wxSizerItem class is used to track the position, size and other attributes of each item managed by a wxSizer. 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.
Derived from
Include files
<wx/sizer.h>
Members
wxSizerItem::wxSizerItem
wxSizerItem::~wxSizerItem
wxSizerItem::CalcMin
wxSizerItem::DeleteWindows
wxSizerItem::DetachSizer
wxSizerItem::GetBorder
wxSizerItem::GetFlag
wxSizerItem::GetMinSize
wxSizerItem::GetPosition
wxSizerItem::GetProportion
wxSizerItem::GetRatio
wxSizerItem::GetRect
wxSizerItem::GetSize
wxSizerItem::GetSizer
wxSizerItem::GetSpacer
wxSizerItem::GetUserData
wxSizerItem::GetWindow
wxSizerItem::IsSizer
wxSizerItem::IsShown
wxSizerItem::IsSpacer
wxSizerItem::IsWindow
wxSizerItem::SetBorder
wxSizerItem::SetDimension
wxSizerItem::SetFlag
wxSizerItem::SetInitSize
wxSizerItem::SetProportion
wxSizerItem::SetRatio
wxSizerItem::SetSizer
wxSizerItem::SetSpacer
wxSizerItem::SetWindow
wxSizerItem::Show
wxSizerItem(int width, int height, int proportion, int flag, int border, wxObject* userData)
Construct a sizer item for tracking a spacer.
wxSizerItem(wxWindow* window, const wxSizerFlags& flags)
wxSizerItem(wxWindow* window, int proportion, int flag, int border, wxObject* userData)
Construct a sizer item for tracking a window.
wxSizerItem(wxSizer* window, const wxSizerFlags& flags)
wxSizerItem(wxSizer* sizer, int proportion, int flag, int border, wxObject* userData)
Construct a sizer item for tracking a subsizer.
~wxSizerItem()
Deletes the user data and subsizer, if any.
wxSize CalcMin()
Calculates the minimum desired size for the item, including any space needed by borders.
void DeleteWindows()
Destroy the window or the windows in a subsizer, depending on the type of item.
void DetachSizer()
Enable deleting the SizerItem without destroying the contained sizer.
int GetBorder() const
Return the border attribute.
int GetFlag() const
Return the flags attribute.
wxSize GetMinSize() const
Get the minimum size needed for the item.
wxPoint GetPosition() const
What is the current position of the item, as set in the last Layout.
int GetProportion() const
Get the proportion item attribute.
float GetRatio() const
Get the ration item attribute.
wxRect GetRect()
Get the rectangle of the item on the parent window, excluding borders.
wxSize GetSize() const
Get the current size of the item, as set in the last Layout.
wxSizer* GetSizer() const
If this item is tracking a sizer, return it. NULL otherwise.
const wxSize& GetSpacer() const
If this item is tracking a spacer, return its size.
wxObject* GetUserData() const
Get the userData item attribute.
wxWindow* GetWindow() const
If this item is tracking a window then return it. NULL otherwise.
bool IsSizer() const
Is this item a sizer?
bool IsShown() const
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.
bool IsSpacer() const
Is this item a spacer?
bool IsWindow() const
Is this item a window?
void SetBorder(int border)
Set the border item attribute.
void SetDimension(const wxPoint& pos, const wxSize& 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.
void SetFlag(int flag)
Set the flag item attribute.
void SetInitSize(int x, int y)
void SetProportion(int proportion)
Set the proportion item attribute.
void SetRatio(int width, int height)
void SetRatio(wxSize size)
void SetRatio(float ratio)
Set the ratio item attribute.
void SetSizer(wxSizer* sizer)
Set the sizer tracked by this item.
void SetSpacer(const wxSize& size)
Set the size of the spacer tracked by this item.
void SetWindow(wxWindow* window)
Set the window to be tracked by thsi item.
void Show(bool 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.