X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f656d37923b37128c06f4bd72d59faaa8b3a8338..17ad51edc74e86c6f914b0a5342d5603ac9d4344:/src/osx/carbon/toolbar.cpp diff --git a/src/osx/carbon/toolbar.cpp b/src/osx/carbon/toolbar.cpp index 3a8dcab8cd..170c37baaa 100644 --- a/src/osx/carbon/toolbar.cpp +++ b/src/osx/carbon/toolbar.cpp @@ -1108,10 +1108,18 @@ bool wxToolBar::MacInstallNativeToolbar(bool usesNative) bResult = true; SetWindowToolbar( tlw, (HIToolbarRef) m_macToolbar ); + + // ShowHideWindowToolbar will make the wxFrame grow + // which we don't want in this case + wxSize sz = GetParent()->GetSize(); ShowHideWindowToolbar( tlw, true, false ); + // Restore the orginal size + GetParent()->SetSize( sz ); + ChangeWindowAttributes( tlw, kWindowToolbarButtonAttribute, 0 ); + SetAutomaticControlDragTrackingEnabledForWindow( tlw, true ); - + m_peer->Move(0,0,0,0 ); SetSize( wxSIZE_AUTO_WIDTH, 0 ); m_peer->SetVisibility( false ); @@ -1145,6 +1153,8 @@ bool wxToolBar::Realize() { if (m_tools.GetCount() == 0) return false; + + wxSize tlw_sz = GetParent()->GetSize(); int maxWidth = 0; int maxHeight = 0; @@ -1353,6 +1363,9 @@ bool wxToolBar::Realize() node = node->GetNext(); } + if (m_macUsesNativeToolbar) + GetParent()->SetSize( tlw_sz ); + if ( GetWindowStyleFlag() & wxTB_HORIZONTAL ) { // if not set yet, only one row @@ -1493,7 +1506,7 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord x, wxCoord y) const node = node->GetNext(); } - return (wxToolBarToolBase*)NULL; + return NULL; } wxString wxToolBar::MacGetToolTipString( wxPoint &pt ) @@ -1510,7 +1523,7 @@ void wxToolBar::DoEnableTool(wxToolBarToolBase *WXUNUSED(t), bool WXUNUSED(enabl // everything already done in the tool's implementation } -void wxToolBar::DoToggleTool(wxToolBarToolBase *t, bool toggle) +void wxToolBar::DoToggleTool(wxToolBarToolBase *WXUNUSED(t), bool WXUNUSED(toggle)) { // everything already done in the tool's implementation }