A wx.Sizer that can lay out items in a virtual grid like a wx.FlexGridSizer but in this case explicit positioning of the items is allowed using wx.GBPosition, and items can optionally span more than one row and/or column using wx.GBSpan.
Constructor, with optional parameters to specify the gap between the rows and columns. |
|
Adds the given item to the given position. |
|
Called when the managed size of the sizer is needed or when layout needs done. |
|
Look at all items and see if any intersect (or would overlap) the given item. |
|
Find the sizer item for the given window or subsizer, returns |
|
Return the sizer item located at the point given in pt, or |
|
Return the sizer item for the given grid cell, or |
|
Return the sizer item that has a matching user data (it only compares pointer values) or |
|
Get the size of the specified cell, including hgap and vgap. |
|
Get the size used for cells in the grid with no item. |
|
Get the grid position of the specified item. |
|
Get the row/col spanning of the specified item. |
|
Called when the managed size of the sizer is needed or when layout needs done. |
|
Set the size used for cells in the grid with no item. |
|
Set the grid position of the specified item. |
|
Set the row/col spanning of the specified item. |
See |
wx.
GridBagSizer
(FlexGridSizer)¶Possible constructors:
GridBagSizer(vgap=0, hgap=0)
A Sizer that can lay out items in a virtual grid like a FlexGridSizer but in this case explicit positioning of the items is allowed using GBPosition, and items can optionally span more than one row and/or column using GBSpan.
__init__
(self, vgap=0, hgap=0)¶Constructor, with optional parameters to specify the gap between the rows and columns.
vgap (int) –
hgap (int) –
Add
(self, *args, **kw)¶Add (self, window, pos, span=DefaultSpan, flag=0, border=0, userData=None)
Adds the given item to the given position.
window (wx.Window) –
pos (wx.GBPosition) –
span (wx.GBSpan) –
flag (int) –
border (int) –
userData (PyUserData) –
A valid pointer if the item was successfully placed at the given position, or None
if something was already there.
Add (self, sizer, pos, span=DefaultSpan, flag=0, border=0, userData=None)
Adds the given item to the given position.
sizer (wx.Sizer) –
pos (wx.GBPosition) –
span (wx.GBSpan) –
flag (int) –
border (int) –
userData (PyUserData) –
A valid pointer if the item was successfully placed at the given position, or None
if something was already there.
Add (self, item)
Adds the given item to the given position.
item (wx.GBSizerItem) –
A valid pointer if the item was successfully placed at the given position, or None
if something was already there.
Add (self, width, height, pos, span=DefaultSpan, flag=0, border=0, userData=None)
Adds a spacer to the given position.
width and height specify the dimension of the spacer to be added.
width (int) –
height (int) –
pos (wx.GBPosition) –
span (wx.GBSpan) –
flag (int) –
border (int) –
userData (PyUserData) –
A valid pointer if the spacer was successfully placed at the given position, or None
if something was already there.
Add (self, size, pos, span=DefaultSpan, flag=0, border=0, /Transfer/=None)
Add a spacer using a Size
object.
CalcMin
(self)¶Called when the managed size of the sizer is needed or when layout needs done.
CheckForIntersection
(self, *args, **kw)¶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.
CheckForIntersection (self, item, excludeItem=None)
item (wx.GBSizerItem) –
excludeItem (wx.GBSizerItem) –
bool
CheckForIntersection (self, pos, span, excludeItem=None)
pos (wx.GBPosition) –
span (wx.GBSpan) –
excludeItem (wx.GBSizerItem) –
bool
FindItem
(self, *args, **kw)¶Find the sizer item for the given window or subsizer, returns None
if not found.
(non-recursive)
FindItem (self, window)
window (wx.Window) –
FindItem (self, sizer)
sizer (wx.Sizer) –
FindItemAtPoint
(self, pt)¶Return the sizer item located at the point given in pt, or None
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)
pt (wx.Point) –
FindItemAtPosition
(self, pos)¶Return the sizer item for the given grid cell, or None
if there is no item at that position.
(non-recursive)
pos (wx.GBPosition) –
FindItemWithData
(self, userData)¶Return the sizer item that has a matching user data (it only compares pointer values) or None
if not found.
(non-recursive)
userData (wx.Object) –
GetCellSize
(self, row, col)¶Get the size of the specified cell, including hgap and vgap.
Only valid after window layout has been performed.
row (int) –
col (int) –
GetItemPosition
(self, *args, **kw)¶Get the grid position of the specified item.
GetItemPosition (self, window)
window (wx.Window) –
GetItemPosition (self, sizer)
sizer (wx.Sizer) –
GetItemPosition (self, index)
index (int) –
GetItemSpan
(self, *args, **kw)¶Get the row/col spanning of the specified item.
GetItemSpan (self, window)
GetItemSpan (self, sizer)
GetItemSpan (self, index)
index (int) –
RepositionChildren
(self, minSize)¶Called when the managed size of the sizer is needed or when layout needs done.
minSize (wx.Size) –
SetEmptyCellSize
(self, sz)¶Set the size used for cells in the grid with no item.
sz (wx.Size) –
SetItemPosition
(self, *args, **kw)¶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.
SetItemPosition (self, window, pos)
window (wx.Window) –
pos (wx.GBPosition) –
bool
SetItemPosition (self, sizer, pos)
sizer (wx.Sizer) –
pos (wx.GBPosition) –
bool
SetItemPosition (self, index, pos)
index (int) –
pos (wx.GBPosition) –
bool
SetItemSpan
(self, *args, **kw)¶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.
SetItemSpan (self, window, span)
SetItemSpan (self, sizer, span)
SetItemSpan (self, index, span)
index (int) –
span (wx.GBSpan) –
bool
EmptyCellSize
¶See GetEmptyCellSize
and SetEmptyCellSize