Fix best size computation for multiline wxTextCtrl in wxGTK

The initial value was not taken into account before because the best
size computed before it was set, i.e. for the empty control, was always
used, as it was never invalidated.

Do invalidate it now if the control is created with non-empty value, in
order to adjust its best, and initial, size appropriately to its
contents.

Closes #18507.

Closes https://github.com/wxWidgets/wxWidgets/pull/1560
This commit is contained in:
Vadim Zeitlin
2019-09-18 01:56:54 +02:00
parent bb1c3c4ebb
commit fcd734387a
2 changed files with 44 additions and 0 deletions

View File

@@ -817,6 +817,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
if (!value.empty())
{
SetValue( value );
InvalidateBestSize();
}
if (style & wxTE_PASSWORD)