Applied patch [ 598016 ] remove flicker during combo box creation

By Benjamin I. Williams (biwillia76)

The attached patch completely fixes the flicker problem when
creating combo boxes.  It also will make it elementary to
remove flicker during the creation of other controls
(although all the other controls are flicker free, AFAIK).
It does this by adding an optional 'visible' parameter to
the internal MSWCreateControl method, whereby the caller can
create a control invisibly by default, perform some
complicated sizing calculations, and then finally show the
control before the Create finished.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-08-22 09:41:05 +00:00
parent 0e7fa78358
commit c832ef4985
5 changed files with 32 additions and 7 deletions

View File

@@ -79,12 +79,13 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
const wxString& label,
const wxPoint& pos,
const wxSize& size,
long style)
long style,
bool visible)
{
WXDWORD exstyle;
WXDWORD msStyle = MSWGetStyle(style, &exstyle);
return MSWCreateControl(classname, msStyle, pos, size, label, exstyle);
return MSWCreateControl(classname, msStyle, pos, size, label, exstyle, visible);
}
bool wxControl::MSWCreateControl(const wxChar *classname,
@@ -92,7 +93,8 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
const wxPoint& pos,
const wxSize& size,
const wxString& label,
WXDWORD exstyle)
WXDWORD exstyle,
bool visible)
{
// want3D tells us whether or not the style specified a 3D border.
// If so, under WIN16 we can use Ctl3D to give it an appropriate style.
@@ -108,7 +110,18 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
// all controls should have these styles (wxWindows creates all controls
// visible by default)
style |= WS_CHILD | WS_VISIBLE;
style |= WS_CHILD;
// sometimes, controls will defer showing the window until
// all configuration, sizing, and positioning is completed
if (!visible)
{
m_isShown = FALSE;
}
else
{
style |= WS_VISIBLE;
}
int x = pos.x == -1 ? 0 : pos.x,
y = pos.y == -1 ? 0 : pos.y,