mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[apps/sequence] Create a class curve parameter controller
Change-Id: I3e940c1e3826ae7a72d757058f3f7095a7eea22e
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
app_objs += $(addprefix apps/sequence/,\
|
||||
app.o\
|
||||
graph/banner_view.o\
|
||||
graph/curve_parameter_controller.o\
|
||||
graph/curve_view_range.o\
|
||||
graph/graph_view.o\
|
||||
list/list_controller.o\
|
||||
|
||||
47
apps/sequence/graph/curve_parameter_controller.cpp
Normal file
47
apps/sequence/graph/curve_parameter_controller.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#include "curve_parameter_controller.h"
|
||||
#include <assert.h>
|
||||
|
||||
using namespace Shared;
|
||||
|
||||
namespace Sequence {
|
||||
|
||||
CurveParameterController::CurveParameterController(InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor) :
|
||||
FunctionCurveParameterController(graphRange, cursor),
|
||||
m_sumCell(PointerTableCell((char*)"Somme des termes"))
|
||||
{
|
||||
}
|
||||
|
||||
const char * CurveParameterController::title() const {
|
||||
return "Options de la suite";
|
||||
}
|
||||
|
||||
bool CurveParameterController::handleEvent(Ion::Events::Event event) {
|
||||
if (event == Ion::Events::OK) {
|
||||
switch (m_selectableTableView.selectedRow()) {
|
||||
case 0:
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
24
apps/sequence/graph/curve_parameter_controller.h
Normal file
24
apps/sequence/graph/curve_parameter_controller.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef SEQUENCE_CURVE_PARAMETER_CONTROLLER_H
|
||||
#define SEQUENCE_CURVE_PARAMETER_CONTROLLER_H
|
||||
|
||||
#include <escher.h>
|
||||
#include "../../shared/function_curve_parameter_controller.h"
|
||||
|
||||
namespace Sequence {
|
||||
|
||||
class CurveParameterController : public Shared::FunctionCurveParameterController {
|
||||
public:
|
||||
CurveParameterController(Shared::InteractiveCurveViewRange * graphRange, Shared::CurveViewCursor * cursor);
|
||||
const char * title() const override;
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
int numberOfRows() override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
private:
|
||||
constexpr static int k_totalNumberOfCells = 2;
|
||||
PointerTableCell m_sumCell;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user