mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-21 14:50:44 +01:00
[apps] Graph: enable to specialize GraphController in different types
(Default, Tangent ...)
This commit is contained in:
committed by
EmilieNumworks
parent
6d7d957c8f
commit
0dec52a708
@@ -1,4 +1,5 @@
|
||||
#include "calculation_parameter_controller.h"
|
||||
#include "graph_controller.h"
|
||||
#include <assert.h>
|
||||
#include <cmath>
|
||||
|
||||
@@ -6,11 +7,12 @@ using namespace Shared;
|
||||
|
||||
namespace Graph {
|
||||
|
||||
CalculationParameterController::CalculationParameterController(Responder * parentResponder) :
|
||||
CalculationParameterController::CalculationParameterController(Responder * parentResponder, GraphController * graphController) :
|
||||
ViewController(parentResponder),
|
||||
m_selectableTableView(this, this, 0, 1, Metric::CommonTopMargin, Metric::CommonRightMargin,
|
||||
Metric::CommonBottomMargin, Metric::CommonLeftMargin, this),
|
||||
m_function(nullptr)
|
||||
m_function(nullptr),
|
||||
m_graphController(graphController)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -29,7 +31,19 @@ void CalculationParameterController::didBecomeFirstResponder() {
|
||||
|
||||
bool CalculationParameterController::handleEvent(Ion::Events::Event event) {
|
||||
if (event == Ion::Events::OK || event == Ion::Events::EXE) {
|
||||
return true;
|
||||
switch(selectedRow()) {
|
||||
case 4:
|
||||
{
|
||||
StackViewController * stack = (StackViewController *)parentResponder();
|
||||
stack->pop();
|
||||
stack->pop();
|
||||
m_graphController->setType(GraphController::Type::Tangent);
|
||||
stack->push(m_graphController);
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user