fix for wxComboBox flicker on create (patch 598891)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16685 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2002-08-22 18:11:27 +00:00
parent 80695f83d3
commit bdf5c30deb
2 changed files with 16 additions and 3 deletions

View File

@ -304,6 +304,11 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
const wxValidator& validator,
const wxString& name)
{
// pretend that wxComboBox is hidden while it is positioned and resized and
// show it only right before leaving this method because otherwise there is
// some noticeable flicker while the control rearranges itself
m_isShown = FALSE;
// first create wxWin object
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return FALSE;
@ -360,6 +365,9 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
);
}
// and finally, show the control
Show(TRUE);
return TRUE;
}

View File

@ -106,9 +106,14 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
exstyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
}
// all controls should have these styles (wxWindows creates all controls
// visible by default)
style |= WS_CHILD | WS_VISIBLE;
// all controls should have this style
style |= WS_CHILD;
// create the control visible if it's currently shown for wxWindows
if ( m_isShown )
{
style |= WS_VISIBLE;
}
int x = pos.x == -1 ? 0 : pos.x,
y = pos.y == -1 ? 0 : pos.y,