[escher] When using input view controller, init the text content to the

previous text edited

Change-Id: Id201196f38e8f2b6cd909c7e52708f2e84ab8a47
This commit is contained in:
Émilie Feral
2016-12-29 12:10:20 +01:00
parent 30d9a1e227
commit bc38d3db4b
3 changed files with 13 additions and 3 deletions

View File

@@ -38,10 +38,14 @@ const char * InputViewController::textBody() {
return m_textFieldController.textField()->text();
}
void InputViewController::edit(Responder * caller, Ion::Events::Event event, void * context, Invocation::Action successAction, Invocation::Action failureAction) {
void InputViewController::edit(Responder * caller, Ion::Events::Event event, void * context, const char * initialText, Invocation::Action successAction, Invocation::Action failureAction) {
m_successAction = Invocation(successAction, context);
m_failureAction = Invocation(failureAction, context);
m_textFieldController.textField()->handleEvent(event);
if (initialText != nullptr) {
m_textFieldController.textField()->insertTextAtLocation(initialText, 0);
m_textFieldController.textField()->setCursorLocation(strlen(initialText));
}
displayModalViewController(&m_textFieldController, 1.0f, 1.0f);
}