A wxSizer that can lay out items in a virtual grid like a wxFlexGridSizer but in this case explicit positioning of the items is allowed using wxGBPosition, and items can optionally span more than one row and/or column using wxGBSpan.
Derived from
wxFlexGridSizer
wxGridSizer
wxSizer
wxObject
Include files
<wx/gbsizer.h>
Members
wxGridBagSizer::wxGridBagSizer
wxGridBagSizer::Add
wxGridBagSizer::CalcMin
wxGridBagSizer::CheckForIntersection
wxGridBagSizer::FindItem
wxGridBagSizer::FindItemAtPoint
wxGridBagSizer::FindItemAtPosition
wxGridBagSizer::FindItemWithData
wxGridBagSizer::GetCellSize
wxGridBagSizer::GetEmptyCellSize
wxGridBagSizer::GetItemPosition
wxGridBagSizer::GetItemSpan
wxGridBagSizer::RecalcSizes
wxGridBagSizer::SetEmptyCellSize
wxGridBagSizer::SetItemPosition
wxGridBagSizer::SetItemSpan
wxGridBagSizer(int vgap = 0, int hgap = 0)
Constructor, with optional parameters to specify the gap between the rows and columns.
bool Add(wxWindow* window, const wxGBPosition& pos, const wxGBSpan& span = wxDefaultSpan, int flag = 0, int border = 0, wxObject* userData = NULL)
bool Add(wxSizer* sizer, const wxGBPosition& pos, const wxGBSpan& span = wxDefaultSpan, int flag = 0, int border = 0, wxObject* userData = NULL)
bool Add(int width, int height, const wxGBPosition& pos, const wxGBSpan& span = wxDefaultSpan, int flag = 0, int border = 0, wxObject* userData = NULL)
bool Add(wxGBSizerItem* item)
The Add methods return true if the item was successfully placed at the given position, false if something was already there.
wxSize CalcMin()
Called when the managed size of the sizer is needed or when layout needs done.
bool CheckForIntersection(wxGBSizerItem* item, wxGBSizerItem* excludeItem = NULL)
bool CheckForIntersection(const wxGBPosition& pos, const wxGBSpan& span, wxGBSizerItem* excludeItem = NULL)
Look at all items and see if any intersect (or would overlap) the given item. Returns true if so, false if there would be no overlap. If an excludeItem is given then it will not be checked for intersection, for example it may be the item we are checking the position of.
wxGBSizerItem* FindItem(wxWindow* window)
wxGBSizerItem* FindItem(wxSizer* sizer)
Find the sizer item for the given window or subsizer, returns NULL if not found. (non-recursive)
wxGBSizerItem* FindItemAtPoint(const wxPoint& pt)
Return the sizer item located at the point given in pt, or NULL if there is no item at that point. The (x,y) coordinates in pt correspond to the client coordinates of the window using the sizer for layout. (non-recursive)
wxGBSizerItem* FindItemAtPosition(const wxGBPosition& pos)
Return the sizer item for the given grid cell, or NULL if there is no item at that position. (non-recursive)
wxGBSizerItem* FindItemWithData(const wxObject* userData)
Return the sizer item that has a matching user data (it only compares pointer values) or NULL if not found. (non-recursive)
wxSize GetCellSize(int row, int col) const
Get the size of the specified cell, including hgap and vgap. Only valid after a Layout.
wxSize GetEmptyCellSize() const
Get the size used for cells in the grid with no item.
wxGBPosition GetItemPosition(wxWindow* window)
wxGBPosition GetItemPosition(wxSizer* sizer)
wxGBPosition GetItemPosition(size_t index)
Get the grid position of the specified item.
wxGBSpan GetItemSpan(wxWindow* window)
wxGBSpan GetItemSpan(wxSizer* sizer)
wxGBSpan GetItemSpan(size_t index)
Get the row/col spanning of the specified item
void RecalcSizes()
Called when the managed size of the sizer is needed or when layout needs done.
void SetEmptyCellSize(const wxSize& sz)
Set the size used for cells in the grid with no item.
bool SetItemPosition(wxWindow* window, const wxGBPosition& pos)
bool SetItemPosition(wxSizer* sizer, const wxGBPosition& pos)
bool SetItemPosition(size_t index, const wxGBPosition& pos)
Set the grid position of the specified item. Returns true on success. If the move is not allowed (because an item is already there) then false is returned.
bool SetItemSpan(wxWindow* window, const wxGBSpan& span)
bool SetItemSpan(wxSizer* sizer, const wxGBSpan& span)
bool SetItemSpan(size_t index, const wxGBSpan& span)
Set the row/col spanning of the specified item. Returns true on success. If the move is not allowed (because an item is already there) then false is returned.