]> git.saurik.com Git - wxWidgets.git/commitdiff
Moved the wxDialog BringWindowToFront fix to Show because it happens in
authorJulian Smart <julian@anthemion.co.uk>
Tue, 22 Feb 2000 08:54:05 +0000 (08:54 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 22 Feb 2000 08:54:05 +0000 (08:54 +0000)
modeless dialogs too, if other windows have been disabled.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/dialog.cpp

index 2a01b7671db076e2d3cf9d57b642d43c29d61925..4a72ff9560d83b5b8dc46d4c2f1cf858fe0d0a60 100644 (file)
@@ -575,6 +575,18 @@ void wxDialog::DoShowModal()
 
 bool wxDialog::Show(bool show)
 {
+    // The following is required when the parent has been disabled,
+    // (modal dialogs, or modeless dialogs with disabling such as wxProgressDialog).
+    // Otherwise the parent disappears behind other windows when the dialog is hidden.
+    if (!show)
+    {
+        HWND hwndParent = GetParent() ? (HWND) GetParent()->GetHWND() : (HWND)NULL;
+        if ( hwndParent )
+        {
+            ::BringWindowToTop(hwndParent);
+        }
+    }
+
     if ( !wxDialogBase::Show(show) )
     {
         // nothing to do
@@ -620,12 +632,6 @@ void wxDialog::EndModal(int retCode)
 {
     SetReturnCode(retCode);
 
-    HWND hwndParent = GetParent() ? (HWND) GetParent()->GetHWND() : (HWND)NULL;
-    if ( hwndParent )
-    {
-        ::BringWindowToTop(hwndParent);
-    }
-
     Show(FALSE);
 }