From ab65e832eaa4ee0c4d4f8d9e0407d02d6b867fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 31 Jan 2017 16:02:45 +0100 Subject: [PATCH] [apps/regression][apps/graph/graph] Jump to the graph view once setting a new abscissa/ ordinate in the go to page Change-Id: I1e27e39c04950d902158a6e89024931f2fc78e1e --- apps/graph/graph/goto_parameter_controller.cpp | 8 ++++++++ apps/graph/graph/goto_parameter_controller.h | 1 + apps/regression/go_to_parameter_controller.cpp | 7 +++++++ apps/regression/go_to_parameter_controller.h | 1 + 4 files changed, 17 insertions(+) diff --git a/apps/graph/graph/goto_parameter_controller.cpp b/apps/graph/graph/goto_parameter_controller.cpp index 92f6a2f6d..5aa927420 100644 --- a/apps/graph/graph/goto_parameter_controller.cpp +++ b/apps/graph/graph/goto_parameter_controller.cpp @@ -48,4 +48,12 @@ void GoToParameterController::setFunction(Function * function) { m_function = function; } +bool GoToParameterController::textFieldDidFinishEditing(TextField * textField, const char * text) { + FloatParameterController::textFieldDidFinishEditing(textField, text); + StackViewController * stack = (StackViewController *)parentResponder(); + stack->pop(); + stack->pop(); + return true; +} + } diff --git a/apps/graph/graph/goto_parameter_controller.h b/apps/graph/graph/goto_parameter_controller.h index 8a2b75a72..546155282 100644 --- a/apps/graph/graph/goto_parameter_controller.h +++ b/apps/graph/graph/goto_parameter_controller.h @@ -16,6 +16,7 @@ public: TableViewCell * reusableCell(int index) override; int reusableCellCount() override; void setFunction(Function * function); + bool textFieldDidFinishEditing(TextField * textField, const char * text) override; private: float parameterAtIndex(int index) override; void setParameterAtIndex(int parameterIndex, float f) override; diff --git a/apps/regression/go_to_parameter_controller.cpp b/apps/regression/go_to_parameter_controller.cpp index a4b367d75..87c2e8afd 100644 --- a/apps/regression/go_to_parameter_controller.cpp +++ b/apps/regression/go_to_parameter_controller.cpp @@ -69,5 +69,12 @@ void GoToParameterController::willDisplayCellForIndex(TableViewCell * cell, int FloatParameterController::willDisplayCellForIndex(cell, index); } +bool GoToParameterController::textFieldDidFinishEditing(TextField * textField, const char * text) { + FloatParameterController::textFieldDidFinishEditing(textField, text); + StackViewController * stack = (StackViewController *)parentResponder(); + stack->pop(); + stack->pop(); + return true; +} } diff --git a/apps/regression/go_to_parameter_controller.h b/apps/regression/go_to_parameter_controller.h index 8a34f9622..fbb3f7cb5 100644 --- a/apps/regression/go_to_parameter_controller.h +++ b/apps/regression/go_to_parameter_controller.h @@ -17,6 +17,7 @@ public: TableViewCell * reusableCell(int index) override; int reusableCellCount() override; void willDisplayCellForIndex(TableViewCell * cell, int index) override; + bool textFieldDidFinishEditing(TextField * textField, const char * text) override; private: float parameterAtIndex(int index) override; void setParameterAtIndex(int parameterIndex, float f) override;