[apps/*/go_to_parameter_controller] Use setParameterName

This commit is contained in:
Ruben Dashyan
2019-09-05 10:33:18 +02:00
parent b357060939
commit 8a2ceb0440
3 changed files with 2 additions and 14 deletions

View File

@@ -27,6 +27,7 @@ const char * PreimageParameterController::title() {
}
void PreimageParameterController::viewWillAppear() {
setParameterName(I18n::Message::Y);
m_preimageGraphController->setImage(m_cursor->y());
Shared::GoToParameterController::viewWillAppear();
}

View File

@@ -20,6 +20,7 @@ GoToParameterController::GoToParameterController(Responder * parentResponder, In
void GoToParameterController::setXPrediction(bool xPrediction) {
m_xPrediction = xPrediction;
setParameterName(xPrediction ? I18n::Message::X : I18n::Message::Y);
}
const char * GoToParameterController::title() {
@@ -78,17 +79,4 @@ bool GoToParameterController::setParameterAtIndex(int parameterIndex, double f)
return true;
}
void GoToParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
if (index == numberOfRows()-1) {
return;
}
MessageTableCellWithEditableText * myCell = (MessageTableCellWithEditableText *) cell;
if (m_xPrediction) {
myCell->setMessage(I18n::Message::X);
} else {
myCell->setMessage(I18n::Message::Y);
}
FloatParameterController::willDisplayCellForIndex(cell, index);
}
}

View File

@@ -14,7 +14,6 @@ public:
GoToParameterController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegate, Store * store, Shared::CurveViewCursor * cursor, GraphController * graphController);
void setXPrediction(bool xPrediction);
const char * title() override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
private:
double parameterAtIndex(int index) override;
bool setParameterAtIndex(int parameterIndex, double f) override;