Version: 3.1.0
wxGridCellCoords Class Reference

#include <wx/grid.h>

Detailed Description

Represents coordinates of a grid cell.

An object of this class is simply a (row, column) pair.

Public Member Functions

 wxGridCellCoords ()
 Default constructor initializes the object to invalid state. More...
 
 wxGridCellCoords (int row, int col)
 Constructor taking a row and a column. More...
 
int GetRow () const
 Return the row of the coordinate. More...
 
void SetRow (int n)
 Set the row of the coordinate. More...
 
int GetCol () const
 Return the column of the coordinate. More...
 
void SetCol (int n)
 Set the column of the coordinate. More...
 
void Set (int row, int col)
 Set the row and column of the coordinate. More...
 
wxGridCellCoordsoperator= (const wxGridCellCoords &other)
 Assignment operator for coordinate types. More...
 
bool operator== (const wxGridCellCoords &other) const
 Equality operator. More...
 
bool operator!= (const wxGridCellCoords &other) const
 Inequality operator. More...
 
bool operator! () const
 Checks whether the coordinates are invalid. More...
 

Constructor & Destructor Documentation

wxGridCellCoords::wxGridCellCoords ( )

Default constructor initializes the object to invalid state.

Initially the row and column are both invalid (-1) and so operator!() for an uninitialized wxGridCellCoords returns false.

wxGridCellCoords::wxGridCellCoords ( int  row,
int  col 
)

Constructor taking a row and a column.

Member Function Documentation

int wxGridCellCoords::GetCol ( ) const

Return the column of the coordinate.

int wxGridCellCoords::GetRow ( ) const

Return the row of the coordinate.

bool wxGridCellCoords::operator! ( ) const

Checks whether the coordinates are invalid.

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

bool wxGridCellCoords::operator!= ( const wxGridCellCoords other) const

Inequality operator.

wxGridCellCoords& wxGridCellCoords::operator= ( const wxGridCellCoords other)

Assignment operator for coordinate types.

bool wxGridCellCoords::operator== ( const wxGridCellCoords other) const

Equality operator.

void wxGridCellCoords::Set ( int  row,
int  col 
)

Set the row and column of the coordinate.

void wxGridCellCoords::SetCol ( int  n)

Set the column of the coordinate.

void wxGridCellCoords::SetRow ( int  n)

Set the row of the coordinate.