* Wrap toolbar related code in wxUSE_TOOLBAR
* m_frameToolBar was used where m_frameStatusBar should have been.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23275
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#include "wx/frame.h"
-#include "wx/menu.h"
+#include "wx/wxprec.h"
+#ifndef WX_PRECOMP
+ #include "wx/log.h"
+ #include "wx/app.h"
+ #include "wx/frame.h"
+ #include "wx/menu.h"
+ #include "wx/toolbar.h"
+ #include "wx/statusbr.h"
+#endif // WX_PRECOMP
+
-#include "wx/app.h"
-#include "wx/log.h"
-#include "wx/statusbr.h"
-#include "wx/toolbar.h"
#include "wx/cocoa/autorelease.h"
#include "wx/cocoa/autorelease.h"
{
if(m_frameStatusBar)
height += m_frameStatusBar->GetSize().y;
{
if(m_frameStatusBar)
height += m_frameStatusBar->GetSize().y;
if(m_frameToolBar)
height += m_frameToolBar->GetSize().y;
if(m_frameToolBar)
height += m_frameToolBar->GetSize().y;
wxTopLevelWindow::CocoaSetWxWindowSize(width,height);
}
wxTopLevelWindow::CocoaSetWxWindowSize(width,height);
}
}
NSRect frameRect = [m_frameNSView frame];
float tbarheight = 0.0;
}
NSRect frameRect = [m_frameNSView frame];
float tbarheight = 0.0;
if(m_frameToolBar)
{
NSView *tbarNSView = m_frameToolBar->GetNSViewForSuperview();
if(m_frameToolBar)
{
NSView *tbarNSView = m_frameToolBar->GetNSViewForSuperview();
[tbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMinYMargin];
tbarheight = tbarRect.size.height;
}
[tbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMinYMargin];
tbarheight = tbarRect.size.height;
}
float sbarheight = 0.0;
if(m_frameStatusBar)
{
float sbarheight = 0.0;
if(m_frameStatusBar)
{
[m_frameStatusBar->GetNSViewForSuperview() removeFromSuperview];
[m_frameStatusBar->GetNSViewForSuperview() setAutoresizingMask: NSViewMinYMargin];
if(m_frameStatusBar->GetParent())
[m_frameStatusBar->GetNSViewForSuperview() removeFromSuperview];
[m_frameStatusBar->GetNSViewForSuperview() setAutoresizingMask: NSViewMinYMargin];
if(m_frameStatusBar->GetParent())
- m_frameStatusBar->GetParent()->CocoaAddChild(m_frameToolBar);
+ m_frameStatusBar->GetParent()->CocoaAddChild(m_frameStatusBar);
}
m_frameStatusBar = statusbar;
if(m_frameStatusBar)
}
m_frameStatusBar = statusbar;
if(m_frameStatusBar)
return m_frameStatusBar;
}
return m_frameStatusBar;
}
void wxFrame::SetToolBar(wxToolBar *toolbar)
{
if(m_frameToolBar)
void wxFrame::SetToolBar(wxToolBar *toolbar)
{
if(m_frameToolBar)
UpdateFrameNSView();
return m_frameToolBar;
}
UpdateFrameNSView();
return m_frameToolBar;
}
void wxFrame::PositionStatusBar()
{
void wxFrame::PositionStatusBar()
{