Add wxGridCellRenderer::GetMaxBestSize()

This is another optimization, useful for the renderers that are used
with the values of a fixed form or part of a limited set, as it is much
faster to compute the best size for all values of the set rather than
computing them for all the cells in the column.
This commit is contained in:
Vadim Zeitlin
2020-06-13 15:51:20 +02:00
parent 249db04dd3
commit 71d42a8290
5 changed files with 102 additions and 2 deletions

View File

@@ -141,6 +141,10 @@ public:
wxDC& dc,
int row, int col) wxOVERRIDE;
virtual wxSize GetMaxBestSize(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc) wxOVERRIDE;
virtual wxGridCellRenderer *Clone() const wxOVERRIDE
{ return new wxGridCellBoolRenderer; }
};
@@ -175,6 +179,10 @@ public:
wxDC& dc,
int row, int col) wxOVERRIDE;
virtual wxSize GetMaxBestSize(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc) wxOVERRIDE;
virtual wxGridCellRenderer *Clone() const wxOVERRIDE;
// output strptime()-like format string
@@ -232,6 +240,10 @@ public:
wxDC& dc,
int row, int col) wxOVERRIDE;
virtual wxSize GetMaxBestSize(wxGrid& grid,
wxGridCellAttr& attr,
wxDC& dc) wxOVERRIDE;
virtual wxGridCellRenderer *Clone() const wxOVERRIDE;
// parameters string format is "item1[,item2[...,itemN]]" where itemN will