Add wxGridCellRenderer::GetBest{Height,Width}() and use them in wxGrid.
Allow the renderer to specify the best height at the given width (or vice versa) instead of the best size in both direction which is not defined for e.g. wxGridCellAutoWrapStringRenderer. Closes #15943. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -8407,8 +8407,11 @@ wxGrid::AutoSizeColOrRow(int colOrRow, bool setAsMin, wxGridDirection direction)
|
||||
wxGridCellRenderer *renderer = attr->GetRenderer(this, row, col);
|
||||
if ( renderer )
|
||||
{
|
||||
wxSize size = renderer->GetBestSize(*this, *attr, dc, row, col);
|
||||
extent = column ? size.x : size.y;
|
||||
extent = column
|
||||
? renderer->GetBestWidth(*this, *attr, dc, row, col,
|
||||
GetRowHeight(row))
|
||||
: renderer->GetBestHeight(*this, *attr, dc, row, col,
|
||||
GetColWidth(col));
|
||||
|
||||
if ( span != CellSpan_None )
|
||||
{
|
||||
|
Reference in New Issue
Block a user