diff --git a/apps/graph/Makefile b/apps/graph/Makefile index 2f25d3886..6926bbb8a 100644 --- a/apps/graph/Makefile +++ b/apps/graph/Makefile @@ -7,4 +7,5 @@ app_objs += $(addprefix apps/graph/,\ graph/graph_view.o\ list/function_cell.o\ list/list_controller.o\ + list/parameter_controller.o\ ) diff --git a/apps/graph/list/list_controller.cpp b/apps/graph/list/list_controller.cpp index 3b6498590..0b03d1a7f 100644 --- a/apps/graph/list/list_controller.cpp +++ b/apps/graph/list/list_controller.cpp @@ -4,13 +4,15 @@ ListController::ListController(Responder * parentResponder, Graph::FunctionStore * functionStore) : ViewController(parentResponder), m_tableView(TableView(this)), - m_activeCell(0), + m_activeCell(-1), m_manualScrolling(0), - m_functionStore(functionStore) + m_functionStore(functionStore), + m_parameterController(ParameterController(this)) { } View * ListController::view() { + setActiveCell(0); return &m_tableView; } @@ -39,6 +41,9 @@ bool ListController::handleEvent(Ion::Events::Event event) { setActiveCell(m_activeCell-1); return true; case Ion::Events::Event::ENTER: + ((StackViewController *) parentResponder())->push(&m_parameterController); + return true; + case Ion::Events::Event::PLUS: m_manualScrolling += 10; m_tableView.setContentOffset({0, m_manualScrolling}); return true; diff --git a/apps/graph/list/list_controller.h b/apps/graph/list/list_controller.h index 832904a8b..1eaf73d95 100644 --- a/apps/graph/list/list_controller.h +++ b/apps/graph/list/list_controller.h @@ -4,6 +4,7 @@ #include #include "../function_store.h" #include "function_cell.h" +#include "parameter_controller.h" class ListController : public ViewController, public TableViewDataSource { public: @@ -30,6 +31,9 @@ private: int m_activeCell; KDCoordinate m_manualScrolling; Graph::FunctionStore * m_functionStore; + ParameterController m_parameterController; + + }; #endif diff --git a/apps/graph/list/parameter_controller.cpp b/apps/graph/list/parameter_controller.cpp new file mode 100644 index 000000000..e379f96e3 --- /dev/null +++ b/apps/graph/list/parameter_controller.cpp @@ -0,0 +1,19 @@ +#include "parameter_controller.h" + +ParameterController::ParameterController(Responder * parentResponder) : + ViewController(parentResponder), + m_solidColorView(SolidColorView(KDColorRed)) +{ +} + +View * ParameterController::view() { + return &m_solidColorView; +} + +const char * ParameterController::title() const { + return "List Function Parameter"; +} + +bool ParameterController::handleEvent(Ion::Events::Event event) { + return false; +} diff --git a/apps/graph/list/parameter_controller.h b/apps/graph/list/parameter_controller.h new file mode 100644 index 000000000..19390222a --- /dev/null +++ b/apps/graph/list/parameter_controller.h @@ -0,0 +1,19 @@ +#ifndef GRAPH_LIST_PARAM_CONTROLLER_H +#define GRAPH_LIST_PARAM_CONTROLLER_H + +#include + + +class ParameterController : public ViewController { +public: + ParameterController(Responder * parentResponder); + + View * view() override; + const char * title() const override; + bool handleEvent(Ion::Events::Event event) override; + +private: + SolidColorView m_solidColorView; +}; + +#endif