mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
59 lines
1.5 KiB
C++
59 lines
1.5 KiB
C++
#include "goto_parameter_controller.h"
|
|
#include "../app.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)
|
|
{
|
|
m_abscisseCell.setParentResponder(&m_selectableTableView);
|
|
m_abscisseCell.setDelegate(this);
|
|
}
|
|
|
|
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->goToAbscissaOnFunction(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;
|
|
}
|
|
|
|
bool GoToParameterController::textFieldDidReceiveEvent(TextField * textField, Ion::Events::Event event) {
|
|
App * myApp = (App *)app();
|
|
return myApp->textFieldDidReceiveEvent(textField, event);
|
|
}
|
|
|
|
}
|