]> git.saurik.com Git - wxWidgets.git/commitdiff
classic fixes
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 13 Sep 2003 14:06:08 +0000 (14:06 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 13 Sep 2003 14:06:08 +0000 (14:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/app.cpp
src/mac/carbon/app.cpp
src/mac/carbon/textctrl.cpp
src/mac/textctrl.cpp

index 83f2f6028f102dc4cda4e297ac23a3040288bfa8..9b891f5fa448ea8a0396d3c47b7367fb2a7a12c2 100644 (file)
@@ -1008,7 +1008,9 @@ wxApp::wxApp()
   m_auto3D = TRUE;
 
   m_macCurrentEvent = NULL ;
+#if TARGET_CARBON
   m_macCurrentEventHandlerCallRef = NULL ;
+#endif
 }
 
 bool wxApp::Initialized()
@@ -1395,7 +1397,7 @@ void wxApp::MacHandleModifierEvents( WXEVENTREF evr )
             event.SetEventType( ( ev->modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
             focus->GetEventHandler()->ProcessEvent( event ) ;
         }
-        if ( ev->modifiers ^ s_lastModifiers ) & cmdKey )
+        if ( ev->modifiers ^ s_lastModifiers ) & cmdKey )
         {
             event.m_keyCode = WXK_COMMAND ;
             event.SetEventType( ( ev->modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
index 83f2f6028f102dc4cda4e297ac23a3040288bfa8..9b891f5fa448ea8a0396d3c47b7367fb2a7a12c2 100644 (file)
@@ -1008,7 +1008,9 @@ wxApp::wxApp()
   m_auto3D = TRUE;
 
   m_macCurrentEvent = NULL ;
+#if TARGET_CARBON
   m_macCurrentEventHandlerCallRef = NULL ;
+#endif
 }
 
 bool wxApp::Initialized()
@@ -1395,7 +1397,7 @@ void wxApp::MacHandleModifierEvents( WXEVENTREF evr )
             event.SetEventType( ( ev->modifiers & optionKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
             focus->GetEventHandler()->ProcessEvent( event ) ;
         }
-        if ( ev->modifiers ^ s_lastModifiers ) & cmdKey )
+        if ( ev->modifiers ^ s_lastModifiers ) & cmdKey )
         {
             event.m_keyCode = WXK_COMMAND ;
             event.SetEventType( ( ev->modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
index 19bee0ff660adc519f6fb926ec3e1a30aa1c5ccc..50daa9708f5015097acb48c4e05a28bc64ccb6d5 100644 (file)
@@ -1636,7 +1636,6 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
         if ( m_macUsesTXN && wxTheApp->MacGetCurrentEvent() != NULL && wxTheApp->MacGetCurrentEventHandlerCallRef() != NULL )
             CallNextEventHandler((EventHandlerCallRef)wxTheApp->MacGetCurrentEventHandlerCallRef() , (EventRef) wxTheApp->MacGetCurrentEvent() ) ;
         else 
-#endif
         {
             EventRecord rec ;
             if ( wxMacConvertEventToRecord(  (EventRef) wxTheApp->MacGetCurrentEvent() , &rec ) )
@@ -1650,6 +1649,15 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
                 ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ;
             }
         }
+#else
+        EventRecord *ev = (EventRecord*) wxTheApp->MacGetCurrentEvent() ;
+        short keycode ;
+        short keychar ;
+        keychar = short(ev->message & charCodeMask);
+        keycode = short(ev->message & keyCodeMask) >> 8 ;
+
+        ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ;
+#endif
     }
     if ( ( key >= 0x20 && key < WXK_START ) ||
          key == WXK_RETURN ||
index 19bee0ff660adc519f6fb926ec3e1a30aa1c5ccc..50daa9708f5015097acb48c4e05a28bc64ccb6d5 100644 (file)
@@ -1636,7 +1636,6 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
         if ( m_macUsesTXN && wxTheApp->MacGetCurrentEvent() != NULL && wxTheApp->MacGetCurrentEventHandlerCallRef() != NULL )
             CallNextEventHandler((EventHandlerCallRef)wxTheApp->MacGetCurrentEventHandlerCallRef() , (EventRef) wxTheApp->MacGetCurrentEvent() ) ;
         else 
-#endif
         {
             EventRecord rec ;
             if ( wxMacConvertEventToRecord(  (EventRef) wxTheApp->MacGetCurrentEvent() , &rec ) )
@@ -1650,6 +1649,15 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
                 ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ;
             }
         }
+#else
+        EventRecord *ev = (EventRecord*) wxTheApp->MacGetCurrentEvent() ;
+        short keycode ;
+        short keychar ;
+        keychar = short(ev->message & charCodeMask);
+        keycode = short(ev->message & keyCodeMask) >> 8 ;
+
+        ::HandleControlKey( (ControlHandle) m_macControl , keycode , keychar , ev->modifiers ) ;
+#endif
     }
     if ( ( key >= 0x20 && key < WXK_START ) ||
          key == WXK_RETURN ||