X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc7ba044ac495fd073faa5635656dda1356c92c5..6178debcd342963974dbdce6ac2ddb2fbe89e42a:/src/osx/carbon/frame.cpp?ds=sidebyside diff --git a/src/osx/carbon/frame.cpp b/src/osx/carbon/frame.cpp index 1562121569..92ee6a94f5 100644 --- a/src/osx/carbon/frame.cpp +++ b/src/osx/carbon/frame.cpp @@ -61,7 +61,8 @@ bool wxFrame::Create(wxWindow *parent, wxFrame::~wxFrame() { - m_isBeingDeleted = true; + SendDestroyEvent(); + DeleteAllBars(); } @@ -77,11 +78,11 @@ wxPoint wxFrame::GetClientAreaOrigin() const int w, h; toolbar->GetSize(&w, &h); - if ( toolbar->GetWindowStyleFlag() & wxTB_VERTICAL ) + if ( toolbar->HasFlag(wxTB_LEFT) ) { pt.x += w; } - else + else if ( HasFlag(wxTB_TOP) ) { #if !wxOSX_USE_NATIVE_TOOLBAR pt.y += h; @@ -152,7 +153,7 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) wxSysColourChangedEvent event2; event2.SetEventObject( m_frameStatusBar ); - m_frameStatusBar->ProcessEvent(event2); + m_frameStatusBar->GetEventHandler()->ProcessEvent(event2); } #endif // wxUSE_STATUSBAR @@ -230,9 +231,6 @@ void wxFrame::HandleResized( double timestampsec ) #if wxUSE_MENUS void wxFrame::DetachMenuBar() { - if ( m_frameMenuBar ) - m_frameMenuBar->UnsetInvokingWindow(); - wxFrameBase::DetachMenuBar(); } @@ -256,7 +254,6 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar ) if (m_frameMenuBar) { - m_frameMenuBar->SetInvokingWindow( this ); if (makeCurrent) m_frameMenuBar->MacInstallMenuBar(); } @@ -336,17 +333,20 @@ void wxFrame::SetToolBar(wxToolBar *toolbar) if ( m_frameToolBar == toolbar ) return ; +#ifndef __WXOSX_IPHONE__ #if wxOSX_USE_NATIVE_TOOLBAR if ( m_frameToolBar ) m_frameToolBar->MacInstallNativeToolbar( false ) ; #endif - +#endif m_frameToolBar = toolbar ; +#ifndef __WXOSX_IPHONE__ #if wxOSX_USE_NATIVE_TOOLBAR if ( toolbar ) toolbar->MacInstallNativeToolbar( true ) ; #endif +#endif } wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) @@ -362,7 +362,7 @@ void wxFrame::PositionToolBar() int cw, ch; GetSize( &cw , &ch ) ; - + int statusX = 0 ; int statusY = 0 ; @@ -374,6 +374,12 @@ void wxFrame::PositionToolBar() } #endif +#ifdef __WXOSX_IPHONE__ + // TODO integrate this in a better way, on iphone the status bar is not a child of the content view + // but the toolbar is + ch -= 20; +#endif + if (GetToolBar()) { int tx, ty, tw, th;