| Version: 3.3.1

Public Member Functions | Private Attributes | List of all members
wxGridBlockCoords Class Reference

`#include <wx/grid.h>`

## Detailed Description

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.

Since
  3.1.4

## Public Member Functions
| wxGridBlockCoords ()
| Default constructor initializes the object to invalid state. More...
| wxGridBlockCoords (int topRow, int leftCol, int bottomRow, int rightCol)
| Constructor taking a coordinates of the left top and the bottom right corners. More...
int | GetTopRow () const
| Return the row of the left top corner. More...
void | SetTopRow (int row)
| Set the row of the left top corner. More...
int | GetLeftCol () const
| Return the column of the left top corner. More...
void | SetLeftCol (int col)
| Set the column of the left top corner. More...
int | GetBottomRow () const
| Return the row of the bottom right corner. More...
void | SetBottomRow (int row)
| Set the row of the bottom right corner. More...
int | GetRightCol () const
| Return the column of the bottom right corner. More...
void | SetRightCol (int col)
| Set the column of the bottom right corner. More...
wxGridCellCoords | GetTopLeft () const
| Return the coordinates of the top left corner. More...
wxGridCellCoords | GetBottomRight () const
| Return the coordinates of the bottom right corner. More...
wxGridBlockCoords | Canonicalize () const
| Return the canonicalized block where top left coordinates is less than bottom right coordinates. More...
bool | Intersects (const wxGridBlockCoords &other) const
| Whether the blocks intersect. More...
bool | Contains (const wxGridCellCoords &cell) const
| Check whether this block contains the given cell. More...
bool | Contains (const wxGridBlockCoords &other) const
| Check whether this block contains another one. More...
wxGridBlockDiffResult | Difference (const wxGridBlockCoords &other, int splitOrientation) const
| Calculates the result blocks by subtracting the other block from this block. More...
wxGridBlockDiffResult | SymDifference (const wxGridBlockCoords &other) const
| Calculates the symmetric difference of the blocks. More...
bool | operator== (const wxGridBlockCoords &other) const
| Equality operator. More...
bool | operator!= (const wxGridBlockCoords &other) const
| Inequality operator. More...
bool | operator! () const
| Checks whether the cells block is invalid. More...

## Private Attributes
int | m_topRow
int | m_leftCol
int | m_bottomRow
int | m_rightCol

## Constructor & Destructor Documentation

## ◆ wxGridBlockCoords() [1/2]

wxGridBlockCoords::wxGridBlockCoords | ( |  | ) |

Default constructor initializes the object to invalid state.

Initially the coordinates are invalid (-1) and so operator!() for an uninitialized wxGridBlockCoords returns true.

## ◆ wxGridBlockCoords() [2/2]

wxGridBlockCoords::wxGridBlockCoords | ( | int | topRow,
|  | int | leftCol,
|  | int | bottomRow,
|  | int | rightCol
| ) |  |

Constructor taking a coordinates of the left top and the bottom right corners.

## Member Function Documentation

## ◆ Canonicalize()

wxGridBlockCoords wxGridBlockCoords::Canonicalize | ( |  | ) | const

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

## ◆ Contains() [1/2]

bool wxGridBlockCoords::Contains | ( | const wxGridBlockCoords & | other | ) | const

Check whether this block contains another one.

Returns
  true if other is entirely contained within this block.

## ◆ Contains() [2/2]

bool wxGridBlockCoords::Contains | ( | const wxGridCellCoords & | cell | ) | const

Check whether this block contains the given cell.

Returns
  true, if the block contains the cell, false otherwise.

## ◆ Difference()

wxGridBlockDiffResult wxGridBlockCoords::Difference | ( | const wxGridBlockCoords & | other,
|  | int | splitOrientation
| ) |  | const

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

Parameters

  other | The block to subtract from this block.
  splitOrientation | The block splitting orientation (either `wxHORIZONTAL` or `wxVERTICAL`).

Returns
  Up to 4 blocks. If block doesn't exist in the result, it has value of `wxGridNoBlockCoords`.

## ◆ GetBottomRight()

wxGridCellCoords wxGridBlockCoords::GetBottomRight | ( |  | ) | const
| inline

Return the coordinates of the bottom right corner.

## ◆ GetBottomRow()

int wxGridBlockCoords::GetBottomRow | ( |  | ) | const

Return the row of the bottom right corner.

## ◆ GetLeftCol()

int wxGridBlockCoords::GetLeftCol | ( |  | ) | const

Return the column of the left top corner.

## ◆ GetRightCol()

int wxGridBlockCoords::GetRightCol | ( |  | ) | const

Return the column of the bottom right corner.

## ◆ GetTopLeft()

wxGridCellCoords wxGridBlockCoords::GetTopLeft | ( |  | ) | const
| inline

Return the coordinates of the top left corner.

## ◆ GetTopRow()

int wxGridBlockCoords::GetTopRow | ( |  | ) | const

Return the row of the left top corner.

## ◆ Intersects()

bool wxGridBlockCoords::Intersects | ( | const wxGridBlockCoords & | other | ) | const
| inline

Whether the blocks intersect.

Returns
  true, if the block intersects with the other, false, otherwise.

## ◆ operator!()

bool wxGridBlockCoords::operator! | ( |  | ) | const

Checks whether the cells block is invalid.

Returns true only if all components are -1. Notice that if one of the components (but not all) is -1, this method returns false even if the object is invalid. This is done because objects in such state should actually never exist, i.e. either all components should be -1 or none of them should be -1.

## ◆ operator!=()

bool wxGridBlockCoords::operator!= | ( | const wxGridBlockCoords & | other | ) | const

Inequality operator.

## ◆ operator==()

bool wxGridBlockCoords::operator== | ( | const wxGridBlockCoords & | other | ) | const

Equality operator.

## ◆ SetBottomRow()

void wxGridBlockCoords::SetBottomRow | ( | int | row | ) |

Set the row of the bottom right corner.

## ◆ SetLeftCol()

void wxGridBlockCoords::SetLeftCol | ( | int | col | ) |

Set the column of the left top corner.

## ◆ SetRightCol()

void wxGridBlockCoords::SetRightCol | ( | int | col | ) |

Set the column of the bottom right corner.

## ◆ SetTopRow()

void wxGridBlockCoords::SetTopRow | ( | int | row | ) |

Set the row of the left top corner.

## ◆ SymDifference()

wxGridBlockDiffResult wxGridBlockCoords::SymDifference | ( | const wxGridBlockCoords & | other | ) | const

Calculates the symmetric difference of the blocks.

Parameters

  other | The block to subtract from this block.

Returns
  Up to 4 blocks. If block doesn't exist in the result, it has value of `wxGridNoBlockCoords`.

## Member Data Documentation

## ◆ m_bottomRow

int wxGridBlockCoords::m_bottomRow
| private

## ◆ m_leftCol

int wxGridBlockCoords::m_leftCol
| private

## ◆ m_rightCol

int wxGridBlockCoords::m_rightCol
| private

## ◆ m_topRow

int wxGridBlockCoords::m_topRow
| private