]> git.saurik.com Git - wxWidgets.git/commitdiff
attempts at making modal dialogs without parent work - failed
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 10 Oct 2000 13:16:16 +0000 (13:16 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 10 Oct 2000 13:16:16 +0000 (13:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8512 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/dialog.cpp

index 9ae185092d871c368bdf00e4c2b7c7498c1b3794..1b2d7c48a550e1b5e270e6be4d18baf4f4573c7c 100644 (file)
@@ -370,11 +370,6 @@ void wxDialog::DoShowModal()
         wxTheApp->DoMessage();
     }
 
         wxTheApp->DoMessage();
     }
 
-#if 0 //def __WIN32__
-    if ( parent )
-        ::SetActiveWindow(GetHwndOf(parent));
-#endif // __WIN32__
-
     // and restore focus
     // Note that this code MUST NOT access the dialog object's data
     // in case the object has been deleted (which will be the case
     // and restore focus
     // Note that this code MUST NOT access the dialog object's data
     // in case the object has been deleted (which will be the case
@@ -426,6 +421,18 @@ bool wxDialog::Show(bool show)
                 {
                     // use it
                     m_parent = parent;
                 {
                     // use it
                     m_parent = parent;
+
+                    // VZ: to make dialog behave properly we should reparent
+                    //     the dialog for Windows as well - unfortunately,
+                    //     following the docs for SetParent() results in this
+                    //     code which plainly doesn't work
+#if 0
+                    long dwStyle = ::GetWindowLong(GetHwnd(), GWL_STYLE);
+                    dwStyle &= ~WS_POPUP;
+                    dwStyle |= WS_CHILD;
+                    ::SetWindowLong(GetHwnd(), GWL_STYLE, dwStyle);
+                    ::SetParent(GetHwnd(), GetHwndOf(parent));
+#endif // 0
                 }
             }
 
                 }
             }