wx.grid.GridBlockCoords¶
Represents coordinates of a block of cells in the grid.
An object of this class contains coordinates of the left top and the bottom right corners of a block.
Added in version 4.1/wxWidgets-3.1.4.
Class Hierarchy¶
Methods Summary¶
Default constructor initializes the object to invalid state. |
|
Return the canonicalized block where top left coordinates is less then bottom right coordinates. |
|
Check whether this block contains the given cell. |
|
Calculates the result blocks by subtracting the other block from this block. |
|
Return the block coordinants as a tuple. |
|
Return the coordinates of the bottom right corner. |
|
Return the row of the bottom right corner. |
|
Return the column of the left top corner. |
|
Return the column of the bottom right corner. |
|
Return the coordinates of the top left corner. |
|
Return the row of the left top corner. |
|
Whether the blocks intersect. |
|
Set the row of the bottom right corner. |
|
Set the column of the left top corner. |
|
Set the column of the bottom right corner. |
|
Set the row of the left top corner. |
|
Calculates the symmetric difference of the blocks. |
|
Inequality operator. |
|
Equality operator. |
Properties Summary¶
See |
|
See |
|
See |
|
See |
|
See |
|
Class API¶
- class wx.grid.GridBlockCoords(object)¶
Possible constructors:
GridBlockCoords() -> None GridBlockCoords(topRow, leftCol, bottomRow, rightCol) -> None
Represents coordinates of a block of cells in the grid.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self)
Default constructor initializes the object to invalid state.
Initially the coordinates are invalid (-1) and so
operator!
for an uninitialized wx.grid.GridBlockCoords returnsTrue
.- Return type:
None
__init__ (self, topRow, leftCol, bottomRow, rightCol)
Constructor taking a coordinates of the left top and the bottom right corners.
- Parameters:
topRow (int)
leftCol (int)
bottomRow (int)
rightCol (int)
- Return type:
None
- Canonicalize(self)¶
Return the canonicalized block where top left coordinates is less then bottom right coordinates.
- Return type:
- Contains(self, *args, **kw)¶
-
Contains (self, cell)
Check whether this block contains the given cell.
- Parameters:
cell (wx.grid.GridCellCoords)
- Return type:
bool
- Returns:
True
, if the block contains the cell,False
otherwise.
Contains (self, other)
Check whether this block contains another one.
- Parameters:
other (wx.grid.GridBlockCoords)
- Return type:
bool
- Returns:
True
if other is entirely contained within this block.
- Difference(self, other, splitOrientation)¶
Calculates the result blocks by subtracting the other block from this block.
- Parameters:
other (wx.grid.GridBlockCoords) – The block to subtract from this block.
splitOrientation (int) – The block splitting orientation (either
HORIZONTAL
orVERTICAL
).
- Return type:
- Returns:
Up to 4 blocks. If block doesn’t exist in the result, it has value of
GridNoBlockCoords
.
- Get(self)¶
Return the block coordinants as a tuple.
- Return type:
Any
- GetBottomRight(self)¶
Return the coordinates of the bottom right corner.
- Return type:
- GetBottomRow(self)¶
Return the row of the bottom right corner.
- Return type:
int
- GetLeftCol(self)¶
Return the column of the left top corner.
- Return type:
int
- GetRightCol(self)¶
Return the column of the bottom right corner.
- Return type:
int
- GetTopLeft(self)¶
Return the coordinates of the top left corner.
- Return type:
- GetTopRow(self)¶
Return the row of the left top corner.
- Return type:
int
- Intersects(self, other)¶
Whether the blocks intersect.
- Parameters:
other (wx.grid.GridBlockCoords)
- Return type:
bool
- Returns:
True
, if the block intersects with the other,False
, otherwise.
- SetBottomRow(self, row)¶
Set the row of the bottom right corner.
- Parameters:
row (int)
- Return type:
None
- SetLeftCol(self, col)¶
Set the column of the left top corner.
- Parameters:
col (int)
- Return type:
None
- SetRightCol(self, col)¶
Set the column of the bottom right corner.
- Parameters:
col (int)
- Return type:
None
- SetTopRow(self, row)¶
Set the row of the left top corner.
- Parameters:
row (int)
- Return type:
None
- SymDifference(self, other)¶
Calculates the symmetric difference of the blocks.
- Parameters:
other (wx.grid.GridBlockCoords) – The block to subtract from this block.
- Return type:
- Returns:
Up to 4 blocks. If block doesn’t exist in the result, it has value of
GridNoBlockCoords
.
- __bool__(self)¶
- Return type:
bool
- __repr__(self)¶
- __str__(self)¶
- __ne__(self, other)¶
Inequality operator.
- Parameters:
other (wx.grid.GridBlockCoords)
- Return type:
bool
- __eq__(self, other)¶
Equality operator.
- Parameters:
other (wx.grid.GridBlockCoords)
- Return type:
bool
Properties¶
- BottomRight¶
See
GetBottomRight
- BottomRow¶
See
GetBottomRow
andSetBottomRow
- LeftCol¶
See
GetLeftCol
andSetLeftCol
- RightCol¶
See
GetRightCol
andSetRightCol
- TopLeft¶
See
GetTopLeft