]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialog.cpp
applied MIME patch(es) from Chris Elliott
[wxWidgets.git] / src / msw / dialog.cpp
index 9ae185092d871c368bdf00e4c2b7c7498c1b3794..f38a3e9c06f353c4ea5ba4070589393ca13cc31b 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)
@@ -187,7 +188,6 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
     SubclassWin(GetHWND());
 
     SetWindowText(hwnd, title);
-    SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
 
     return TRUE;
 }
@@ -370,11 +370,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 +421,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
                 }
             }