Files
Upsilon/apps/graph/graph/graph_controller.cpp
Émilie Feral bc9e504394 [apps/graph] add a method in list/graph controller to return the parent tabController
Change-Id: I4865b6a6096a96a570cc9cc8d0b8802294ba2225
2016-09-16 13:33:22 +02:00

33 lines
732 B
C++

#include "graph_controller.h"
GraphController::GraphController(Responder * parentResponder, Graph::FunctionStore * functionStore) :
ViewController(parentResponder),
m_view(GraphView(functionStore))
{
}
View * GraphController::view() {
return &m_view;
}
const char * GraphController::title() const {
return "Graphique";
}
Responder * GraphController::tabController() const{
return (parentResponder());
}
bool GraphController::handleEvent(Ion::Events::Event event) {
switch (event) {
case Ion::Events::Event::ENTER:
m_view.moveCursorRight();
return true;
case Ion::Events::Event::UP_ARROW:
app()->setFirstResponder(tabController());
return true;
default:
return false;
}
}