Fixed wxGridCellStringRenderer::DoGetBestSize to take multiple lines

into account and wxGrid::AutoSizeColOrRow to give a few pixels of
padding for rows like it does for columns.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2000-04-06 21:15:45 +00:00
parent 6067cee7fa
commit 94ff3feeee

View File

@@ -1238,6 +1238,7 @@ wxSize wxGridCellStringRenderer::DoGetBestSize(wxGridCellAttr& attr,
wxCoord x, y;
dc.SetFont(attr.GetFont());
dc.GetTextExtent(text, &x, &y);
y *= 1 + text.Freq('\n'); // multiply by the number of lines.
return wxSize(x, y);
}
@@ -7630,6 +7631,10 @@ void wxGrid::AutoSizeColOrRow( int colOrRow, bool setAsMin, bool column )
// leave some space around text
extentMax += 10;
}
else
{
extentMax += 6;
}
}
if ( column )