+#endif
+
+
+@implementation wxUITextFieldDelegate
+
+- (BOOL)textFieldShouldReturn:(UITextField *)textField
+{
+ // the user pressed the "Done" button, so dismiss the keyboard
+ wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( textField );
+ if ( impl )
+ {
+ wxWindow* wxpeer = (wxWindow*) impl->GetWXPeer();
+ if ( wxpeer && wxpeer->GetWindowStyle() & wxTE_PROCESS_ENTER )
+ {
+ wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, wxpeer->GetId());
+ event.SetEventObject( wxpeer );
+ event.SetString( static_cast<wxTextCtrl*>(wxpeer)->GetValue() );
+ wxpeer->HandleWindowEvent( event );
+ }
+ }
+
+ [textField resignFirstResponder];
+ return YES;
+}
+
+/*
+- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField; // return NO to disallow editing.
+- (void)textFieldDidBeginEditing:(UITextField *)textField; // became first responder
+- (BOOL)textFieldShouldEndEditing:(UITextField *)textField; // return YES to allow editing to stop and to resign first responder status. NO to disallow the editing session to end
+- (void)textFieldDidEndEditing:(UITextField *)textField; // may be called if forced even if shouldEndEditing returns NO (e.g. view removed from window) or endEditing:YES called
+
+- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string; // return NO to not change text
+
+- (BOOL)textFieldShouldClear:(UITextField *)textField; // called when clear button pressed. return NO to ignore (no notifications)
+*/
+
+@end
+
+