[apps/stats] Fill with formula in statistics

This commit is contained in:
Léa Saviot
2018-06-01 10:30:54 +02:00
parent 5f3ea724f4
commit 5da90b5160
7 changed files with 61 additions and 22 deletions

View File

@@ -64,7 +64,14 @@ void StoreController::displayFormulaInput() {
bool StoreController::textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) {
if (textField == contentView()->formulaInputView()->textField()) {
// Handle formula input
Expression * expression = Expression::parse(textField->text());
if (expression == nullptr) {
app()->displayWarning(I18n::Message::SyntaxError);
return false;
}
contentView()->displayFormulaInput(false);
fillColumnWithFormula(expression);
delete expression;
app()->setFirstResponder(contentView());
return true;
}