From f90f4c27ea323be106a007b57b5e8544e059523b Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 13 May 2014 20:48:46 +0000 Subject: [PATCH] support for enable/disable and capitalization in ios git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76525 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/iphone/textctrl.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/osx/iphone/textctrl.mm b/src/osx/iphone/textctrl.mm index 8fa70b90ad..b4e9a8fb0f 100644 --- a/src/osx/iphone/textctrl.mm +++ b/src/osx/iphone/textctrl.mm @@ -601,6 +601,13 @@ bool wxUITextFieldControl::CanPaste() const void wxUITextFieldControl::SetEditable(bool editable) { + if (m_textField) { + if ( !editable ) { + [m_textField resignFirstResponder]; + } + + [m_textField setEnabled: editable]; + } } void wxUITextFieldControl::GetSelection( long* from, long* to) const @@ -733,6 +740,11 @@ wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer, if ( style & wxTE_PASSWORD ) [tv setSecureTextEntry:YES]; + if ( style & wxTE_CAPITALIZE ) + [tv setAutocapitalizationType:UITextAutocapitalizationTypeWords]; + else + [tv setAutocapitalizationType:UITextAutocapitalizationTypeSentences]; + if ( !(style & wxTE_MULTILINE) ) { [tv setAutocorrectionType:UITextAutocorrectionTypeNo];