From 32cb97237e7691d31977ab503c6ea4511e8eb3a8 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:18:53 +0200 Subject: 5.0 --- wxWidgets-Fix/grid.cpp.patch | 71 -------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 wxWidgets-Fix/grid.cpp.patch (limited to 'wxWidgets-Fix/grid.cpp.patch') diff --git a/wxWidgets-Fix/grid.cpp.patch b/wxWidgets-Fix/grid.cpp.patch deleted file mode 100644 index af9bd684..00000000 --- a/wxWidgets-Fix/grid.cpp.patch +++ /dev/null @@ -1,71 +0,0 @@ ---- old 2009-03-06 11:00:48.000000000 +0100 -+++ src\generic\grid.cpp 2009-10-24 17:12:24.484375000 +0200 -@@ -5605,6 +5605,59 @@ - } - } - -+ -+void wxGrid::AutoSizeColFast(int col, bool doRefresh) -+{ -+ if (col < 0) -+ return; -+ -+ int rowMax = -1; -+ size_t lenMax = 0; -+ for (int row = 0; row < GetNumberRows(); ++row) -+ if (GetCellValue(row, col).size() > lenMax) -+ { -+ lenMax = GetCellValue(row, col).size(); -+ rowMax = row; -+ } -+ -+ wxCoord extentMax = 0; -+ -+ //calculate width of (most likely) widest cell -+ wxClientDC dc(GetGridWindow()); -+ if (rowMax > -1) -+ { -+ wxGridCellAttr* attr = GetCellAttr(rowMax, col); -+ if (attr) -+ { -+ wxGridCellRenderer* renderer = attr->GetRenderer(this, rowMax, col); -+ if (renderer) -+ { -+ const wxSize size = renderer->GetBestSize(*this, *attr, dc, rowMax, col); -+ extentMax = std::max(extentMax, size.x); -+ renderer->DecRef(); -+ } -+ attr->DecRef(); -+ } -+ } -+ -+ //consider column label -+ dc.SetFont(GetLabelFont()); -+ wxCoord w = 0; -+ wxCoord h = 0; -+ dc.GetMultiLineTextExtent(GetColLabelValue(col), &w, &h ); -+ if (GetColLabelTextOrientation() == wxVERTICAL) -+ w = h; -+ extentMax = std::max(extentMax, w); -+ -+ extentMax += 15; //leave some space around text -+ -+ SetColSize(col, extentMax); -+ -+ if (doRefresh) -+ Refresh(); -+} -+ -+ - void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event ) - { - int x, y, col; -@@ -5829,7 +5882,7 @@ - else - { - // adjust column width depending on label text -- AutoSizeColLabelSize( col ); -+ AutoSizeColFast( col ); - - ChangeCursorMode(WXGRID_CURSOR_SELECT_CELL, m_colLabelWin); - m_dragLastPos = -1; -- cgit