From 86647b53e924e999bb5b395f64b876dbcc20d307 Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Sun, 29 Jun 2008 15:14:42 +0000 Subject: [PATCH] Don't force ColWidth to always grow for wxGridCellAutoWrapStringRenderer (#1798) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54420 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/gridctrl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index 0d69504..e5ec583 100644 --- a/src/generic/gridctrl.cpp +++ b/src/generic/gridctrl.cpp @@ -378,7 +378,10 @@ wxGridCellAutoWrapStringRenderer::GetBestSize(wxGrid& grid, wxDC& dc, int row, int col) { - wxCoord x,y, height , width = grid.GetColSize(col) -10; + wxCoord x,y, height , width = grid.GetColSize(col) -20; + // for width, subtract 20 because ColSize includes a magin of 10 pixels + // that we do not want here and because we always start with an increment + // by 10 in the loop below. int count = 250; //Limit iterations.. wxRect rect(0,0,width,10); -- 2.7.4