bool JniTextField::TextFieldKeyPressed(int32 replacementLocation, int32 replacementLength, const char* text) { DVASSERT(activeTextField); UITextFieldDelegate* delegate = activeTextField->GetDelegate(); if (!delegate) return true; WideString strText = StringToWString(text); return delegate->TextFieldKeyPressed(activeTextField, replacementLocation, replacementLength, strText); }
bool UITextFieldAndroid::TextFieldKeyPressed(int32 replacementLocation, int32 replacementLength, const WideString &text) { bool res = true; UITextFieldDelegate* delegate = textField->GetDelegate(); if (delegate) res = delegate->TextFieldKeyPressed(textField, replacementLocation, replacementLength, text); if (res) { WideString curText = textField->GetText(); if (curText.length() >= replacementLocation) { curText.replace(replacementLocation, replacementLength, text); this->text = curText; } } return res; }