- MacControlMap::iterator node = wxWinMacControlList.find(inControl);
-
- return (node == wxWinMacControlList.end()) ? NULL : node->second;
-}
-
-void wxAssociateWindowWithWXWidget(WXWidget inControl, wxWindow *control)
-{
- // adding NULL ControlRef is (first) surely a result of an error and
- // (secondly) breaks native event processing
- wxCHECK_RET( inControl != (WXWidget) NULL, wxT("attempt to add a NULL WindowRef to window list") );
-
- wxWinMacControlList[inControl] = control;
-}
-
-void wxRemoveWXWidgetAssociation(wxWindow *control)
-{
- // iterate over all the elements in the class
- // is the iterator stable ? as we might have two associations pointing to the same wxWindow
- // we should go on...
-
- bool found = true ;
- while ( found )
- {
- found = false ;
- MacControlMap::iterator it;
- for ( it = wxWinMacControlList.begin(); it != wxWinMacControlList.end(); ++it )
- {
- if ( it->second == control )
- {
- wxWinMacControlList.erase(it);
- found = true ;
- break;
- }
- }
- }
+ ControlRef control = NULL ;
+ GetKeyboardFocus( GetUserFocusWindow() , &control ) ;
+ return control;