+ if(m_frameStatusBar)
+ height += m_frameStatusBar->GetSize().y;
+#if wxUSE_TOOLBAR
+ if(m_frameToolBar)
+ height += m_frameToolBar->GetSize().y;
+#endif //wxUSE_TOOLBAR
+ wxTopLevelWindow::CocoaSetWxWindowSize(width,height);
+}
+
+// -------------------------------------------------------------------
+WX_NSView wxFrame::GetNonClientNSView()
+{
+ if(m_frameNSView)
+ return m_frameNSView;
+ return GetNSViewForSuperview();
+}
+
+void wxFrame::CocoaReplaceView(WX_NSView oldView, WX_NSView newView)
+{
+ // If we have the additional toolbar/statbar view, then the
+ // default replaceSubview will work. Otherwise, the old view
+ // should be the content view and should be replaced that way
+ if(m_frameNSView)
+ wxWindow::CocoaReplaceView(oldView, newView);
+ else
+ wxTopLevelWindow::CocoaReplaceView(oldView, newView);
+}
+
+void wxFrame::UpdateFrameNSView()
+{
+ if(!m_frameNSView)
+ { // NOTE: We only need a plain NSView here since we don't associate it with ourselves.
+ m_frameNSView = [[NSView alloc] initWithFrame:[[m_cocoaNSWindow contentView] frame]];
+ [m_cocoaNSWindow setContentView: m_frameNSView];
+ [m_frameNSView addSubview:m_cocoaNSView];
+ }
+ NSRect frameRect = [m_frameNSView frame];
+ float tbarheight = 0.0;
+#if wxUSE_TOOLBAR
+ if(m_frameToolBar)
+ {
+ NSView *tbarNSView = m_frameToolBar->GetNSViewForSuperview();
+ // If the toolbar doesn't have a superview then set it to our
+ // content view.
+ if(![tbarNSView superview])
+ [m_frameNSView addSubview: tbarNSView];
+ // Do this after addSubView so that SetSize can work
+ m_frameToolBar->SetSize(m_frameToolBar->DoGetBestSize());
+ NSRect tbarRect = [tbarNSView frame];
+ tbarRect.size.width = frameRect.size.width;
+ tbarRect.origin.x = 0.0;
+ tbarRect.origin.y = frameRect.size.height - tbarRect.size.height;
+ [tbarNSView setFrame:tbarRect];
+ // width expands, bottom margin expands
+ [tbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMinYMargin];
+ tbarheight = tbarRect.size.height;
+ }
+#endif //wxUSE_TOOLBAR
+ float sbarheight = 0.0;
+ if(m_frameStatusBar)