routing the tab, return events for single line fields back to standard wx handler (doesn't work for secure fields unfortunately), fixes #12386 and partly #12392

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66048 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2010-11-06 15:48:48 +00:00
parent 3f30bd1a8d
commit 76b1a2c26e

View File

@@ -253,6 +253,42 @@ protected :
impl->controlTextDidChange();
}
- (BOOL)control:(NSControl*)control textView:(NSTextView*)textView doCommandBySelector:(SEL)commandSelector
{
wxUnusedVar(textView);
wxUnusedVar(control);
BOOL handled = NO;
// send back key events wx' common code knows how to handle
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if ( impl )
{
wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
if ( wxpeer )
{
if (commandSelector == @selector(insertNewline:))
{
[textView insertNewlineIgnoringFieldEditor:self];
handled = YES;
}
else if ( commandSelector == @selector(insertTab:))
{
[textView insertTabIgnoringFieldEditor:self];
handled = YES;
}
else if ( commandSelector == @selector(insertBacktab:))
{
[textView insertTabIgnoringFieldEditor:self];
handled = YES;
}
}
}
return handled;
}
- (void)controlTextDidEndEditing:(NSNotification *)aNotification
{
wxUnusedVar(aNotification);