X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/065e208ec09e3d08d51d9604497f92f53c210f93..15e42bb781df7f069cc3b008f2a8004e398820af:/src/cocoa/frame.mm diff --git a/src/cocoa/frame.mm b/src/cocoa/frame.mm index 7c21de34f4..78b82d4f8c 100644 --- a/src/cocoa/frame.mm +++ b/src/cocoa/frame.mm @@ -1,19 +1,21 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cocoa/frame.mm +// Name: src/cocoa/frame.mm // Purpose: wxFrame // Author: David Elliott // Modified by: // Created: 2003/03/16 -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" + +#include "wx/frame.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" @@ -32,8 +34,6 @@ BEGIN_EVENT_TABLE(wxFrame, wxFrameBase) END_EVENT_TABLE() -IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow) - void wxFrame::Init() { m_frameNSView = nil; @@ -168,7 +168,7 @@ void wxFrame::CocoaReplaceView(WX_NSView oldView, WX_NSView 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]; @@ -179,6 +179,8 @@ void wxFrame::UpdateFrameNSView() 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 @@ -278,18 +280,10 @@ wxToolBar* wxFrame::CreateToolBar(long style, const wxString& name) { wxAutoNSAutoreleasePool pool; - wxFrameBase::CreateToolBar(style,winid,name); - if(m_frameToolBar) - { - m_frameToolBar->CocoaRemoveFromParent(); - m_frameToolBar->SetOwningFrame(this); - } - UpdateFrameNSView(); - return m_frameToolBar; + return wxFrameBase::CreateToolBar(style,winid,name); } #endif // wxUSE_TOOLBAR void wxFrame::PositionStatusBar() { } -