if ( hWnd )
::EnableWindow(hWnd, (BOOL)enable);
+ // the logic below doesn't apply to the top level windows -- otherwise
+ // showing a modal dialog would result in total greying out (and ungreying
+ // out later) of everything which would be really ugly
+ if ( IsTopLevel() )
+ return TRUE;
+
// when the parent is disabled, all of its children should be disabled as
// well but when it is enabled back, only those of the children which
// hadn't been already disabled in the beginning should be enabled again,
// so we have to keep the list of those children
- wxWindowList::Node *node = GetChildren().GetFirst();
- while ( node )
+ for ( wxWindowList::Node *node = GetChildren().GetFirst();
+ node;
+ node = node->GetNext() )
{
wxWindow *child = node->GetData();
+ if ( child->IsTopLevel() )
+ {
+ // the logic below doesn't apply to top level children
+ continue;
+ }
if ( enable )
{
m_childrenDisabled->Append(child);
}
}
-
- node = node->GetNext();
}
if ( enable && m_childrenDisabled )
void wxWindowMSW::Update()
{
+#ifdef __WXWINE__
+ ::UpdateWindow(GetHwnd());
+#else
if ( !::UpdateWindow(GetHwnd()) )
{
wxLogLastError(_T("UpdateWindow"));
}
-
+#endif
+
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
// just calling UpdateWindow() is not enough, what we did in our WM_PAINT
// handler needs to be really drawn right now