Files
Upsilon/apps/probability/calculation_controller.cpp
Émilie Feral 4bef23b7e2 [apps] Make the abstract curve view hold methods to draw labels
Change-Id: Ib1451b51c6d16db27487b5c9d34cd345fcf379f0
2016-12-08 15:21:52 +01:00

52 lines
1.1 KiB
C++

#include "calculation_controller.h"
#include <assert.h>
namespace Probability {
CalculationController::ContentView::ContentView(Responder * parentResponder, Law * law) :
m_lawCurveView(LawCurveView(law))
{
}
int CalculationController::ContentView::numberOfSubviews() const {
return 1;
}
View * CalculationController::ContentView::subviewAtIndex(int index) {
assert(index == 0);
return &m_lawCurveView;
}
void CalculationController::ContentView::layoutSubviews() {
m_lawCurveView.setFrame(bounds());
}
LawCurveView * CalculationController::ContentView::lawCurveView() {
return &m_lawCurveView;
}
CalculationController::CalculationController(Responder * parentResponder, Law * law) :
ViewController(parentResponder),
m_contentView(ContentView(this, law)),
m_law(law)
{
}
View * CalculationController::view() {
return &m_contentView;
}
const char * CalculationController::title() const {
return "Calculer les probabilites";
}
bool CalculationController::handleEvent(Ion::Events::Event event) {
return false;
}
void CalculationController::didBecomeFirstResponder() {
m_contentView.lawCurveView()->reload();
}
}