[apps/calculation] Insert text rather than overwrite when selecting a

history cell

Change-Id: Ie2cbe92a14a64caa3d1b4eabce6dc6de4baaaa34
This commit is contained in:
Émilie Feral
2017-05-31 10:42:21 +02:00
parent 6e98c4aa02
commit d4f3fc6b5c
3 changed files with 8 additions and 6 deletions

View File

@@ -57,9 +57,11 @@ const char * EditExpressionController::textBody() {
return ((ContentView *)view())->textField()->text();
}
void EditExpressionController::setTextBody(const char * text) {
((ContentView *)view())->textField()->setEditing(true);
((ContentView *)view())->textField()->setText(text);
void EditExpressionController::insertTextBody(const char * text) {
TextField * tf = ((ContentView *)view())->textField();
tf->setEditing(true, false);
tf->insertTextAtLocation(text, tf->cursorLocation());
tf->setCursorLocation(tf->cursorLocation() + strlen(text));
}
bool EditExpressionController::handleEvent(Ion::Events::Event event) {