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:
@@ -253,6 +253,42 @@ protected :
|
|||||||
impl->controlTextDidChange();
|
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
|
- (void)controlTextDidEndEditing:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
wxUnusedVar(aNotification);
|
wxUnusedVar(aNotification);
|
||||||
|
Reference in New Issue
Block a user