Files
Upsilon/apps/sequence/graph/curve_parameter_controller.cpp
Émilie Feral 0517066cc0 [escher] Extrude scroll view model to its delegate
Change-Id: If863de63f5f77edb5e2905633067e03aecdd8937
2017-05-03 10:22:01 +02:00

60 lines
1.6 KiB
C++

#include "curve_parameter_controller.h"
#include "graph_controller.h"
#include <assert.h>
using namespace Shared;
namespace Sequence {
CurveParameterController::CurveParameterController(GraphController * graphController, InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor) :
FunctionCurveParameterController(graphRange, cursor),
m_goToParameterController(GoToParameterController(this, graphRange, cursor, I18n::Message::N)),
m_sumCell(MessageTableCell(I18n::Message::TermSum)),
m_graphController(graphController)
{
}
const char * CurveParameterController::title() {
return I18n::translate(I18n::Message::SequenceOptions);
}
bool CurveParameterController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::OK) {
switch (selectedRow()) {
case 0:
{
StackViewController * stack = (StackViewController *)parentResponder();
stack->pop();
stack->push(m_graphController->termSumController());
return true;
}
case 1:
return handleGotoSelection();
default:
return false;
}
}
return false;
}
int CurveParameterController::numberOfRows() {
return k_totalNumberOfCells;
};
HighlightCell * CurveParameterController::reusableCell(int index) {
assert(index >= 0);
assert(index < k_totalNumberOfCells);
HighlightCell * cells[] = {&m_sumCell, &m_goToCell};
return cells[index];
}
int CurveParameterController::reusableCellCount() {
return k_totalNumberOfCells;
}
GoToParameterController * CurveParameterController::goToParameterController() {
return &m_goToParameterController;
}
}