Files
Upsilon/apps/shared/function_curve_parameter_controller.cpp
Émilie Feral 4396b3f190 [apps/sequence|graph] Event on right on chevron cell behaves as OK
Change-Id: I3ca047233c5ce637a29ee759153337c0c01cd073
2017-06-09 10:38:52 +02:00

45 lines
1.2 KiB
C++

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