X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..82a16d7e5e5c83e95a4caa7314de2dbfbd1debdc:/src/common/framecmn.cpp diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index f451627440..0020580068 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -155,8 +155,7 @@ wxPoint wxFrameBase::GetClientAreaOrigin() const { wxPoint pt = wxTopLevelWindow::GetClientAreaOrigin(); -#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__) && \ - (!defined(__WXWINCE__) || (_WIN32_WCE >= 400 && !defined(WIN32_PLATFORM_PSPC) && !defined(WIN32_PLATFORM_WFSP))) +#if wxUSE_TOOLBAR && !defined(__WXUNIVERSAL__) wxToolBar *toolbar = GetToolBar(); if ( toolbar && toolbar->IsShown() ) { @@ -177,6 +176,15 @@ wxPoint wxFrameBase::GetClientAreaOrigin() const return pt; } + +void wxFrameBase::SendSizeEvent() +{ + wxSizeEvent event( GetSize(), GetId() ); + event.SetEventObject( this ); + GetEventHandler()->AddPendingEvent( event ); +} + + // ---------------------------------------------------------------------------- // misc // ---------------------------------------------------------------------------- @@ -219,7 +227,7 @@ bool wxFrameBase::ProcessCommand(int id) void wxFrameBase::UpdateWindowUI(long flags) { wxWindowBase::UpdateWindowUI(flags); - + #if wxUSE_TOOLBAR if (GetToolBar()) GetToolBar()->UpdateWindowUI(flags); @@ -287,7 +295,7 @@ void wxFrameBase::OnMenuClose(wxMenuEvent& WXUNUSED(event)) void wxFrameBase::OnInternalIdle() { wxTopLevelWindow::OnInternalIdle(); - + #if wxUSE_MENUS && wxUSE_IDLEMENUUPDATES if (wxUpdateUIEvent::CanUpdate(this)) DoMenuUpdates(); @@ -310,9 +318,7 @@ wxStatusBar* wxFrameBase::CreateStatusBar(int number, wxCHECK_MSG( !m_frameStatusBar, (wxStatusBar *)NULL, wxT("recreating status bar in wxFrame") ); - m_frameStatusBar = OnCreateStatusBar( number, style, id, name ); - if ( m_frameStatusBar ) - PositionStatusBar(); + SetStatusBar(OnCreateStatusBar(number, style, id, name)); return m_frameStatusBar; } @@ -387,6 +393,19 @@ bool wxFrameBase::ShowMenuHelp(wxStatusBar *WXUNUSED(statbar), int menuId) #endif // wxUSE_MENUS/!wxUSE_MENUS } +void wxFrameBase::SetStatusBar(wxStatusBar *statBar) +{ + bool hadBar = m_frameStatusBar != NULL; + m_frameStatusBar = statBar; + + if ( (m_frameStatusBar != NULL) != hadBar ) + { + PositionStatusBar(); + + DoLayout(); + } +} + #endif // wxUSE_STATUSBAR void wxFrameBase::DoGiveHelp(const wxString& text, bool show) @@ -427,6 +446,9 @@ void wxFrameBase::DoGiveHelp(const wxString& text, bool show) } statbar->SetStatusText(help, m_statusBarPane); +#else + wxUnusedVar(text); + wxUnusedVar(show); #endif // wxUSE_STATUSBAR } @@ -458,7 +480,7 @@ wxToolBar* wxFrameBase::CreateToolBar(long style, style = wxBORDER_NONE | wxTB_HORIZONTAL | wxTB_FLAT; } - m_frameToolBar = OnCreateToolBar(style, id, name); + SetToolBar(OnCreateToolBar(style, id, name)); return m_frameToolBar; } @@ -472,6 +494,19 @@ wxToolBar* wxFrameBase::OnCreateToolBar(long style, style, name); } +void wxFrameBase::SetToolBar(wxToolBar *toolbar) +{ + bool hadBar = m_frameToolBar != NULL; + m_frameToolBar = toolbar; + + if ( (m_frameToolBar != NULL) != hadBar ) + { + PositionToolBar(); + + DoLayout(); + } +} + #endif // wxUSE_TOOLBAR // ----------------------------------------------------------------------------