Files
Upsilon/apps/regression/graph_controller.cpp
Émilie Feral 60cb611278 [apps/regression] Create the structure of the application regression
Change-Id: I2433a5e6dabdd9a15d87c8e2ddf3cea5ad329a0e
2017-01-09 15:08:54 +01:00

58 lines
1.4 KiB
C++

#include "graph_controller.h"
namespace Regression {
GraphController::GraphController(Responder * parentResponder, HeaderViewController * headerViewController) :
ViewController(parentResponder),
HeaderViewDelegate(headerViewController),
m_view(SolidColorView(KDColorGreen)),
m_windowButton(this, "Axes", Invocation([](void * context, void * sender) {}, this)),
m_zoomButton(this, "Zoom", Invocation([](void * context, void * sender) {}, this)),
m_defaultInitialisationButton(this, "Initialisation", Invocation([](void * context, void * sender) {}, this))
{
}
const char * GraphController::title() const {
return "Graph";
}
View * GraphController::view() {
return &m_view;
}
bool GraphController::handleEvent(Ion::Events::Event event) {
return false;
}
int GraphController::numberOfButtons() const {
return 3;
}
Button * GraphController::buttonAtIndex(int index) {
if (index == 0) {
return &m_windowButton;
}
if (index == 1) {
return &m_zoomButton;
}
return &m_defaultInitialisationButton;
}
bool GraphController::isEmpty() {
return false;
}
const char * GraphController::emptyMessage() {
return "Aucune donnée à tracer";
}
Responder * GraphController::defaultController() {
return tabController();
}
Responder * GraphController::tabController() const {
return (parentResponder()->parentResponder()->parentResponder()->parentResponder());
}
}