Files
Upsilon/apps/shared/function_curve_parameter_controller.cpp
Émilie Feral 406fc0e0a5 [escher] Enable to draw the outline of cells in table view
Change-Id: I2842e9fdada4ebdc3fe49608e6f7886d831aa98b
2017-03-16 15:12: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, 1, 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;
}
}