From 94ff3feeeedb941d596f7a6bca8cbcaa62a51c3f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 6 Apr 2000 21:15:45 +0000 Subject: [PATCH] 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 --- src/generic/grid.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 60ab00568e..90ddc8624c 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -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 )