Contents Up Previous Next

wxGBSizerItem

The wxGBSizerItem class is used by the wxGridBagSizer for tracking the items in the sizer. It adds grid position and spanning information to the normal wxSizerItem by adding wxGBPosition and wxGBSpan attrbibutes. Most of the time you will not need to use a wxGBSizerItem directly in your code, but there are a couple of cases where it is handy.

Derived from

wxSizerItem

Include files

<wx/gbsizer.h>

Members

wxGBSizerItem::wxGBSizerItem
wxGBSizerItem::GetEndPos
wxGBSizerItem::GetPos
wxGBSizerItem::GetSpan
wxGBSizerItem::Intersects
wxGBSizerItem::SetPos
wxGBSizerItem::SetSpan


wxGBSizerItem::wxGBSizerItem

wxGBSizerItem(int width, int height, const wxGBPosition& pos, const wxGBSpan& span, int flag, int border, wxObject* userData)

Construct a sizer item for tracking a spacer.

wxGBSizerItem(wxWindow* window, const wxGBPosition& pos, const wxGBSpan& span, int flag, int border, wxObject* userData)

Construct a sizer item for tracking a window.

wxGBSizerItem(wxSizer* sizer, const wxGBPosition& pos, const wxGBSpan& span, int flag, int border, wxObject* userData)

Construct a sizer item for tracking a subsizer.


wxGBSizerItem::GetEndPos

void GetEndPos(int& row, int& col)

Get the row and column of the endpoint of this item


wxGBSizerItem::GetPos

wxGBPosition GetPos() const

void GetPos(int& row, int& col) const

Get the grid position of the item.


wxGBSizerItem::GetSpan

wxGBSpan GetSpan() const

void GetSpan(int& rowspan, int& colspan) const

Get the row and column spanning of the item.


wxGBSizerItem::Intersects

bool Intersects(const wxGBSizerItem& other)

Returns true if this item and the other item instersect

bool Intersects(const wxGBPosition& pos, const wxGBSpan& span)

Returns true if the given pos/span would intersect with this item.


wxGBSizerItem::SetPos

bool SetPos(const wxGBPosition& pos)

If the item is already a member of a sizer then first ensure that there is no other item that would intersect with this one at the new position, then set the new position. Returns true if the change is successful and after the next Layout the item will be moved.


wxGBSizerItem::SetSpan

bool SetSpan(const wxGBSpan& span)

If the item is already a member of a sizer then first ensure that there is no other item that would intersect with this one with its new spanning size, then set the new spanning. Returns true if the change is successful and after the next Layout the item will be resized.