summaryrefslogtreecommitdiff
path: root/wxWidgets-Fix/grid.cpp.patch
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:18:53 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:18:53 +0200
commit32cb97237e7691d31977ab503c6ea4511e8eb3a8 (patch)
tree4e97b53e9f7b74e8cc5d7548507d9e82ae38e36f /wxWidgets-Fix/grid.cpp.patch
parent4.6 (diff)
downloadFreeFileSync-32cb97237e7691d31977ab503c6ea4511e8eb3a8.tar.gz
FreeFileSync-32cb97237e7691d31977ab503c6ea4511e8eb3a8.tar.bz2
FreeFileSync-32cb97237e7691d31977ab503c6ea4511e8eb3a8.zip
5.0
Diffstat (limited to 'wxWidgets-Fix/grid.cpp.patch')
-rw-r--r--wxWidgets-Fix/grid.cpp.patch71
1 files changed, 0 insertions, 71 deletions
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;
bgstack15