]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toplevel.cpp
rest of 1061091, clean up define a bit
[wxWidgets.git] / src / mac / carbon / toplevel.cpp
index 23472b4bf8bbc9577f767277a1cf082001dbe075..c4914ac596a486242fbf70985ac4ee284af73bd2 100644 (file)
@@ -49,6 +49,9 @@
 
 #include <ToolUtils.h>
 
+//For targeting OSX
+#include "wx/mac/private.h"
+
 // ----------------------------------------------------------------------------
 // globals
 // ----------------------------------------------------------------------------
@@ -518,15 +521,6 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
                 cursorPoint += cursorTarget->GetPosition() ;
         }
 
-        // update focus
-
-        if ( wxevent.GetEventType() == wxEVT_LEFT_DOWN )
-        {
-            // set focus to this window
-            if (currentMouseWindow->AcceptsFocus() && wxWindow::FindFocus()!=currentMouseWindow)
-                currentMouseWindow->SetFocus();
-        }
-
         // make tooltips current
         
     #if wxUSE_TOOLTIPS
@@ -539,6 +533,15 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
             result = noErr;
         else
         {
+            // if the user code did _not_ handle the event, then perform the
+            // default processing
+            if ( wxevent.GetEventType() == wxEVT_LEFT_DOWN )
+            {
+                // ... that is set focus to this window
+                if (currentMouseWindow->AcceptsFocus() && wxWindow::FindFocus()!=currentMouseWindow)
+                    currentMouseWindow->SetFocus();
+            }
+
             ControlPartCode dummyPart ;
             // if built-in find control is finding the wrong control (ie static box instead of overlaid
             // button, we cannot let the standard handler do its job, but must handle manually
@@ -983,7 +986,7 @@ void  wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
     {
         wclass = kDocumentWindowClass ;
     }
-#if ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 )
+#if defined( __WXMAC__ ) && TARGET_API_MAC_OSX && ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2 )
     else if ( HasFlag( wxFRAME_DRAWER ) )
     {
         wclass = kDrawerWindowClass;