fixed wxComboBox initial autosizing (patch 496702)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13244 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -311,8 +311,6 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
if ( !MSWCreateControl(_T("COMBOBOX"), msStyle) )
|
if ( !MSWCreateControl(_T("COMBOBOX"), msStyle) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
SetSize(pos.x, pos.y, size.x, size.y);
|
|
||||||
|
|
||||||
// A choice/combobox normally has a white background (or other, depending
|
// A choice/combobox normally has a white background (or other, depending
|
||||||
// on global settings) rather than inheriting the parent's background colour.
|
// on global settings) rather than inheriting the parent's background colour.
|
||||||
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
|
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
|
||||||
@@ -327,6 +325,10 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
SetValue(value);
|
SetValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// do this after appending the values to the combobox so that autosizing
|
||||||
|
// works correctly
|
||||||
|
SetSize(pos.x, pos.y, size.x, size.y);
|
||||||
|
|
||||||
// a (not read only) combobox is, in fact, 2 controls: the combobox itself
|
// a (not read only) combobox is, in fact, 2 controls: the combobox itself
|
||||||
// and an edit control inside it and if we want to catch events from this
|
// and an edit control inside it and if we want to catch events from this
|
||||||
// edit control, we must subclass it as well
|
// edit control, we must subclass it as well
|
||||||
|
Reference in New Issue
Block a user