From c9fdafb04be2f2f7f44c1a2c5df84440538e17c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 17 Oct 2016 18:10:17 +0200 Subject: [PATCH] [apps/graph/values] Display the parameter page when selecting the abscissa title Change-Id: I12e13baa3f2274064748710d6c8c48b4cb663941 --- apps/graph/values/values_controller.cpp | 8 ++++++++ apps/graph/values/values_controller.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/apps/graph/values/values_controller.cpp b/apps/graph/values/values_controller.cpp index c93497379..73491ee15 100644 --- a/apps/graph/values/values_controller.cpp +++ b/apps/graph/values/values_controller.cpp @@ -12,6 +12,7 @@ ValuesController::ValuesController(Responder * parentResponder, FunctionStore * m_functionStore(functionStore), m_evaluateContext(evaluateContext), m_parameterController(ValuesParameterController(this, &m_interval)), + m_abscissaParameterController(AbscissaParameterController(this)), m_setIntervalButton(Button(this, "Regler l'intervalle",Invocation([](void * context, void * sender) { ValuesController * valuesController = (ValuesController *) context; StackViewController * stack = ((StackViewController *)valuesController->parentResponder()); @@ -183,6 +184,7 @@ bool ValuesController::handleEvent(Ion::Events::Event event) { case Ion::Events::Event::ENTER: if (m_activeCellX == 0) { if (m_activeCellY == 0) { + configureAbscissa(); return true; } editValue(false); @@ -201,6 +203,12 @@ bool ValuesController::handleEvent(Ion::Events::Event event) { } } + +void ValuesController::configureAbscissa() { + StackViewController * stack = ((StackViewController *)parentResponder()); + stack->push(&m_abscissaParameterController); +} + void ValuesController::editValue(bool overwrite, char initialDigit) { /* This code assumes that the active cell remains the one which is edited * until the invocation is performed. This could lead to concurrency issue in diff --git a/apps/graph/values/values_controller.h b/apps/graph/values/values_controller.h index ade439bd9..779346342 100644 --- a/apps/graph/values/values_controller.h +++ b/apps/graph/values/values_controller.h @@ -8,6 +8,7 @@ #include "value_cell.h" #include "title_cell.h" #include "interval.h" +#include "abscissa_parameter_controller.h" #include "values_parameter_controller.h" namespace Graph { @@ -22,6 +23,7 @@ public: Interval * interval(); ValueCell * abscisseCellAtRow(int rowIndex); void editValue(bool overwrite, char initialDigit = 0); + void configureAbscissa(); const char * title() const override; bool handleEvent(Ion::Events::Event event) override; @@ -67,6 +69,7 @@ private: EvaluateContext * m_evaluateContext; Interval m_interval; ValuesParameterController m_parameterController; + AbscissaParameterController m_abscissaParameterController; Button m_setIntervalButton; };