]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/frame.cpp
Add a public wxModalDialogHook class for intercepting modal dialogs.
[wxWidgets.git] / src / gtk1 / frame.cpp
index 1deda790eb7f44f9f0167c07790af3fc4cb2bbd8..304c152a579b34dd3b3b4903859d9c408d0b7644 100644 (file)
 #ifndef WX_PRECOMP
     #include "wx/app.h"
     #include "wx/dcclient.h"
 #ifndef WX_PRECOMP
     #include "wx/app.h"
     #include "wx/dcclient.h"
-#endif // WX_PRECOMP
-
-#include "wx/dialog.h"
-#include "wx/control.h"
-#include "wx/menu.h"
-#if wxUSE_TOOLBAR
+    #include "wx/menu.h"
+    #include "wx/dialog.h"
+    #include "wx/control.h"
     #include "wx/toolbar.h"
     #include "wx/toolbar.h"
-#endif
-#if wxUSE_STATUSBAR
     #include "wx/statusbr.h"
     #include "wx/statusbr.h"
-#endif
+#endif // WX_PRECOMP
 
 #include <glib.h>
 #include "wx/gtk1/private.h"
 
 #include <glib.h>
 #include "wx/gtk1/private.h"
@@ -61,8 +56,6 @@ extern bool g_isIdle;
 // event tables
 // ----------------------------------------------------------------------------
 
 // event tables
 // ----------------------------------------------------------------------------
 
-IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow)
-
 // ============================================================================
 // implementation
 // ============================================================================
 // ============================================================================
 // implementation
 // ============================================================================
@@ -234,7 +227,8 @@ bool wxFrame::Create( wxWindow *parent,
 
 wxFrame::~wxFrame()
 {
 
 wxFrame::~wxFrame()
 {
-    m_isBeingDeleted = true;
+    SendDestroyEvent();
+
     DeleteAllBars();
 }
 
     DeleteAllBars();
 }
 
@@ -390,7 +384,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
         geom.max_width = maxWidth;
         geom.max_height = maxHeight;
         gtk_window_set_geometry_hints( GTK_WINDOW(m_widget),
         geom.max_width = maxWidth;
         geom.max_height = maxHeight;
         gtk_window_set_geometry_hints( GTK_WINDOW(m_widget),
-                                       (GtkWidget*) NULL,
+                                       NULL,
                                        &geom,
                                        (GdkWindowHints) flag );
 
                                        &geom,
                                        (GdkWindowHints) flag );
 
@@ -491,7 +485,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
         gtk_pizza_set_size( GTK_PIZZA(m_wxwindow),
                             m_frameStatusBar->m_widget,
                             xx, yy, ww, hh );
         gtk_pizza_set_size( GTK_PIZZA(m_wxwindow),
                             m_frameStatusBar->m_widget,
                             xx, yy, ww, hh );
-        gtk_widget_draw( m_frameStatusBar->m_widget, (GdkRectangle*) NULL );
+        gtk_widget_draw( m_frameStatusBar->m_widget, NULL );
     }
 #endif // wxUSE_STATUSBAR
 
     }
 #endif // wxUSE_STATUSBAR
 
@@ -500,7 +494,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
     // send size event to frame
     wxSizeEvent event( wxSize(m_width,m_height), GetId() );
     event.SetEventObject( this );
     // send size event to frame
     wxSizeEvent event( wxSize(m_width,m_height), GetId() );
     event.SetEventObject( this );
-    GetEventHandler()->ProcessEvent( event );
+    HandleWindowEvent( event );
 
 #if wxUSE_STATUSBAR
     // send size event to status bar
 
 #if wxUSE_STATUSBAR
     // send size event to status bar
@@ -508,7 +502,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
     {
         wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() );
         event2.SetEventObject( m_frameStatusBar );
     {
         wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() );
         event2.SetEventObject( m_frameStatusBar );
-        m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
+        m_frameStatusBar->HandleWindowEvent( event2 );
     }
 #endif // wxUSE_STATUSBAR
 
     }
 #endif // wxUSE_STATUSBAR
 
@@ -556,7 +550,7 @@ void wxFrame::DetachMenuBar()
 
     if ( m_frameMenuBar )
     {
 
     if ( m_frameMenuBar )
     {
-        m_frameMenuBar->UnsetInvokingWindow( this );
+        m_frameMenuBar->Attach( this );
 
         if (m_frameMenuBar->GetWindowStyle() & wxMB_DOCKABLE)
         {
 
         if (m_frameMenuBar->GetWindowStyle() & wxMB_DOCKABLE)
         {
@@ -581,8 +575,6 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
 
     if (m_frameMenuBar)
     {
 
     if (m_frameMenuBar)
     {
-        m_frameMenuBar->SetInvokingWindow( this );
-
         m_frameMenuBar->SetParent(this);
         gtk_pizza_put( GTK_PIZZA(m_mainWidget),
                 m_frameMenuBar->m_widget,
         m_frameMenuBar->SetParent(this);
         gtk_pizza_put( GTK_PIZZA(m_mainWidget),
                 m_frameMenuBar->m_widget,