[apps/shared] Move partial classes from grpah/graph to shared to be used

by sequence

Change-Id: I0e18be96cfaa92b6a51836ae8aa072fa6cf0f1af
This commit is contained in:
Émilie Feral
2017-02-22 18:05:56 +01:00
parent a0b4cc3485
commit 0bd796310c
21 changed files with 464 additions and 337 deletions

View File

@@ -0,0 +1,43 @@
#include "function_curve_parameter_controller.h"
#include <assert.h>
namespace Shared {
FunctionCurveParameterController::FunctionCurveParameterController(InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor) :
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)),
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;
}
}