X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/047ac72bbe45c9ee5ea271fdfa7a3c033dd93d05..59d04dff037f66e9e73b389de72835211f5f0bcd:/src/gtk/frame.cpp diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 1b4e646433..acad4c3355 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -216,7 +216,7 @@ bool wxFrame::Create( wxWindow *parent, long style, const wxString &name ) { - bool rt = wxTopLevelWindow::Create(parent, id, title, pos, sizeOrig, + bool rt = wxTopLevelWindow::Create(parent, id, title, pos, sizeOrig, style, name); m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame; return rt; @@ -235,7 +235,7 @@ wxFrame::~wxFrame() void wxFrame::DoGetClientSize( int *width, int *height ) const { wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); - + wxTopLevelWindow::DoGetClientSize( width, height ); if (height) @@ -253,7 +253,7 @@ void wxFrame::DoGetClientSize( int *width, int *height ) const #if wxUSE_STATUSBAR // status bar - if (m_frameStatusBar && m_frameStatusBar->IsShown()) + if (m_frameStatusBar && m_frameStatusBar->IsShown()) (*height) -= wxSTATUS_HEIGHT; #endif // wxUSE_STATUSBAR @@ -443,7 +443,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), ww = m_width - 2*m_miniEdge; hh = m_toolBarDetached ? wxPLACE_HOLDER : m_frameToolBar->m_height; - + client_area_y_offset += hh; } @@ -581,7 +581,7 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar ) } // resize window in OnInternalIdle - m_sizeSet = FALSE; + GtkUpdateSize(); } #endif // wxUSE_MENUS_NATIVE @@ -598,16 +598,18 @@ wxToolBar* wxFrame::CreateToolBar( long style, wxWindowID id, const wxString& na m_insertInClientArea = TRUE; - m_sizeSet = FALSE; + GtkUpdateSize(); return m_frameToolBar; } void wxFrame::SetToolBar(wxToolBar *toolbar) { + bool hadTbar = m_frameToolBar != NULL; + wxFrameBase::SetToolBar(toolbar); - if (m_frameToolBar) + if ( m_frameToolBar ) { // insert into toolbar area if not already there if ((m_frameToolBar->m_widget->parent) && @@ -619,6 +621,14 @@ void wxFrame::SetToolBar(wxToolBar *toolbar) GtkUpdateSize(); } } + else // toolbar unset + { + // still need to update size if it had been there before + if ( hadTbar ) + { + GtkUpdateSize(); + } + } } #endif // wxUSE_TOOLBAR @@ -633,7 +643,7 @@ wxStatusBar* wxFrame::CreateStatusBar(int number, wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); // because it will change when toolbar is added - m_sizeSet = FALSE; + GtkUpdateSize(); return wxFrameBase::CreateStatusBar( number, style, id, name ); } @@ -643,7 +653,7 @@ void wxFrame::PositionStatusBar() if ( !m_frameStatusBar ) return; - m_sizeSet = FALSE; + GtkUpdateSize(); } #endif // wxUSE_STATUSBAR