- m_needParent = FALSE;
-
- PreCreation( parent, id, pos, size, style, name );
-
- 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 );
-
- if ((m_x != -1) || (m_y != -1))
- gtk_widget_set_uposition( m_widget, m_x, m_y );
-
- gtk_widget_set_usize( m_widget, m_width, m_height );
-
- PostCreation();
-
- return TRUE;
+ wxTopLevelWindows.Append( this );
+
+ m_needParent = FALSE;
+
+ if (!PreCreation( parent, pos, size ) ||
+ !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+ {
+ wxFAIL_MSG( wxT("wxDialog creation failed") );
+ return FALSE;
+ }
+
+ // All dialogs should really have this style
+ m_windowStyle |= wxTAB_TRAVERSAL;
+
+ m_insertCallback = (wxInsertChildFunction) wxInsertChildInDialog;
+
+ m_widget = gtk_window_new( GTK_WINDOW_DIALOG );
+
+ if ((m_parent) && (GTK_IS_WINDOW(m_parent->m_widget)))
+ gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) );
+
+ if (!name.IsEmpty())
+ gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() );
+
+ GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
+
+ gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
+ GTK_SIGNAL_FUNC(gtk_dialog_delete_callback), (gpointer)this );
+
+ m_wxwindow = gtk_pizza_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 );
+
+ if (m_parent) m_parent->AddChild( this );
+
+ PostCreation();
+
+ if ((m_x != -1) || (m_y != -1))
+ gtk_widget_set_uposition( m_widget, m_x, m_y );
+ gtk_widget_set_usize( m_widget, m_width, m_height );
+
+ /* we cannot set MWM hints before the widget has
+ been realized, so we do this directly after realization */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
+ GTK_SIGNAL_FUNC(gtk_dialog_realized_callback), (gpointer) this );
+
+ /* the user resized the frame by dragging etc. */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
+ GTK_SIGNAL_FUNC(gtk_dialog_size_callback), (gpointer)this );
+
+ gtk_signal_connect( GTK_OBJECT(m_widget), "configure_event",
+ GTK_SIGNAL_FUNC(gtk_dialog_configure_callback), (gpointer)this );
+
+ /* disable native tab traversal */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "focus",
+ GTK_SIGNAL_FUNC(gtk_dialog_focus_callback), (gpointer)this );
+
+ return TRUE;