-       if ( flag )
-               m_windowStyle |= wxDIALOG_MODAL ;
-       else
-               if ( m_windowStyle & wxDIALOG_MODAL )
-                       m_windowStyle -= wxDIALOG_MODAL ;
-  
-  wxModelessWindows.DeleteObject(this);
-  if (!flag)
-    wxModelessWindows.Append(this);
-}
+    m_pOldFocus = (wxWindow *)NULL;
+    m_isShown = FALSE;
+    m_pWindowDisabler = (wxWindowDisabler *)NULL;
+    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
+} // end of wxDialog::Init
+
+bool wxDialog::Create(
+  wxWindow*                         pParent
+, wxWindowID                        vId
+, const wxString&                   rsTitle
+, const wxPoint&                    rPos
+, const wxSize&                     rSize
+, long                              lStyle
+, const wxString&                   rsName
+)
+{
+    long                            lX = rPos.x;
+    long                            lY = rPos.y;
+    long                            lWidth = rSize.x;
+    long                            lHeight = rSize.y;
+    const char*                     zDlg;
+    WXDWORD                         dwExtendedStyle = 0L;
+    HWND                            hWnd;
+
+    Init();
+    SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG);
+
+    //
+    // Save focus before doing anything which can potentially change it
+    //
+    m_pOldFocus = FindFocus();
+
+    //
+    // All dialogs should really have this style
+    //
+    lStyle |= wxTAB_TRAVERSAL;
+
+    if (!wxTopLevelWindow::Create( pParent
+                                  ,vId
+                                  ,rsTitle
+                                  ,rPos
+                                  ,rSize
+                                  ,lStyle
+                                  ,rsName
+                                 ))
+        return FALSE;
+    SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
+
+    //
+    // Must defer setting the title until after dialog is created and sized
+    //
+    if (!rsTitle.IsNull())
+        SetTitle(rsTitle);
+    return TRUE;
+} // end of wxDialog::Create
+
+void wxDialog::SetModal(
+  bool                              bFlag
+)
+{
+    if (bFlag)
+    {
+        m_windowStyle |= wxDIALOG_MODAL ;
+        wxModelessWindows.DeleteObject(this);
+    }
+    else
+    {
+        m_windowStyle &= ~wxDIALOG_MODAL ;
+        wxModelessWindows.Append(this);
+    }
+} // end of wxDialog::SetModal