fixing toolbar support, adding iphone

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62832 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2009-12-09 07:28:51 +00:00
parent 073e104114
commit 85c04b8fb5

View File

@ -78,11 +78,11 @@ wxPoint wxFrame::GetClientAreaOrigin() const
int w, h; int w, h;
toolbar->GetSize(&w, &h); toolbar->GetSize(&w, &h);
if ( toolbar->GetWindowStyleFlag() & wxTB_VERTICAL ) if ( toolbar->HasFlag(wxTB_LEFT) )
{ {
pt.x += w; pt.x += w;
} }
else else if ( HasFlag(wxTB_TOP) )
{ {
#if !wxOSX_USE_NATIVE_TOOLBAR #if !wxOSX_USE_NATIVE_TOOLBAR
pt.y += h; pt.y += h;
@ -337,17 +337,20 @@ void wxFrame::SetToolBar(wxToolBar *toolbar)
if ( m_frameToolBar == toolbar ) if ( m_frameToolBar == toolbar )
return ; return ;
#ifndef __WXOSX_IPHONE__
#if wxOSX_USE_NATIVE_TOOLBAR #if wxOSX_USE_NATIVE_TOOLBAR
if ( m_frameToolBar ) if ( m_frameToolBar )
m_frameToolBar->MacInstallNativeToolbar( false ) ; m_frameToolBar->MacInstallNativeToolbar( false ) ;
#endif #endif
#endif
m_frameToolBar = toolbar ; m_frameToolBar = toolbar ;
#ifndef __WXOSX_IPHONE__
#if wxOSX_USE_NATIVE_TOOLBAR #if wxOSX_USE_NATIVE_TOOLBAR
if ( toolbar ) if ( toolbar )
toolbar->MacInstallNativeToolbar( true ) ; toolbar->MacInstallNativeToolbar( true ) ;
#endif #endif
#endif
} }
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
@ -375,6 +378,12 @@ void wxFrame::PositionToolBar()
} }
#endif #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()) if (GetToolBar())
{ {
int tx, ty, tw, th; int tx, ty, tw, th;