wxWidgets: wxGridBlockCoords Class Reference

| Version: 3.1.7

Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
wxGridBlockCoords Class Reference

`#include </cygdrive/c/Users/Hamis/Cygwin-packaging/wxWidgets3.1/wxWidgets3.1-3.1.7-1.x86_64/src/wxWidgets-3.1.7/interface/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.
| wxGridBlockCoords (int topRow, int leftCol, int bottomRow, int rightCol)
| Constructor taking a coordinates of the left top and the bottom right corners.
int | GetTopRow () const
| Return the row of the left top corner.
void | SetTopRow (int row)
| Set the row of the left top corner.
int | GetLeftCol () const
| Return the column of the left top corner.
void | SetLeftCol (int col)
| Set the column of the left top corner.
int | GetBottomRow () const
| Return the row of the bottom right corner.
void | SetBottomRow (int row)
| Set the row of the bottom right corner.
int | GetRightCol () const
| Return the column of the bottom right corner.
void | SetRightCol (int col)
| Set the column of the bottom right corner.
wxGridCellCoords | GetTopLeft () const
| Return the coordinates of the top left corner.
wxGridCellCoords | GetBottomRight () const
| Return the coordinates of the bottom right corner.
wxGridBlockCoords | Canonicalize () const
| Return the canonicalized block where top left coordinates is less then bottom right coordinates.
bool | Intersects (const wxGridBlockCoords &other) const
| Whether the blocks intersect.
bool | Contains (const wxGridCellCoords &cell) const
| Check whether this block contains the given cell.
bool | Contains (const wxGridBlockCoords &other) const
| Check whether this block contains another one.
wxGridBlockDiffResult | Difference (const wxGridBlockCoords &other, int splitOrientation) const
| Calculates the result blocks by subtracting the other block from this block.
wxGridBlockDiffResult | SymDifference (const wxGridBlockCoords &other) const
| Calculates the symmetric difference of the blocks.
bool | operator== (const wxGridBlockCoords &other) const
| Equality operator.
bool | operator!= (const wxGridBlockCoords &other) const
| Inequality operator.
bool | operator! () const
| Checks whether the cells block is invalid.

## 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 then 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