// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
-#include "wx/frame.h"
-#include "wx/menu.h"
-#include "wx/menuitem.h"
-#include "wx/app.h"
-#include "wx/log.h"
-#include "wx/statusbr.h"
-#include "wx/toolbar.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/cocoa/autorelease.h"
[m_frameNSView release];
}
-void wxFrame::Cocoa_wxMenuItemAction(wxMenuItem& item)
-{
- Command(item.GetId());
-}
-
void wxFrame::AttachMenuBar(wxMenuBar *mbar)
{
wxFrameBase::AttachMenuBar(mbar);
return wxPoint(0,0);
}
-void wxFrame::DoGetClientSize(int *width, int *height) const
-{
- wxFrameBase::DoGetClientSize(width,height);
- if(height)
- {
- if(m_frameStatusBar && m_frameStatusBar->IsShown())
- *height -= m_frameStatusBar->GetSize().y;
- }
-}
-
-void wxFrame::DoSetClientSize(int width, int height)
+void wxFrame::CocoaSetWxWindowSize(int width, int height)
{
- if(m_frameStatusBar && m_frameStatusBar->IsShown())
+ if(m_frameStatusBar)
height += m_frameStatusBar->GetSize().y;
- wxFrameBase::DoSetClientSize(width,height);
+#if wxUSE_TOOLBAR
+ if(m_frameToolBar)
+ height += m_frameToolBar->GetSize().y;
+#endif //wxUSE_TOOLBAR
+ wxTopLevelWindow::CocoaSetWxWindowSize(width,height);
}
void wxFrame::CocoaReplaceView(WX_NSView oldView, WX_NSView newView)
}
NSRect frameRect = [m_frameNSView frame];
float tbarheight = 0.0;
+#if wxUSE_TOOLBAR
if(m_frameToolBar)
{
NSView *tbarNSView = m_frameToolBar->GetNSViewForSuperview();
[tbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMinYMargin];
tbarheight = tbarRect.size.height;
}
+#endif //wxUSE_TOOLBAR
float sbarheight = 0.0;
if(m_frameStatusBar)
{
if(m_frameStatusBar)
{
[m_frameStatusBar->GetNSViewForSuperview() removeFromSuperview];
- [m_frameStatusBar->GetNSViewForSuperview() setAutoresizingMask: NSViewNotSizable];
+ [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)
return m_frameStatusBar;
}
+#if wxUSE_TOOLBAR
void wxFrame::SetToolBar(wxToolBar *toolbar)
{
if(m_frameToolBar)
{
[m_frameToolBar->GetNSViewForSuperview() removeFromSuperview];
- [m_frameToolBar->GetNSViewForSuperview() setAutoresizingMask: NSViewNotSizable];
+ [m_frameToolBar->GetNSViewForSuperview() setAutoresizingMask: NSViewMinYMargin];
if(m_frameToolBar->GetParent())
m_frameToolBar->GetParent()->CocoaAddChild(m_frameToolBar);
}
UpdateFrameNSView();
return m_frameToolBar;
}
+#endif // wxUSE_TOOLBAR
void wxFrame::PositionStatusBar()
{