diff options
Diffstat (limited to 'library/custom_grid.cpp')
-rw-r--r-- | library/custom_grid.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/library/custom_grid.cpp b/library/custom_grid.cpp index 172ad2e1..c2b87b5d 100644 --- a/library/custom_grid.cpp +++ b/library/custom_grid.cpp @@ -169,7 +169,7 @@ public: { return result; } - else //grid attribute might be referenced by other nodes, so clone it! + else //grid attribute might be referenced by other elements, so clone it! { wxGridCellAttr* attr = result->Clone(); //attr has ref-count 1 result->DecRef(); @@ -1066,6 +1066,28 @@ void CustomGrid::updateGridSizes() } +void CustomGridRim::updateGridSizes() +{ + CustomGrid::updateGridSizes(); + + //set row label size + + //SetRowLabelSize(wxGRID_AUTOSIZE); -> we can do better + wxClientDC dc(GetGridRowLabelWindow()); + dc.SetFont(GetLabelFont()); + + wxArrayString lines; + lines.push_back(GetRowLabelValue(GetNumberRows())); + + long width = 0; + long dummy = 0; + GetTextBoxSize(dc, lines, &width, &dummy); + + width += 8; + SetRowLabelSize(width); +} + + void CustomGrid::setSortMarker(SortMarker marker) { m_marker = marker; |