]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/classic/app.cpp
use popen() instead of wxExecute(), it works inside wxYield() unlike the latter
[wxWidgets.git] / src / mac / classic / app.cpp
index 85c556b21dd1f930207ad68f76f76f374bd3af60..c2aaf86cd00aa46a4322579e189a7cb88e2e1ded 100644 (file)
@@ -1479,7 +1479,7 @@ void wxApp::MacHandleModifierEvents( WXEVENTREF evr )
 
         event.m_x = ev->where.h;
         event.m_y = ev->where.v;
-        event.m_timeStamp = ev->when;
+        event.SetTimestamp( ev->when );
         wxWindow* focus = wxWindow::FindFocus() ;
         event.SetEventObject(focus);
 
@@ -1533,7 +1533,7 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr )
         ::GetWindowAttributes( frontWindow , &frontWindowAttributes ) ;
 
     short windowPart = ::FindWindow(ev->where, &window);
-    wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
+    wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ;
     if ( wxPendingDelete.Member(win) )
         return ;
 
@@ -1707,7 +1707,7 @@ void wxApp::MacHandleMouseUpEvent( WXEVENTREF evr )
             break ;
         default:
             {
-                wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
+                wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ;
                 if ( win )
                     win->MacMouseUp( ev , windowPart ) ;
             }
@@ -1853,15 +1853,11 @@ int wxKeyCodeToMacModifier(wxKeyCode key)
 
 bool wxGetKeyState(wxKeyCode key) //virtual key code if < 10.2.x, else see below
 {
+    wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key !=
+        WXK_MBUTTON, wxT("can't use wxGetKeyState() for mouse buttons"));
+
 #if __WXMAC_CARBON__
-//#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
+//TODO: Low get map...
    return !!(GetCurrentKeyModifiers() & wxKeyCodeToMacModifier(key)); 
 #else
        KeyMap keymap; 
@@ -1960,7 +1956,7 @@ bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifi
 
     event.m_x = wherex;
     event.m_y = wherey;
-    event.m_timeStamp = when;
+    event.SetTimestamp(when);
     event.SetEventObject(focus);
     handled = focus->GetEventHandler()->ProcessEvent( event ) ;
     if ( handled && event.GetSkipped() )
@@ -2025,7 +2021,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
-          wxWindow* focus = wxFindWinFromMacWindow( FrontWindow() ) ;
+          wxWindow* focus = wxFindWinFromMacWindow( (WXWindow) FrontWindow() ) ;
           if ( focus )
           {
             if ( keyval == WXK_RETURN )
@@ -2087,7 +2083,7 @@ bool wxApp::MacSendKeyUpEvent( wxWindow* focus , long keymessage , long modifier
 
     event.m_x = wherex;
     event.m_y = wherey;
-    event.m_timeStamp = when;
+    event.SetTimestamp(when);
     event.SetEventObject(focus);
     handled = focus->GetEventHandler()->ProcessEvent( event ) ;
 
@@ -2109,7 +2105,7 @@ void wxApp::MacHandleActivateEvent( WXEVENTREF evr )
             // 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 ) ;
     }
@@ -2119,7 +2115,7 @@ void wxApp::MacHandleUpdateEvent( WXEVENTREF evr )
 {
     EventRecord* ev = (EventRecord*) evr ;
     WindowRef window = (WindowRef) ev->message ;
-    wxTopLevelWindowMac * win = wxFindWinFromMacWindow( window ) ;
+    wxTopLevelWindowMac * win = wxFindWinFromMacWindow( (WXWindow) window ) ;
     if ( win )
     {
         if ( !wxPendingDelete.Member(win) )
@@ -2177,13 +2173,13 @@ void wxApp::MacHandleOSEvent( WXEVENTREF evr )
 
                     if ( oldFrontWindow )
                     {
-                        wxTopLevelWindowMac* win = wxFindWinFromMacWindow( oldFrontWindow ) ;
+                        wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) oldFrontWindow ) ;
                         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 ) ;
                     }
@@ -2226,7 +2222,7 @@ void wxApp::MacHandleOSEvent( WXEVENTREF evr )
                     event.m_metaDown = ev->modifiers & cmdKey;
                     event.m_x = ev->where.h;
                     event.m_y = ev->where.v;
-                    event.m_timeStamp = ev->when;
+                    event.SetTimestamp( ev->when );
                     event.SetEventObject(this);
 
                     if ( wxWindow::s_lastMouseWindow )
@@ -2265,7 +2261,7 @@ void wxApp::MacHandleOSEvent( WXEVENTREF evr )
                 {
                     case inContent :
                         {
-                            wxTopLevelWindowMac* win = wxFindWinFromMacWindow( window ) ;
+                            wxTopLevelWindowMac* win = wxFindWinFromMacWindow( (WXWindow) window ) ;
                             if ( win )
                                 win->MacMouseMoved( ev , windowPart ) ;
                             else
@@ -2329,7 +2325,7 @@ void wxApp::MacHandleMouseMovedEvent(wxInt32 x , wxInt32 y ,wxUint32 modifiers ,
 
         event.m_x = x;
         event.m_y = y;
-        event.m_timeStamp = timestamp;
+        event.SetTimestamp(timestamp);
 
         if ( wxWindow::s_lastMouseWindow )
         {