]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/classic/app.cpp
regenerated with correct substitutions for COND_WXUNIV_0 (fixes wxAdv build problems)
[wxWidgets.git] / src / mac / classic / app.cpp
index 613c323b92f3c4d9bf2533d9915348f8f2f6a61a..610f33f0b42b5b211d18802214da47f77f255830 100644 (file)
@@ -387,7 +387,7 @@ MenuEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
     return eventNotHandledErr;
 }
 
     return eventNotHandledErr;
 }
 
-// due to the rather low-level event API of wxWindows, we cannot use RunApplicationEventLoop
+// due to the rather low-level event API of wxWidgets, we cannot use RunApplicationEventLoop
 // but have to use ReceiveNextEvent dealing with events manually, therefore we also have
 // deal with clicks in the menu bar explicitely
 
 // but have to use ReceiveNextEvent dealing with events manually, therefore we also have
 // deal with clicks in the menu bar explicitely
 
@@ -841,15 +841,15 @@ void wxStAppResource::OpenSharedLibraryResource(const void *initBlock)
         NSModule    theModule;
         const char *theLibPath;
 
         NSModule    theModule;
         const char *theLibPath;
 
-        gSharedLibraryBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.wxwindows.wxWindows"));
+        gSharedLibraryBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.wxwindows.wxWidgets"));
         if (gSharedLibraryBundle != NULL) {
         if (gSharedLibraryBundle != NULL) {
-            // wxWindows has been bundled into a framework
+            // wxWidgets has been bundled into a framework
             //   load the framework resources
 
             gSharedLibraryResource = CFBundleOpenBundleResourceMap(gSharedLibraryBundle);
         }
         else {
             //   load the framework resources
 
             gSharedLibraryResource = CFBundleOpenBundleResourceMap(gSharedLibraryBundle);
         }
         else {
-            // wxWindows is a simple dynamic shared library
+            // wxWidgets is a simple dynamic shared library
             //   load the resources from the data fork of a separate resource file
             wxString theResPath;
             wxString theName;
             //   load the resources from the data fork of a separate resource file
             wxString theResPath;
             wxString theName;
@@ -1533,7 +1533,7 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr )
         ::GetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
 
     short windowPart = ::FindWindow(ev->where, &window);
         ::GetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
 
     short windowPart = ::FindWindow(ev->where, &window);
-    wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
+    wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ;
     if ( wxPendingDelete.Member(win) )
         return ;
 
     if ( wxPendingDelete.Member(win) )
         return ;
 
@@ -1707,7 +1707,7 @@ void wxApp::MacHandleMouseUpEvent( WXEVENTREF evr )
             break ;
         default:
             {
             break ;
         default:
             {
-                wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
+                wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ;
                 if ( win )
                     win->MacMouseUp( ev , windowPart ) ;
             }
                 if ( win )
                     win->MacMouseUp( ev , windowPart ) ;
             }
@@ -1853,20 +1853,14 @@ int wxKeyCodeToMacModifier(wxKeyCode key)
 
 bool wxGetKeyState(wxKeyCode key) //virtual key code if < 10.2.x, else see below
 {
 
 bool wxGetKeyState(wxKeyCode key) //virtual key code if < 10.2.x, else see below
 {
-//#ifdef __DARWIN__
-//     wxHIDKeyboard keyboard;
-//     return keyboard.IsActive(key);
-//#else
-// TODO:  Have it use HID Manager on OSX...
-//if OS X > 10.2 (i.e. 10.2.x)
-//a known apple bug prevents the system from determining led
-//states with GetKeys... can only determine caps lock led
+#if __WXMAC_CARBON__
+//TODO: Low get map...
    return !!(GetCurrentKeyModifiers() & wxKeyCodeToMacModifier(key)); 
    return !!(GetCurrentKeyModifiers() & wxKeyCodeToMacModifier(key)); 
-//else
-//  KeyMapByteArray keymap; 
-//  GetKeys((BigEndianLong*)keymap);
-//  return !!(BitTst(keymap, (sizeof(KeyMapByteArray)*8) - iKey));
-//#endif
+#else
+       KeyMap keymap; 
+       GetKeys(keymap);
+       return !!(BitTst(keymap, (sizeof(KeyMap)*8) - key));
+#endif
 }
 
 #if !TARGET_CARBON
 }
 
 #if !TARGET_CARBON
@@ -2024,7 +2018,7 @@ bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifi
     {
           // if window is not having a focus still testing for default enter or cancel
           // TODO add the UMA version for ActiveNonFloatingWindow
     {
           // if window is not having a focus still testing for default enter or cancel
           // TODO add the UMA version for ActiveNonFloatingWindow
-          wxWindow* focus = wxFindWinFromMacWindow( FrontWindow() ) ;
+          wxWindow* focus = wxFindWinFromMacWindow( (WXWindow) FrontWindow() ) ;
           if ( focus )
           {
             if ( keyval == WXK_RETURN )
           if ( focus )
           {
             if ( keyval == WXK_RETURN )
@@ -2108,7 +2102,7 @@ void wxApp::MacHandleActivateEvent( WXEVENTREF evr )
             // if it is a floater we activate/deactivate the front non-floating window instead
             window = ::FrontNonFloatingWindow() ;
         }
             // if it is a floater we activate/deactivate the front non-floating window instead
             window = ::FrontNonFloatingWindow() ;
         }
-        wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
+        wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ;
         if ( win )
             win->MacActivate( ev->when , activate ) ;
     }
         if ( win )
             win->MacActivate( ev->when , activate ) ;
     }
@@ -2118,7 +2112,7 @@ void wxApp::MacHandleUpdateEvent( WXEVENTREF evr )
 {
     EventRecord* ev = (EventRecord*) evr ;
     WindowRef window = (WindowRef) ev->message ;
 {
     EventRecord* ev = (EventRecord*) evr ;
     WindowRef window = (WindowRef) ev->message ;
-    wxTopLevelWindowMac * win = wxFindWinFromMacWindow( window ) ;
+    wxTopLevelWindowMac * win = wxFindWinFromMacWindow( (WXWindow) window ) ;
     if ( win )
     {
         if ( !wxPendingDelete.Member(win) )
     if ( win )
     {
         if ( !wxPendingDelete.Member(win) )
@@ -2176,13 +2170,13 @@ void wxApp::MacHandleOSEvent( WXEVENTREF evr )
 
                     if ( oldFrontWindow )
                     {
 
                     if ( oldFrontWindow )
                     {
-                        wxTopLevelWindowMac* win = wxFindWinFromMacWindow( oldFrontWindow ) ;
+                        wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) oldFrontWindow ) ;
                         if ( win )
                             win->MacActivate( ev->when , false ) ;
                     }
                     if ( newFrontWindow )
                     {
                         if ( win )
                             win->MacActivate( ev->when , false ) ;
                     }
                     if ( newFrontWindow )
                     {
-                        wxTopLevelWindowMac* win = wxFindWinFromMacWindow( newFrontWindow ) ;
+                        wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) newFrontWindow ) ;
                         if ( win )
                             win->MacActivate( ev->when , true ) ;
                     }
                         if ( win )
                             win->MacActivate( ev->when , true ) ;
                     }
@@ -2264,7 +2258,7 @@ void wxApp::MacHandleOSEvent( WXEVENTREF evr )
                 {
                     case inContent :
                         {
                 {
                     case inContent :
                         {
-                            wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
+                            wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ;
                             if ( win )
                                 win->MacMouseMoved( ev , windowPart ) ;
                             else
                             if ( win )
                                 win->MacMouseMoved( ev , windowPart ) ;
                             else