]> git.saurik.com Git - wxWidgets.git/commitdiff
supporting kill focus for single line text controls
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 25 Mar 2009 10:26:28 +0000 (10:26 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 25 Mar 2009 10:26:28 +0000 (10:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59836 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/textctrl.mm

index 8ad2937d9771ee41ee3b8403a6ca9ba63ea2b47b..e4f99f7040d95407016f43a8d1f397214edc9881 100644 (file)
     }
 }
 
+- (void)controlTextDidEndEditing:(NSNotification *)aNotification
+{
+    wxUnusedVar(aNotification);
+    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
+    if ( impl )
+    {
+        impl->DoNotifyFocusEvent( false, NULL );
+    }
+}
+
 @end
 
 @interface wxNSTextView : NSScrollView
@@ -209,21 +219,16 @@ typedef BOOL (*wxOSX_insertNewlineHandlerPtr)(NSView* self, SEL _cmd, NSControl
     
     return NO;
 }
-/*
+
 - (void)controlTextDidEndEditing:(NSNotification *)aNotification
 {
+    wxUnusedVar(aNotification);
+    wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
     if ( impl )
     {
-        wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
-        if ( wxpeer ) {
-            wxFocusEvent event(wxEVT_KILL_FOCUS, wxpeer->GetId());
-            event.SetEventObject( wxpeer );
-            event.SetWindow( wxpeer );
-            wxpeer->HandleWindowEvent( event );
-        }
+        impl->DoNotifyFocusEvent( false, NULL );
     }
 }
-*/
 @end
 
 // wxNSTextViewControl