impl->controlTextDidChange();
}
-typedef BOOL (*wxOSX_insertNewlineHandlerPtr)(NSView* self, SEL _cmd, NSControl *control, NSTextView* textView, SEL commandSelector);
-
- (BOOL)control:(NSControl*)control textView:(NSTextView*)textView doCommandBySelector:(SEL)commandSelector
{
wxUnusedVar(textView);
wxUnusedVar(control);
- if (commandSelector == @selector(insertNewline:))
+
+ BOOL handled = NO;
+
+ // send back key events wx' common code knows how to handle
+
+ wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
+ if ( impl )
{
- wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
- if ( impl )
+ wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
+ if ( wxpeer )
{
- wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
- if ( wxpeer && wxpeer->GetWindowStyle() & wxTE_PROCESS_ENTER )
+ if (commandSelector == @selector(insertNewline:))
+ {
+ [textView insertNewlineIgnoringFieldEditor:self];
+ handled = YES;
+ }
+ else if ( commandSelector == @selector(insertTab:))
+ {
+ [textView insertTabIgnoringFieldEditor:self];
+ handled = YES;
+ }
+ else if ( commandSelector == @selector(insertBacktab:))
{
- wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, wxpeer->GetId());
- event.SetEventObject( wxpeer );
- event.SetString( static_cast<wxTextCtrl*>(wxpeer)->GetValue() );
- wxpeer->HandleWindowEvent( event );
+ [textView insertTabIgnoringFieldEditor:self];
+ handled = YES;
}
}
}
-
- return NO;
+
+ return handled;
}
- (void)controlTextDidEndEditing:(NSNotification *)aNotification
}
}
+bool wxNSTextFieldControl::SetHint(const wxString& hint)
+{
+ wxCFStringRef hintstring(hint);
+ [[m_textField cell] setPlaceholderString:hintstring.AsNSString()];
+ return true;
+}
+
//
//
//