]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toplevel.cpp
Font (possible) fix
[wxWidgets.git] / src / mac / carbon / toplevel.cpp
index 735fd048ee2d20f9be09a5c27ab811d866940930..32a04d0415b0026ce597059e7f22c1c5a66fc395 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
 // 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"
 
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 //For targeting OSX
 #include "wx/mac/private.h"
 
 //For targeting OSX
 #include "wx/mac/private.h"
 
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// trace mask for activation tracing messages
+static const wxChar *TRACE_ACTIVATE = _T("activation");
+
 // ----------------------------------------------------------------------------
 // globals
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // globals
 // ----------------------------------------------------------------------------
@@ -391,7 +394,7 @@ static void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent )
     }
 }
 
     }
 }
 
-ControlRef wxMacFindSubControl( wxTopLevelWindowMac* toplevelWindow, Point location , ControlRef superControl , ControlPartCode *outPart )
+ControlRef wxMacFindSubControl( wxTopLevelWindowMac* toplevelWindow, const Point& location , ControlRef superControl , ControlPartCode *outPart )
 {
     if ( superControl )
     {
 {
     if ( superControl )
     {
@@ -438,7 +441,7 @@ ControlRef wxMacFindSubControl( wxTopLevelWindowMac* toplevelWindow, Point locat
     return NULL ;
 }
 
     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() ) )
 {
 #if TARGET_API_MAC_OSX
     if ( UMAGetSystemVersion() >= 0x1030 && ( toplevelWindow == 0 || toplevelWindow->MacUsesCompositing() ) )
@@ -473,6 +476,7 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
     if ( wxApp::s_captureWindow )
     {
         window = (WindowRef) wxApp::s_captureWindow->MacGetTopLevelWindowRef() ;
     if ( wxApp::s_captureWindow )
     {
         window = (WindowRef) wxApp::s_captureWindow->MacGetTopLevelWindowRef() ;
+        windowPart = inContent ;
     }
 #endif
     
     }
 #endif
     
@@ -818,34 +822,6 @@ DEFINE_ONE_SHOT_HANDLER_GETTER( wxMacTopLevelEventHandler )
 
 // Find an item given the Macintosh Window Reference
 
 
 // Find an item given the Macintosh Window Reference
 
-#if KEY_wxList_DEPRECATED
-wxList wxWinMacWindowList(wxKEY_INTEGER);
-wxTopLevelWindowMac *wxFindWinFromMacWindow(WindowRef inWindowRef)
-{
-    wxNode *node = wxWinMacWindowList.Find((long)inWindowRef);
-    if (!node)
-        return NULL;
-    return (wxTopLevelWindowMac *)node->GetData();
-}
-
-void wxAssociateWinWithMacWindow(WindowRef inWindowRef, wxTopLevelWindowMac *win) ;
-void wxAssociateWinWithMacWindow(WindowRef inWindowRef, wxTopLevelWindowMac *win)
-{
-    // adding NULL WindowRef is (first) surely a result of an error and
-    // (secondly) breaks menu command processing
-    wxCHECK_RET( inWindowRef != (WindowRef) NULL, wxT("attempt to add a NULL WindowRef to window list") );
-
-    if ( !wxWinMacWindowList.Find((long)inWindowRef) )
-        wxWinMacWindowList.Append((long)inWindowRef, win);
-}
-
-void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) ;
-void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win)
-{
-    wxWinMacWindowList.DeleteObject(win);
-}
-#else
-
 WX_DECLARE_HASH_MAP(WindowRef, wxTopLevelWindowMac*, wxPointerHash, wxPointerEqual, MacWindowMap);
 
 static MacWindowMap wxWinMacWindowList;
 WX_DECLARE_HASH_MAP(WindowRef, wxTopLevelWindowMac*, wxPointerHash, wxPointerEqual, MacWindowMap);
 
 static MacWindowMap wxWinMacWindowList;
@@ -880,7 +856,6 @@ void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win)
         }
     }
 }
         }
     }
 }
-#endif // deprecated wxList
 
 // ----------------------------------------------------------------------------
 // wxTopLevelWindowMac creation
 
 // ----------------------------------------------------------------------------
 // wxTopLevelWindowMac creation
@@ -1272,14 +1247,16 @@ void wxTopLevelWindowMac::MacDelayedDeactivation(long timestamp)
 {
     if(s_macDeactivateWindow)
     {
 {
     if(s_macDeactivateWindow)
     {
-        wxLogDebug(wxT("Doing delayed deactivation of %p"),s_macDeactivateWindow);
+        wxLogTrace(TRACE_ACTIVATE,
+                   wxT("Doing delayed deactivation of %p"),
+                   s_macDeactivateWindow);
         s_macDeactivateWindow->MacActivate(timestamp, false);
     }
 }
 
 void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating )
 {
         s_macDeactivateWindow->MacActivate(timestamp, false);
     }
 }
 
 void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating )
 {
-    // wxLogDebug(wxT("TopLevel=%p::MacActivate"),this);
+    wxLogTrace(TRACE_ACTIVATE, wxT("TopLevel=%p::MacActivate"), this);
 
     if(s_macDeactivateWindow==this)
         s_macDeactivateWindow=NULL;
 
     if(s_macDeactivateWindow==this)
         s_macDeactivateWindow=NULL;