mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-22 23:30:37 +01:00
[apps/shared] Move partial classes from grpah/graph to shared to be used
by sequence Change-Id: I0e18be96cfaa92b6a51836ae8aa072fa6cf0f1af
This commit is contained in:
65
apps/shared/initialisation_parameter_controller.cpp
Normal file
65
apps/shared/initialisation_parameter_controller.cpp
Normal file
@@ -0,0 +1,65 @@
|
||||
#include "initialisation_parameter_controller.h"
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
|
||||
namespace Shared {
|
||||
|
||||
InitialisationParameterController::InitialisationParameterController(Responder * parentResponder, InteractiveCurveViewRange * graphRange) :
|
||||
ViewController(parentResponder),
|
||||
m_selectableTableView(SelectableTableView(this, this, Metric::CommonTopMargin, Metric::CommonRightMargin,
|
||||
Metric::CommonBottomMargin, Metric::CommonLeftMargin)),
|
||||
m_graphRange(graphRange)
|
||||
{
|
||||
}
|
||||
|
||||
const char * InitialisationParameterController::title() const {
|
||||
return "Zoom predefini";
|
||||
}
|
||||
|
||||
View * InitialisationParameterController::view() {
|
||||
return &m_selectableTableView;
|
||||
}
|
||||
|
||||
void InitialisationParameterController::didBecomeFirstResponder() {
|
||||
m_selectableTableView.selectCellAtLocation(0, 0);
|
||||
app()->setFirstResponder(&m_selectableTableView);
|
||||
}
|
||||
|
||||
bool InitialisationParameterController::handleEvent(Ion::Events::Event event) {
|
||||
if (event == Ion::Events::OK) {
|
||||
RangeMethodPointer rangeMethods[k_totalNumberOfCells] = {&InteractiveCurveViewRange::setTrigonometric,
|
||||
&InteractiveCurveViewRange::roundAbscissa, &InteractiveCurveViewRange::normalize, &InteractiveCurveViewRange::setDefault};
|
||||
(m_graphRange->*rangeMethods[m_selectableTableView.selectedRow()])();
|
||||
StackViewController * stack = (StackViewController *)parentResponder();
|
||||
stack->pop();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int InitialisationParameterController::numberOfRows() {
|
||||
return k_totalNumberOfCells;
|
||||
};
|
||||
|
||||
|
||||
HighlightCell * InitialisationParameterController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCells);
|
||||
return &m_cells[index];
|
||||
}
|
||||
|
||||
int InitialisationParameterController::reusableCellCount() {
|
||||
return k_totalNumberOfCells;
|
||||
}
|
||||
|
||||
KDCoordinate InitialisationParameterController::cellHeight() {
|
||||
return Metric::ParameterCellHeight;
|
||||
}
|
||||
|
||||
void InitialisationParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
PointerTableCell * myCell = (PointerTableCell *)cell;
|
||||
const char * titles[4] = {"Trigonometrique", "Abscisses entieres", "Orthonorme", "Reglage de base"};
|
||||
myCell->setText(titles[index]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user