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
{
// 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;
}
}
}
-#endif // deprecated wxList
// ----------------------------------------------------------------------------
// constructors and such
{
// 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() ;