]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/app.cpp
added include for Mac OS X
[wxWidgets.git] / src / mac / carbon / app.cpp
index f54dbe1e63937e9662815c6103d38d654deedf48..8ad21ed77879e50abd52277b912d90a29471bd67 100644 (file)
@@ -31,6 +31,7 @@
 #include "wx/module.h"
 #include "wx/memory.h"
 #include "wx/tooltip.h"
 #include "wx/module.h"
 #include "wx/memory.h"
 #include "wx/tooltip.h"
+#include "wx/textctrl.h"
 #include "wx/menu.h"
 #if wxUSE_WX_RESOURCES
 #include "wx/resource.h"
 #include "wx/menu.h"
 #if wxUSE_WX_RESOURCES
 #include "wx/resource.h"
@@ -40,7 +41,7 @@
 
 // mac
 
 
 // mac
 
-#ifndef __UNIX__
+#ifndef __DARWIN__
   #if __option(profile)
        #include <profiler.h>
   #endif
   #if __option(profile)
        #include <profiler.h>
   #endif
@@ -52,7 +53,7 @@
 #include "wx/mac/macnotfy.h"
 
 #if wxUSE_SOCKETS
 #include "wx/mac/macnotfy.h"
 
 #if wxUSE_SOCKETS
-    #ifdef __APPLE__
+    #ifdef __DARWIN__
         #include <CoreServices/CoreServices.h>
     #else
         #include <OpenTransport.h>
         #include <CoreServices/CoreServices.h>
     #else
         #include <OpenTransport.h>
@@ -374,7 +375,7 @@ bool wxApp::Initialize()
 #endif
 
 
 #endif
 
 
-#ifndef __UNIX__
+#ifndef __DARWIN__
   // test the minimal configuration necessary
 
        #if !TARGET_CARBON
   // test the minimal configuration necessary
 
        #if !TARGET_CARBON
@@ -427,7 +428,7 @@ bool wxApp::Initialize()
          return FALSE ;
   }
 
          return FALSE ;
   }
 
-#ifndef __UNIX__
+#ifndef __DARWIN__
   #if __option(profile)
        ProfilerInit( collectDetailed, bestTimeBase , 20000 , 40 ) ;
   #endif
   #if __option(profile)
        ProfilerInit( collectDetailed, bestTimeBase , 20000 , 40 ) ;
   #endif
@@ -435,7 +436,7 @@ bool wxApp::Initialize()
 
   // now avoid exceptions thrown for new (bad_alloc)
 
 
   // now avoid exceptions thrown for new (bad_alloc)
 
-#ifndef __UNIX__
+#ifndef __DARWIN__
   std::__throws_bad_alloc = FALSE ;
 #endif
 
   std::__throws_bad_alloc = FALSE ;
 #endif
 
@@ -459,6 +460,7 @@ bool wxApp::Initialize()
   wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
   wxTheColourDatabase->Initialize();
 
   wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
   wxTheColourDatabase->Initialize();
 
+#ifdef __WXDEBUG__
 #if wxUSE_LOG
     // flush the logged messages if any and install a 'safer' log target: the
     // default one (wxLogGui) can't be used after the resources are freed just
 #if wxUSE_LOG
     // flush the logged messages if any and install a 'safer' log target: the
     // default one (wxLogGui) can't be used after the resources are freed just
@@ -469,6 +471,7 @@ bool wxApp::Initialize()
     // this will flush the old messages if any
     delete wxLog::SetActiveTarget(new wxLogStderr);
 #endif // wxUSE_LOG
     // this will flush the old messages if any
     delete wxLog::SetActiveTarget(new wxLogStderr);
 #endif // wxUSE_LOG
+#endif
 
   wxInitializeStockLists();
   wxInitializeStockObjects();
 
   wxInitializeStockLists();
   wxInitializeStockObjects();
@@ -542,7 +545,7 @@ void wxApp::CleanUp()
 
   wxClassInfo::CleanUpClasses();
 
 
   wxClassInfo::CleanUpClasses();
 
-#ifndef __UNIX__
+#ifndef __DARWIN__
   #if __option(profile)
   ProfilerDump( "\papp.prof" ) ;
   ProfilerTerm() ;
   #if __option(profile)
   ProfilerDump( "\papp.prof" ) ;
   ProfilerTerm() ;
@@ -900,11 +903,13 @@ bool wxYield()
 #endif
     EventRecord event ;
 
 #endif
     EventRecord event ;
 
-       long sleepTime = 0 ; //::GetCaretTime();
+       long sleepTime = 1 ; //::GetCaretTime();
 
        while ( !wxTheApp->IsExiting() && WaitNextEvent(everyEvent, &event,sleepTime, wxApp::s_macCursorRgn))
        {
        wxTheApp->MacHandleOneEvent( &event );
 
        while ( !wxTheApp->IsExiting() && WaitNextEvent(everyEvent, &event,sleepTime, wxApp::s_macCursorRgn))
        {
        wxTheApp->MacHandleOneEvent( &event );
+           if ( event.what != kHighLevelEvent )
+                   SetRectRgn( wxApp::s_macCursorRgn , event.where.h , event.where.v ,  event.where.h + 1 , event.where.v + 1 ) ;
        }
 
        wxMacProcessNotifierAndPendingEvents() ;
        }
 
        wxMacProcessNotifierAndPendingEvents() ;
@@ -981,7 +986,7 @@ void wxApp::MacDoOneEvent()
                wxTheApp->ProcessIdle() ;
        }
        if ( event.what != kHighLevelEvent )
                wxTheApp->ProcessIdle() ;
        }
        if ( event.what != kHighLevelEvent )
-               SetRectRgn( s_macCursorRgn , event.where.h - 1 , event.where.v - 1,  event.where.h + 1 , event.where.v + 1 ) ;
+               SetRectRgn( s_macCursorRgn , event.where.h , event.where.v ,  event.where.h + 1 , event.where.v + 1 ) ;
 
        // repeaters
 
 
        // repeaters
 
@@ -1194,6 +1199,8 @@ void wxApp::MacHandleMouseDownEvent( EventRecord *ev )
                                        }
                                        else
                                        {
                                        }
                                        else
                                        {
+                                               if ( win )
+                                                       win->MacMouseDown( ev , windowPart ) ;
                                                UMASelectWindow( window ) ;
                                        }
                                }
                                                UMASelectWindow( window ) ;
                                        }
                                }