Version: 3.0.2
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.
 
 wxGridCellCoords (int row, int col)
 Constructor taking a row and a column.
 
int GetRow () const
 Return the row of the coordinate.
 
void SetRow (int n)
 Set the row of the coordinate.
 
int GetCol () const
 Return the column of the coordinate.
 
void SetCol (int n)
 Set the column of the coordinate.
 
void Set (int row, int col)
 Set the row and column of the coordinate.
 
wxGridCellCoordsoperator= (const wxGridCellCoords &other)
 Assignment operator for coordinate types.
 
bool operator== (const wxGridCellCoords &other) const
 Equality operator.
 
bool operator!= (const wxGridCellCoords &other) const
 Inequality operator.
 
bool operator! () const
 Checks whether the coordinates are invalid.
 

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.