Files
Upsilon/apps/graph/graph/goto_parameter_controller.cpp
Émilie Feral f95e49929b [apps] Move float parameter controller from apps/graph to apps/ to be
used in apps/robability

Change-Id: I00ab38bd35d2b3ad77d9aee3072422b9bd36fe01
2016-12-08 15:21:52 +01:00

50 lines
1.2 KiB
C++

#include "goto_parameter_controller.h"
#include <assert.h>
namespace Graph {
GoToParameterController::GoToParameterController(Responder * parentResponder, GraphView * graphView) :
FloatParameterController(parentResponder),
m_abscisseCell(EditableTextMenuListCell((char*)"x")),
m_graphView(graphView),
m_function(nullptr)
{
}
ExpressionTextFieldDelegate * GoToParameterController::textFieldDelegate() {
ExpressionTextFieldDelegate * myApp = (ExpressionTextFieldDelegate *)app();
return myApp;
}
const char * GoToParameterController::title() const {
return "Aller a";
}
float GoToParameterController::parameterAtIndex(int index) {
assert(index == 0);
return m_graphView->xCursorPosition();
}
void GoToParameterController::setParameterAtIndex(int parameterIndex, float f) {
assert(parameterIndex == 0);
m_graphView->setXCursorPosition(f, m_function);
}
int GoToParameterController::numberOfRows() {
return 1;
};
TableViewCell * GoToParameterController::reusableCell(int index) {
assert(index == 0);
return &m_abscisseCell;
}
int GoToParameterController::reusableCellCount() {
return 1;
}
void GoToParameterController::setFunction(Function * function) {
m_function = function;
}
}