Files
Upsilon/apps/shared/function_curve_parameter_controller.cpp
Émilie Feral 25ced2e158 [apps/sequence] Correct go to controller legend: "x"->"n"
Change-Id: I47615a5fb23274a54ff1eab7386a570738467e13
2017-03-07 15:03:11 +01:00

44 lines
1.4 KiB
C++

#include "function_curve_parameter_controller.h"
#include <assert.h>
namespace Shared {
FunctionCurveParameterController::FunctionCurveParameterController(InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor, const char * symbol) :
ViewController(nullptr),
m_goToCell(PointerTableCellWithChevron((char*)"Aller a")),
m_selectableTableView(SelectableTableView(this, this, Metric::CommonTopMargin, Metric::CommonRightMargin,
Metric::CommonBottomMargin, Metric::CommonLeftMargin)),
m_goToParameterController(GoToParameterController(this, graphRange, cursor, symbol)),
m_function(nullptr)
{
}
View * FunctionCurveParameterController::view() {
return &m_selectableTableView;
}
void FunctionCurveParameterController::didBecomeFirstResponder() {
m_selectableTableView.selectCellAtLocation(0, 0);
app()->setFirstResponder(&m_selectableTableView);
}
bool FunctionCurveParameterController::handleGotoSelection() {
if (m_function == nullptr) {
return false;
}
m_goToParameterController.setFunction(m_function);
StackViewController * stack = (StackViewController *)parentResponder();
stack->push(&m_goToParameterController);
return true;
}
KDCoordinate FunctionCurveParameterController::cellHeight() {
return Metric::ParameterCellHeight;
}
void FunctionCurveParameterController::setFunction(Function * function) {
m_function = function;
}
}