- m_needParent = FALSE;
-
- PreCreation( parent, id, pos, size, style, name );
-
- m_modalShowing = ((m_windowStyle & wxDIALOG_MODAL) == wxDIALOG_MODAL);
-
- m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL );
- GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
-
- gtk_widget_set( m_widget, "GtkWindow::allow_shrink", TRUE, NULL);
-
- gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
- GTK_SIGNAL_FUNC(gtk_dialog_delete_callback), (gpointer)this );
-
- m_wxwindow = gtk_myfixed_new();
- gtk_widget_show( m_wxwindow );
- GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
-
- gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
-
- SetTitle( title );
-
- PostCreation();
-
- return TRUE;
-};
-
-wxDialog::~wxDialog(void)
-{
- wxTopLevelWindows.DeleteObject( this );
- if (wxTopLevelWindows.Number() == 0) wxTheApp->ExitMainLoop();
-};
+ SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG);
+
+ // all dialogs should have tab traversal enabled
+ style |= wxTAB_TRAVERSAL;
+
+ return wxTopLevelWindow::Create(parent, id, title, pos, size, style, name);
+}