Fix wxGrid::SetColSize for the native header
In case of the width of -1 for the native header the title width must be calculated by the native header itself.
This commit is contained in:
@@ -9127,6 +9127,12 @@ void wxGrid::SetColSize( int col, int width )
|
|||||||
// make the code more complex), and for them passing -1 simply means to
|
// make the code more complex), and for them passing -1 simply means to
|
||||||
// show the column back using its old size.
|
// show the column back using its old size.
|
||||||
if ( width == -1 && GetColWidth(col) != 0 )
|
if ( width == -1 && GetColWidth(col) != 0 )
|
||||||
|
{
|
||||||
|
if ( m_useNativeHeader )
|
||||||
|
{
|
||||||
|
width = GetGridColHeader()->GetColumnTitleWidth(col);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
long w, h;
|
long w, h;
|
||||||
wxArrayString lines;
|
wxArrayString lines;
|
||||||
@@ -9138,6 +9144,7 @@ void wxGrid::SetColSize( int col, int width )
|
|||||||
else
|
else
|
||||||
GetTextBoxSize( dc, lines, &h, &w );
|
GetTextBoxSize( dc, lines, &h, &w );
|
||||||
width = w + 6;
|
width = w + 6;
|
||||||
|
}
|
||||||
|
|
||||||
// Check that it is not less than the minimal width and do use the
|
// Check that it is not less than the minimal width and do use the
|
||||||
// possibly greater than minimal-acceptable-width minimal-width itself
|
// possibly greater than minimal-acceptable-width minimal-width itself
|
||||||
|
Reference in New Issue
Block a user