]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialog.cpp
Fix to excule OnPaint from WXPM
[wxWidgets.git] / src / msw / dialog.cpp
index 9ae185092d871c368bdf00e4c2b7c7498c1b3794..889355a4b8f38d0428e1e8b0d731939b95566358 100644 (file)
@@ -107,7 +107,8 @@ void wxDialog::Init()
     SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
 }
 
-bool wxDialog::Create(wxWindow *parent, wxWindowID id,
+bool wxDialog::Create(wxWindow *parent,
+                      wxWindowID id,
                       const wxString& title,
                       const wxPoint& pos,
                       const wxSize& size,
@@ -122,9 +123,8 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
 
     wxTopLevelWindows.Append(this);
 
-    //  windowFont = wxTheFontList->FindOrCreateFont(11, wxSWISS, wxNORMAL, wxNORMAL);
-
-    if (parent) parent->AddChild(this);
+    if ( parent )
+        parent->AddChild(this);
 
     if ( id == -1 )
         m_windowId = (int)NewControlId();
@@ -159,6 +159,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
     if (m_exStyle & wxDIALOG_EX_CONTEXTHELP)
         extendedStyle |= WS_EX_CONTEXTHELP;
 #endif
+
     // Allows creation of dialogs with & without captions under MSWindows,
     // resizeable or not (but a resizeable dialog always has caption -
     // otherwise it would look too strange)
@@ -370,11 +371,6 @@ void wxDialog::DoShowModal()
         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
@@ -426,6 +422,18 @@ bool wxDialog::Show(bool show)
                 {
                     // 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
                 }
             }