void wxFrame::AttachMenuBar(wxMenuBar *mbar)
{
wxFrameBase::AttachMenuBar(mbar);
- wxMenuBarManager::GetInstance()->UpdateWindowMenuBar(this);
+ wxMenuBarManager::GetInstance()->UpdateMenuBar();
}
void wxFrame::DetachMenuBar()
{
wxFrameBase::DetachMenuBar();
- wxMenuBarManager::GetInstance()->UpdateWindowMenuBar(this);
+ wxMenuBarManager::GetInstance()->UpdateMenuBar();
}
void wxFrame::SetMenuBar(wxMenuBar *menubar)
wxFrameBase::DetachMenuBar();
wxFrameBase::AttachMenuBar(menubar);
- wxMenuBarManager::GetInstance()->UpdateWindowMenuBar(this);
+ wxMenuBarManager::GetInstance()->UpdateMenuBar();
}
wxMenuBar* wxFrame::GetAppMenuBar(wxCocoaNSWindow *win)
NSView *tbarNSView = m_frameToolBar->GetNSViewForSuperview();
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;
[sbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMaxYMargin];
sbarheight = sbarRect.size.height;
}
- wxLogDebug("frame height=%f, tbar=%f, sbar=%f",frameRect.size.height,tbarheight,sbarheight);
+ wxLogTrace(wxTRACE_COCOA,wxT("frame height=%f, tbar=%f, sbar=%f"),frameRect.size.height,tbarheight,sbarheight);
NSRect innerRect = [m_cocoaNSView frame];
innerRect.size.height = frameRect.size.height - tbarheight - sbarheight;
innerRect.origin.y = sbarheight;
wxWindowID winid,
const wxString& name)
{
+ wxAutoNSAutoreleasePool pool;
wxFrameBase::CreateStatusBar(number,style,winid,name);
if(m_frameStatusBar)
{
{
if(m_frameToolBar)
{
+ m_frameToolBar->SetOwningFrame(NULL);
[m_frameToolBar->GetNSViewForSuperview() removeFromSuperview];
[m_frameToolBar->GetNSViewForSuperview() setAutoresizingMask: NSViewMinYMargin];
if(m_frameToolBar->GetParent())
if(m_frameToolBar)
{
m_frameToolBar->CocoaRemoveFromParent();
+ m_frameToolBar->SetOwningFrame(this);
}
UpdateFrameNSView();
}
wxWindowID winid,
const wxString& name)
{
+ wxAutoNSAutoreleasePool pool;
wxFrameBase::CreateToolBar(style,winid,name);
if(m_frameToolBar)
{
m_frameToolBar->CocoaRemoveFromParent();
+ m_frameToolBar->SetOwningFrame(this);
}
UpdateFrameNSView();
return m_frameToolBar;