]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/classic/app.cpp
Hopefully fixed library names generated by wx-config for OS/2's PM port.
[wxWidgets.git] / src / mac / classic / app.cpp
index 1623ec6defea138624ab63910a73f3fda132a067..38d66723aa602598c0197659501cc482dd18d19d 100644 (file)
@@ -389,7 +389,7 @@ MenuEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
 
 // 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
 
 // 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
+// to deal with clicks in the menu bar explicitly
 
 pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) ;
 
 
 pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) ;
 
@@ -1479,7 +1479,7 @@ void wxApp::MacHandleModifierEvents( WXEVENTREF evr )
 
         event.m_x = ev->where.h;
         event.m_y = ev->where.v;
 
         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);
 
         wxWindow* focus = wxWindow::FindFocus() ;
         event.SetEventObject(focus);
 
@@ -1853,21 +1853,12 @@ 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
 {
-#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
-   return !!(GetCurrentKeyModifiers() & wxKeyCodeToMacModifier(key)); 
-#else
-       KeyMap keymap; 
-       GetKeys(keymap);
-       return !!(BitTst(keymap, (sizeof(KeyMap)*8) - key));
-#endif
+    wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key !=
+        WXK_MBUTTON, wxT("can't use wxGetKeyState() for mouse buttons"));
+
+    KeyMap keymap; 
+    GetKeys(keymap);
+    return !!(BitTst(keymap, (sizeof(KeyMap)*8) - key));
 }
 
 #if !TARGET_CARBON
 }
 
 #if !TARGET_CARBON
@@ -1960,7 +1951,7 @@ bool wxApp::MacSendKeyDownEvent( wxWindow* focus , long keymessage , long modifi
 
     event.m_x = wherex;
     event.m_y = wherey;
 
     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() )
     event.SetEventObject(focus);
     handled = focus->GetEventHandler()->ProcessEvent( event ) ;
     if ( handled && event.GetSkipped() )
@@ -2087,7 +2078,7 @@ bool wxApp::MacSendKeyUpEvent( wxWindow* focus , long keymessage , long modifier
 
     event.m_x = wherex;
     event.m_y = wherey;
 
     event.m_x = wherex;
     event.m_y = wherey;
-    event.m_timeStamp = when;
+    event.SetTimestamp(when);
     event.SetEventObject(focus);
     handled = focus->GetEventHandler()->ProcessEvent( event ) ;
 
     event.SetEventObject(focus);
     handled = focus->GetEventHandler()->ProcessEvent( event ) ;
 
@@ -2226,7 +2217,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_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 )
                     event.SetEventObject(this);
 
                     if ( wxWindow::s_lastMouseWindow )
@@ -2329,7 +2320,7 @@ void wxApp::MacHandleMouseMovedEvent(wxInt32 x , wxInt32 y ,wxUint32 modifiers ,
 
         event.m_x = x;
         event.m_y = y;
 
         event.m_x = x;
         event.m_y = y;
-        event.m_timeStamp = timestamp;
+        event.SetTimestamp(timestamp);
 
         if ( wxWindow::s_lastMouseWindow )
         {
 
         if ( wxWindow::s_lastMouseWindow )
         {