m_returnCode = 0;
     m_sizeSet = FALSE;
     m_modalShowing = FALSE;
+    m_themeEnabled = TRUE;
 }
 
 wxDialog::wxDialog( wxWindow *parent,
        return GetReturnCode();
     }
 
-    if ( !GetParent() )
+    // use the apps top level window as parent if none given unless explicitly
+    // forbidden
+    if ( !GetParent() && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) )
     {
         wxWindow *parent = wxTheApp->GetTopWindow();
         if ( parent && parent != this )