]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/window.cpp
RTTI and exceptions settings for WinCE are restored.
[wxWidgets.git] / src / mac / carbon / window.cpp
index bfdbeb7ef6708730544d7d00201f336bbce508df..b43b781adad964eca014bb1cbddfa06310d349cc 100644 (file)
@@ -343,9 +343,15 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl
                         thisWindow->GetCaret()->OnKillFocus();
                     }
         #endif // wxUSE_CARET
-                    wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId());
-                    event.SetEventObject(thisWindow);
-                    thisWindow->GetEventHandler()->ProcessEvent(event) ;
+                    static bool inKillFocusEvent = false ;
+                    if ( !inKillFocusEvent )
+                    {
+                        inKillFocusEvent = true ;
+                        wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId());
+                        event.SetEventObject(thisWindow);
+                        thisWindow->GetEventHandler()->ProcessEvent(event) ;
+                        inKillFocusEvent = false ;
+                    }
                 }
                 else
                 {
@@ -628,35 +634,6 @@ wxMAC_DEFINE_PROC_GETTER( ControlActionUPP , wxMacLiveScrollbarActionProc ) ;
 // implementation
 // ===========================================================================
 
-#if KEY_wxList_DEPRECATED
-wxList wxWinMacControlList(wxKEY_INTEGER);
-
-wxWindow *wxFindControlFromMacControl(ControlRef inControl )
-{
-    wxNode *node = wxWinMacControlList.Find((long)inControl);
-    if (!node)
-        return NULL;
-    return (wxControl *)node->GetData();
-}
-
-void wxAssociateControlWithMacControl(ControlRef inControl, wxWindow *control)
-{
-    // adding NULL ControlRef is (first) surely a result of an error and
-    // (secondly) breaks native event processing
-    wxCHECK_RET( inControl != (ControlRef) NULL, wxT("attempt to add a NULL WindowRef to window list") );
-
-    if ( !wxWinMacControlList.Find((long)inControl) )
-        wxWinMacControlList.Append((long)inControl, control);
-}
-
-void wxRemoveMacControlAssociation(wxWindow *control)
-{
-    // remove all associations pointing to us
-    while ( wxWinMacControlList.DeleteObject(control) )
-        {}
-}
-#else
-
 WX_DECLARE_HASH_MAP(ControlRef, wxWindow*, wxPointerHash, wxPointerEqual, MacControlMap);
 
 static MacControlMap wxWinMacControlList;
@@ -699,7 +676,6 @@ void wxRemoveMacControlAssociation(wxWindow *control)
         }
     }
 }
-#endif // deprecated wxList
 
 // ----------------------------------------------------------------------------
  // constructors and such
@@ -787,6 +763,7 @@ wxWindowMac::~wxWindowMac()
     {
         // in case the callback might be called during destruction
         wxRemoveMacControlAssociation( this) ;
+        ::RemoveEventHandler( (EventHandlerRef ) m_macControlEventHandler ) ;
         // we currently are not using this hook
         // ::SetControlColorProc( *m_peer , NULL ) ;
         m_peer->Dispose() ;