[escher] Add methods viewWillAppear/Disappear in view controller instead

of keeping track of dataHasChanged in the selectable table view

Change-Id: Id2626f527f44714e29b9bd66e2c843193e1b57b5
This commit is contained in:
Émilie Feral
2017-02-13 16:31:05 +01:00
parent 761be1c8c7
commit 6f138e6b1c
45 changed files with 176 additions and 56 deletions

View File

@@ -78,14 +78,16 @@ void EditableCellTableViewController::willDisplayCellAtLocationWithDisplayMode(T
if (j == numberOfRows() - 1) {
/* Display an empty line only if there is enough space for a new element in
* data */
if (numberOfElements() < maxNumberOfElements()) {
if (numberOfElements() < maxNumberOfElements() && !myEditableValueCell->isEditing()) {
buffer[0] = 0;
myEditableValueCell->setText(buffer);
return;
}
}
Complex::convertFloatToText(dataAtLocation(i, j), buffer, Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, displayMode);
myEditableValueCell->setText(buffer);
if (!myEditableValueCell->isEditing()) {
Complex::convertFloatToText(dataAtLocation(i, j), buffer, Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, displayMode);
myEditableValueCell->setText(buffer);
}
return;
}
}
@@ -103,4 +105,9 @@ void EditableCellTableViewController::didBecomeFirstResponder() {
app()->setFirstResponder(&m_selectableTableView);
}
void EditableCellTableViewController::viewWillAppear() {
m_selectableTableView.reloadData();
}
}