Return the kind of cells span from wxGrid::GetCellSize().

Behaviour of GetCellSize() may be very surprising for the unwary as it can
return negative or null "size" of the cell.

Add CellSpan return value to allow the caller to check what kind of cell are
we dealing with easier.

Also document the new return value as well as the function (and matching
SetCellSize()) itself carefully as its behaviour is far from obvious.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-12-27 19:40:41 +00:00
parent 653351d1cc
commit ea99e8e31e
3 changed files with 120 additions and 2 deletions

View File

@@ -1301,7 +1301,24 @@ public:
void GetCellAlignment( int row, int col, int *horiz, int *vert ) const;
bool GetDefaultCellOverflow() const;
bool GetCellOverflow( int row, int col ) const;
void GetCellSize( int row, int col, int *num_rows, int *num_cols ) const;
// this function returns 1 in num_rows and num_cols for normal cells,
// positive numbers for a cell spanning multiple columns/rows (as set with
// SetCellSize()) and _negative_ numbers corresponding to the offset of the
// top left cell of the span from this one for the other cells covered by
// this cell
//
// the return value is CellSpan_None, CellSpan_Main or CellSpan_Inside for
// each of these cases respectively
enum CellSpan
{
CellSpan_Inside = -1,
CellSpan_None = 0,
CellSpan_Main
};
CellSpan GetCellSize( int row, int col, int *num_rows, int *num_cols ) const;
wxSize GetCellSize(const wxGridCellCoords& coords)
{
wxSize s;