///////////////////////////////////////////////////////////////////////////////
-// Name: mac/toplevel.cpp
+// Name: src/mac/carbon/toplevel.cpp
// Purpose: implements wxTopLevelWindow for Mac
// Author: Stefan Csomor
// Modified by:
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "toplevel.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
}
}
-ControlRef wxMacFindSubControl( wxTopLevelWindowMac* toplevelWindow, Point location , ControlRef superControl , ControlPartCode *outPart )
+ControlRef wxMacFindSubControl( wxTopLevelWindowMac* toplevelWindow, const Point& location , ControlRef superControl , ControlPartCode *outPart )
{
if ( superControl )
{
return NULL ;
}
-ControlRef wxMacFindControlUnderMouse( wxTopLevelWindowMac* toplevelWindow , Point location , WindowRef window , ControlPartCode *outPart )
+ControlRef wxMacFindControlUnderMouse( wxTopLevelWindowMac* toplevelWindow , const Point& location , WindowRef window , ControlPartCode *outPart )
{
#if TARGET_API_MAC_OSX
if ( UMAGetSystemVersion() >= 0x1030 && ( toplevelWindow == 0 || toplevelWindow->MacUsesCompositing() ) )
windowPart = inContent ;
}
#endif
-
+
if ( window )
{
QDGlobalToLocalPoint( UMAGetWindowPort(window ) , &windowMouseLocation ) ;
eventleave.SetEventType( wxEVT_LEAVE_WINDOW );
g_MacLastWindow->ScreenToClient( &eventleave.m_x, &eventleave.m_y );
eventleave.SetEventObject( g_MacLastWindow ) ;
-
+ wxevent.SetId( g_MacLastWindow->GetId() ) ;
#if wxUSE_TOOLTIPS
wxToolTip::RelayEvent( g_MacLastWindow , eventleave);
#endif // wxUSE_TOOLTIPS
evententer.SetEventType( wxEVT_ENTER_WINDOW );
currentMouseWindow->ScreenToClient( &evententer.m_x, &evententer.m_y );
evententer.SetEventObject( currentMouseWindow ) ;
+ wxevent.SetId( currentMouseWindow->GetId() ) ;
#if wxUSE_TOOLTIPS
wxToolTip::RelayEvent( currentMouseWindow , evententer);
#endif // wxUSE_TOOLTIPS
currentMouseWindow->ScreenToClient( &wxevent.m_x , &wxevent.m_y ) ;
wxevent.SetEventObject( currentMouseWindow ) ;
+ wxevent.SetId( currentMouseWindow->GetId() ) ;
// make tooltips current
SetName(name);
m_windowId = id == -1 ? NewControlId() : id;
- wxWindow::SetTitle( title ) ;
+ wxWindow::SetLabel( title ) ;
MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ;
// the root control level handleer
MacInstallEventHandler( (WXWidget) m_peer->GetControlRef() ) ;
+#if TARGET_API_MAC_OSX
+ if ( m_macUsesCompositing && m_macWindow != NULL )
+ {
+ if ( GetExtraStyle() & wxFRAME_EX_METAL )
+ MacSetMetalAppearance( true ) ;
+ }
+#endif
+
+
+
// the frame window event handler
InstallStandardEventHandler( GetWindowEventTarget(MAC_WXHWND(m_macWindow)) ) ;
MacInstallTopLevelWindowEventHandler() ;
void wxTopLevelWindowMac::SetTitle(const wxString& title)
{
- wxWindow::SetTitle( title ) ;
+ wxWindow::SetLabel( title ) ;
UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;
}
+wxString wxTopLevelWindowMac::GetTitle() const
+{
+ return wxWindow::GetLabel();
+}
+
bool wxTopLevelWindowMac::Show(bool show)
{
if ( !wxTopLevelWindowBase::Show(show) )
if (show)
{
#if wxUSE_SYSTEM_OPTIONS //code contributed by Ryan Wilcox December 18, 2003
- if ( (wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) ) && ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1) )
+ bool plainTransition = UMAGetSystemVersion() >= 0x1000 ;
+ if ( wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) )
+ plainTransition = ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1 ) ;
+ if ( plainTransition )
{
::ShowWindow( (WindowRef)m_macWindow );
}
else
{
#if wxUSE_SYSTEM_OPTIONS
- if ( (wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) ) && ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1) )
+ bool plainTransition = UMAGetSystemVersion() >= 0x1000 ;
+ if ( wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) )
+ plainTransition = ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1 ) ;
+ if ( plainTransition )
{
::HideWindow((WindowRef) m_macWindow );
}
return m_macFullScreenData != NULL ;
}
+void wxTopLevelWindowMac::SetExtraStyle(long exStyle)
+{
+ if ( GetExtraStyle() == exStyle )
+ return ;
+
+ wxTopLevelWindowBase::SetExtraStyle( exStyle ) ;
+#if TARGET_API_MAC_OSX
+ if ( m_macUsesCompositing && m_macWindow != NULL )
+ {
+ bool metal = GetExtraStyle() & wxFRAME_EX_METAL ;
+ if ( MacGetMetalAppearance() != metal )
+ MacSetMetalAppearance( metal ) ;
+ }
+#endif
+}
+
+
// we are still using coordinates of the content view, todo switch to structure bounds
void wxTopLevelWindowMac::MacGetContentAreaInset( int &left , int &top , int &right , int &bottom )
}
// ---------------------------------------------------------------------------
-