phoenix_title 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.

New in version 4.1/wxWidgets-3.1.4.


class_hierarchy Class Hierarchy

Inheritance diagram for class GridBlockCoords:

method_summary Methods Summary

__init__

Default constructor initializes the object to invalid state.

Canonicalize

Return the canonicalized block where top left coordinates is less then bottom right coordinates.

Contains

Check whether this block contains the given cell.

Difference

Calculates the result blocks by subtracting the other block from this block.

Get

Return the block coordinants as a tuple.

GetBottomRight

Return the coordinates of the bottom right corner.

GetBottomRow

Return the row of the bottom right corner.

GetLeftCol

Return the column of the left top corner.

GetRightCol

Return the column of the bottom right corner.

GetTopLeft

Return the coordinates of the top left corner.

GetTopRow

Return the row of the left top corner.

Intersects

Whether the blocks intersect.

SetBottomRow

Set the row of the bottom right corner.

SetLeftCol

Set the column of the left top corner.

SetRightCol

Set the column of the bottom right corner.

SetTopRow

Set the row of the left top corner.

SymDifference

Calculates the symmetric difference of the blocks.

__bool__

__repr__

__str__

__ne__

Inequality operator.

__eq__

Equality operator.


api Class API

class wx.grid.GridBlockCoords(object)

Possible constructors:

GridBlockCoords()

GridBlockCoords(topRow, leftCol, bottomRow, rightCol)

Represents coordinates of a block of cells in the grid.


Methods

__init__(self, *args, **kw)

overload Overloaded Implementations:



__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 returns True.



__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) –





Canonicalize(self)

Return the canonicalized block where top left coordinates is less then bottom right coordinates.

Return type

wx.grid.GridBlockCoords



Contains(self, *args, **kw)

overload Overloaded Implementations:



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 or VERTICAL ).

Return type

wx.grid.GridBlockDiffResult

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

tuple

Returns

( topRow, leftCol, bottomRow, rightCol )



GetBottomRight(self)

Return the coordinates of the bottom right corner.

Return type

wx.grid.GridCellCoords



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

wx.grid.GridCellCoords



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) –



SetLeftCol(self, col)

Set the column of the left top corner.

Parameters

col (int) –



SetRightCol(self, col)

Set the column of the bottom right corner.

Parameters

col (int) –



SetTopRow(self, row)

Set the row of the left top corner.

Parameters

row (int) –



SymDifference(self, other)

Calculates the symmetric difference of the blocks.

Parameters

other (wx.grid.GridBlockCoords) – The block to subtract from this block.

Return type

wx.grid.GridBlockDiffResult

Returns

Up to 4 blocks. If block doesn’t exist in the result, it has value of GridNoBlockCoords .



__bool__(self)
Return type

int



__repr__(self)


__str__(self)


__ne__(self)

Inequality operator.

Parameters

other (wx.grid.GridBlockCoords) –



__eq__(self)

Equality operator.

Parameters

other (wx.grid.GridBlockCoords) –


Properties

BottomRight

See GetBottomRight



BottomRow

See GetBottomRow and SetBottomRow



LeftCol

See GetLeftCol and SetLeftCol



RightCol

See GetRightCol and SetRightCol



TopLeft

See GetTopLeft



TopRow

See GetTopRow and SetTopRow