[apps/graph/values_controller] functionParameterController() returns the derivative controller

when a derivative function column is selected.
Remove configureDerivativeFunction and handleEvent.
This commit is contained in:
Ruben Dashyan
2019-08-29 11:02:51 +02:00
parent 5cdecc252f
commit 4a0746fd44
2 changed files with 5 additions and 16 deletions

View File

@@ -22,14 +22,6 @@ ValuesController::ValuesController(Responder * parentResponder, InputEventHandle
}
}
bool ValuesController::handleEvent(Ion::Events::Event event) {
if ((event == Ion::Events::OK || event == Ion::Events::EXE) && typeAtLocation(selectedColumn(), selectedRow()) == 1 && isDerivativeColumn(selectedColumn())) {
configureDerivativeFunction();
return true;
}
return Shared::ValuesController::handleEvent(event);
}
void ValuesController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
Shared::ValuesController::willDisplayCellAtLocation(cell, i, j);
// The cell is the abscissa title cell:
@@ -113,12 +105,6 @@ bool ValuesController::isDerivativeColumn(int i) {
return false;
}
void ValuesController::configureDerivativeFunction() {
m_derivativeParameterController.setRecord(recordAtColumn(selectedColumn()));
StackViewController * stack = stackController();
stack->push(&m_derivativeParameterController);
}
int ValuesController::maxNumberOfCells() {
return k_maxNumberOfCells;
}
@@ -138,6 +124,11 @@ EvenOddBufferTextCell * ValuesController::floatCells(int j) {
}
ViewController * ValuesController::functionParameterController() {
bool isDerivative = isDerivativeColumn(selectedColumn());
if (isDerivative) {
m_derivativeParameterController.setRecord(recordAtColumn(selectedColumn()));
return &m_derivativeParameterController;
}
m_functionParameterController.setRecord(recordAtColumn(selectedColumn()));
return &m_functionParameterController;
}