X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/de1359180540b5c5e11eddd4c3d08db4e38d59ea..bf38cbffd54c50dd11c89f34542704f92db174eb:/src/gtk1/frame.cpp diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 8d0d64c9ca..934ea9d990 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -19,6 +19,10 @@ #include "wx/toolbar.h" #include "wx/statusbr.h" #include "wx/dcclient.h" + +#include "glib.h" +#include "gdk/gdk.h" +#include "gtk/gtk.h" #include "wx/gtk/win_gtk.h" //----------------------------------------------------------------------------- @@ -142,6 +146,10 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, m_widget = gtk_window_new( win_type ); +#ifdef __WXDEBUG__ + debug_focus_in( m_widget, "wxFrame::m_widget", name ); +#endif + if ((size.x != -1) && (size.y != -1)) gtk_widget_set_usize( m_widget, m_width, m_height ); if ((pos.x != -1) && (pos.y != -1)) @@ -159,6 +167,10 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, gtk_widget_show( m_wxwindow ); GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS ); +#ifdef __WXDEBUG__ + debug_focus_in( m_wxwindow, "wxFrame::m_wxwindow", name ); +#endif + gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow ); gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate", @@ -181,7 +193,16 @@ wxFrame::~wxFrame() if (m_frameToolBar) delete m_frameToolBar; wxTopLevelWindows.DeleteObject( this ); - if (wxTopLevelWindows.Number() == 0) wxTheApp->ExitMainLoop(); + + if (wxTheApp->GetTopWindow() == this) + { + wxTheApp->SetTopWindow( (wxWindow*) NULL ); + } + + if (wxTopLevelWindows.Number() == 0) + { + wxTheApp->ExitMainLoop(); + } } bool wxFrame::Show( bool show ) @@ -382,9 +403,9 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height if (m_frameMenuBar) { int xx = m_miniEdge; - int yy = m_miniEdge + m_miniTitle; - int ww = m_width - 2*m_miniEdge; - int hh = wxMENU_HEIGHT; + int yy = m_miniEdge + m_miniTitle; + int ww = m_width - 2*m_miniEdge; + int hh = wxMENU_HEIGHT; m_frameMenuBar->m_x = xx; m_frameMenuBar->m_y = yy; m_frameMenuBar->m_width = ww; @@ -397,9 +418,9 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height if (m_frameToolBar) { int xx = m_miniEdge; - int yy = m_miniEdge + m_miniTitle; + int yy = m_miniEdge + m_miniTitle; if (m_frameMenuBar) yy += wxMENU_HEIGHT; - int ww = m_width - 2*m_miniEdge; + int ww = m_width - 2*m_miniEdge; int hh = m_frameToolBar->m_height; m_frameToolBar->m_x = xx; @@ -414,9 +435,9 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height if (m_frameStatusBar) { int xx = 0 + m_miniEdge; - int yy = m_height - wxSTATUS_HEIGHT - m_miniEdge; - int ww = m_width - 2*m_miniEdge; - int hh = wxSTATUS_HEIGHT; + int yy = m_height - wxSTATUS_HEIGHT - m_miniEdge; + int ww = m_width - 2*m_miniEdge; + int hh = wxSTATUS_HEIGHT; m_frameStatusBar->m_x = xx; m_frameStatusBar->m_y = yy; @@ -521,7 +542,7 @@ void wxFrame::SetMenuBar( wxMenuBar *menuBar ) } } - if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); + m_sizeSet = FALSE; } wxMenuBar *wxFrame::GetMenuBar() const @@ -539,7 +560,7 @@ wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& nam GetChildren().DeleteObject( m_frameToolBar ); - if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); + m_sizeSet = FALSE; return m_frameToolBar; } @@ -562,7 +583,7 @@ wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, co m_frameStatusBar = OnCreateStatusBar( number, style, id, name ); - if (m_sizeSet) GtkOnSize( m_x, m_y, m_width, m_height ); + m_sizeSet = FALSE; return m_frameStatusBar; }