/////////////////////////////////////////////////////////////////////////////
-// Name: src/mac/carbon/frame.cpp
+// Name: src/osx/carbon/frame.cpp
// Purpose: wxFrame
// Author: Stefan Csomor
// Modified by:
#include "wx/menuitem.h"
#endif // WX_PRECOMP
-#include "wx/osx/uma.h"
+#include "wx/osx/private.h"
BEGIN_EVENT_TABLE(wxFrame, wxFrameBase)
EVT_ACTIVATE(wxFrame::OnActivate)
- // EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
-// EVT_IDLE(wxFrame::OnIdle)
-// EVT_CLOSE(wxFrame::OnCloseWindow)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxTopLevelWindow)
}
else
{
-#if !wxMAC_USE_NATIVE_TOOLBAR
+#if !wxOSX_USE_NATIVE_TOOLBAR
pt.y += h;
#endif
}
if ( !wxWindow::Enable(enable) )
return false;
+#if wxUSE_MENUS
if ( m_frameMenuBar && m_frameMenuBar == wxMenuBar::MacGetInstalledMenuBar() )
{
int iMaxMenu = m_frameMenuBar->GetMenuCount();
m_frameMenuBar->EnableTop( i , enable ) ;
}
}
-
+#endif
return true;
}
wxSetFocusToChild(parent, &m_winLastFocused);
+#if wxUSE_MENUS
if (m_frameMenuBar != NULL)
{
m_frameMenuBar->MacInstallMenuBar();
tlf->GetMenuBar()->MacInstallMenuBar();
}
}
+#endif
}
}
+void wxFrame::HandleResized( double timestampsec )
+{
+ // according to the other ports we handle this within the OS level
+ // resize event, not within a wxSizeEvent
+
+ PositionBars();
+
+ wxNonOwnedWindow::HandleResized( timestampsec );
+}
+
+#if wxUSE_MENUS
void wxFrame::DetachMenuBar()
{
if ( m_frameMenuBar )
void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
{
- wxFrame* tlf = wxDynamicCast( wxFindWinFromMacWindow( FrontNonFloatingWindow() ) , wxFrame );
+#if wxOSX_USE_CARBON
+ wxFrame* tlf = wxDynamicCast( wxNonOwnedWindow::GetFromWXWindow( (WXWindow) FrontNonFloatingWindow() ) , wxFrame );
+#else
+ wxFrame* tlf = (wxFrame*) wxTheApp->GetTopWindow();
+#endif
bool makeCurrent = false;
// if this is already the current menubar or we are the frontmost window
m_frameMenuBar->MacInstallMenuBar();
}
}
+#endif
void wxFrame::DoGetClientSize(int *x, int *y) const
{
}
else
{
-#if !wxMAC_USE_NATIVE_TOOLBAR
+#if !wxOSX_USE_NATIVE_TOOLBAR
if ( y )
*y -= h;
#endif
if ( m_frameToolBar == toolbar )
return ;
-#if wxMAC_USE_NATIVE_TOOLBAR
+#if wxOSX_USE_NATIVE_TOOLBAR
if ( m_frameToolBar )
m_frameToolBar->MacInstallNativeToolbar( false ) ;
#endif
m_frameToolBar = toolbar ;
-#if wxMAC_USE_NATIVE_TOOLBAR
+#if wxOSX_USE_NATIVE_TOOLBAR
if ( toolbar )
toolbar->MacInstallNativeToolbar( true ) ;
#endif
}
else
{
-#if !wxMAC_USE_NATIVE_TOOLBAR
+#if !wxOSX_USE_NATIVE_TOOLBAR
// Use the 'real' position
GetToolBar()->SetSize(tx , ty , cw , th, wxSIZE_NO_ADJUSTMENTS );
#endif