]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/dialog.cpp
missing comma for Motif compilation added
[wxWidgets.git] / src / gtk1 / dialog.cpp
index 596c4a5a9ab441e37f2803dd94d56337e9693931..a6616c919c496678ce923d704c210907b9f362f3 100644 (file)
@@ -38,14 +38,8 @@ extern wxList wxPendingDelete;
 
 bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxDialog *win )
 {
 
 bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxDialog *win )
 {
-    if (g_isIdle) wxapp_install_idle_handler();
-
-/*
-    printf( "OnDelete from " );
-    if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
-        printf( win->GetClassInfo()->GetClassName() );
-    printf( ".\n" );
-*/
+    if (g_isIdle) 
+        wxapp_install_idle_handler();
 
     win->Close();
 
 
     win->Close();
 
@@ -58,21 +52,17 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED
 
 static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxDialog *win )
 {
 
 static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxDialog *win )
 {
-    if (g_isIdle) wxapp_install_idle_handler();
+    if (g_isIdle) 
+        wxapp_install_idle_handler();
 
     if (!win->m_hasVMT) return;
 
 
     if (!win->m_hasVMT) return;
 
-/*
-    printf( "OnDialogResize from " );
-    if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
-        printf( win->GetClassInfo()->GetClassName() );
-    printf( ".\n" );
-*/
-
-   if ((win->m_width != alloc->width) || (win->m_height != alloc->height))
-   {
-       win->InternalSetSize( alloc->width, alloc->height );
-   }
+    if ((win->m_width != alloc->width) || (win->m_height != alloc->height))
+    {
+        win->m_width = alloc->width;
+        win->m_height = alloc->height;
+        win->UpdateSize();
+    }
 }
 
 //-----------------------------------------------------------------------------
 }
 
 //-----------------------------------------------------------------------------
@@ -81,11 +71,13 @@ static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation
 
 static gint gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *event, wxDialog *win )
 {
 
 static gint gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *event, wxDialog *win )
 {
-    if (g_isIdle) wxapp_install_idle_handler();
+    if (g_isIdle) 
+        wxapp_install_idle_handler();
 
     if (!win->m_hasVMT) return FALSE;
 
 
     if (!win->m_hasVMT) return FALSE;
 
-    win->InternalSetPosition(event->x, event->y);
+    win->m_x = event->x;
+    win->m_y = event->y;
 
     wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() );
     mevent.SetEventObject( win );
 
     wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() );
     mevent.SetEventObject( win );
@@ -253,6 +245,8 @@ bool wxDialog::Create( wxWindow *parent,
 
 wxDialog::~wxDialog()
 {
 
 wxDialog::~wxDialog()
 {
+    m_isBeingDeleted = TRUE;
+    
     wxTopLevelWindows.DeleteObject( this );
 
     if (wxTheApp->GetTopWindow() == this)
     wxTopLevelWindows.DeleteObject( this );
 
     if (wxTheApp->GetTopWindow() == this)
@@ -292,13 +286,13 @@ void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
     else
     {
         SetReturnCode(wxID_CANCEL);
     else
     {
         SetReturnCode(wxID_CANCEL);
-        this->Show(FALSE);
+        Show(FALSE);
     }
 }
 
 void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) )
 {
     }
 }
 
 void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) )
 {
-    if ( Validate() && TransferDataFromWindow())
+    if (Validate() && TransferDataFromWindow())
     {
         if (IsModal())
         {
     {
         if (IsModal())
         {
@@ -512,21 +506,11 @@ bool wxDialog::Show( bool show )
         GtkOnSize( m_x, m_y, m_width, m_height );
     }
 
         GtkOnSize( m_x, m_y, m_width, m_height );
     }
 
-    if (show != m_isShown)
-    {
-        if (show)
-        {
-            gtk_widget_show( m_widget );
-        }
-        else
-            gtk_widget_hide( m_widget );
-            
-        m_isShown = show;
-    }
+    bool ret = wxWindow::Show( show );
 
     if (show) InitDialog();
 
 
     if (show) InitDialog();
 
-    return TRUE;
+    return ret;
 }
 
 bool wxDialog::IsModal() const
 }
 
 bool wxDialog::IsModal() const
@@ -591,6 +575,8 @@ void wxDialog::SetIcon( const wxIcon &icon )
     m_icon = icon;
     if (!icon.Ok()) return;
 
     m_icon = icon;
     if (!icon.Ok()) return;
 
+    if (!m_widget->window) return;
+
     wxMask *mask = icon.GetMask();
     GdkBitmap *bm = (GdkBitmap *) NULL;
     if (mask) bm = mask->GetBitmap();
     wxMask *mask = icon.GetMask();
     GdkBitmap *bm = (GdkBitmap *) NULL;
     if (mask) bm = mask->GetBitmap();