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:
@@ -7139,11 +7139,21 @@ bool wxGrid::GetCellOverflow( int row, int col ) const
|
||||
return allow;
|
||||
}
|
||||
|
||||
void wxGrid::GetCellSize( int row, int col, int *num_rows, int *num_cols ) const
|
||||
wxGrid::CellSpan
|
||||
wxGrid::GetCellSize( int row, int col, int *num_rows, int *num_cols ) const
|
||||
{
|
||||
wxGridCellAttr *attr = GetCellAttr(row, col);
|
||||
attr->GetSize( num_rows, num_cols );
|
||||
attr->DecRef();
|
||||
|
||||
if ( *num_rows == 1 && *num_cols == 1 )
|
||||
return CellSpan_None; // just a normal cell
|
||||
|
||||
if ( *num_rows < 0 || *num_cols < 0 )
|
||||
return CellSpan_Inside; // covered by a multi-span cell
|
||||
|
||||
// this cell spans multiple cells to its right/bottom
|
||||
return CellSpan_Main;
|
||||
}
|
||||
|
||||
wxGridCellRenderer* wxGrid::GetCellRenderer(int row, int col) const
|
||||
|
Reference in New Issue
Block a user