]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/app.cpp
Fix building wxSTC as a DLL using MinGW GCC 3.x.
[wxWidgets.git] / src / mac / carbon / app.cpp
index 58ee11d265470c94254c42014ddf0bae5c68a0e2..63898fed72d4d8c70b2070be27daffaa88769e7a 100644 (file)
@@ -73,7 +73,6 @@ extern wxList *wxWinMacControlList;
 // statics for implementation
 
 static bool s_inYield = FALSE;
-static bool s_inOnIdle = FALSE;
 
 #if TARGET_CARBON
 static bool s_inReceiveEvent = FALSE ;
@@ -970,14 +969,11 @@ pascal OSStatus wxMacApplicationEventHandler( EventHandlerCallRef handler , Even
 
 wxApp::wxApp()
 {
-  m_topWindow = NULL;
-  wxTheApp = this;
-
-  argc = 0;
-  argv = NULL;
-
   m_printMode = wxPRINT_WINDOWS;
   m_auto3D = TRUE;
+
+  m_macCurrentEvent = NULL ;
+  m_macCurrentEventHandlerCallRef = NULL ;
 }
 
 bool wxApp::Initialized()
@@ -1364,6 +1360,12 @@ 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 )
+        {
+            event.m_keyCode = WXK_COMMAND ;
+            event.SetEventType( ( ev->modifiers & cmdKey ) ? wxEVT_KEY_DOWN : wxEVT_KEY_UP ) ;
+            focus->GetEventHandler()->ProcessEvent( event ) ;
+        }
         s_lastModifiers = ev->modifiers ;
     }
 }
@@ -1698,6 +1700,8 @@ void wxApp::MacHandleKeyDownEvent( WXEVENTREF evr )
 
         if ( MacSendKeyDownEvent( focus , ev->message , ev->modifiers , ev->when , ev->where.h , ev->where.v ) == false )
         {
+#if 0
+            // we must handle control keys the other way round, otherwise text content is updated too late
             // has not been handled -> perform default
             wxControl* control = wxDynamicCast( focus , wxControl ) ;
             if ( control &&  control->GetMacControl() != NULL )
@@ -1708,6 +1712,7 @@ void wxApp::MacHandleKeyDownEvent( WXEVENTREF evr )
                 keycode = short(ev->message & keyCodeMask) >> 8 ;
                 ::HandleControlKey( (ControlHandle) control->GetMacControl() , keycode , keychar , ev->modifiers ) ;
             }
+#endif
         }
     }
 }