GraphApp: Use a FunctionStore

Change-Id: Ib75947c40167489726fafc493ccb0ebf2862142b
This commit is contained in:
Romain Goyet
2016-08-22 14:40:07 +02:00
parent e1dcffd4ce
commit 00afebbe2d
15 changed files with 166 additions and 36 deletions

View File

@@ -1,22 +1,29 @@
#include "function_cell.h"
#include <poincare.h>
FunctionCell::FunctionCell() :
ChildlessView(),
Responder(nullptr),
m_function(nullptr),
m_focused(false),
m_even(false)
{
m_message = "NULL";
}
void FunctionCell::drawRect(KDContext * ctx, KDRect rect) const {
KDColor background = m_even ? KDColor(0xEEEEEE) : KDColor(0x777777);
ctx->fillRect(rect, background);
ctx->drawString(m_message, KDPointZero, m_focused);
ctx->drawString(m_function->text(), KDPointZero, m_focused);
m_function->layout()->draw(ctx, KDPointZero);
//Expression * foo = Expression::parse("1+2/3");
//ExpressionLayout * fooLayout = foo->createLayout();
//fooLayout->draw(ctx, KDPointZero);
//delete fooLayout;
//delete foo;
}
void FunctionCell::setMessage(const char * message) {
m_message = message;
void FunctionCell::setFunction(Graph::Function * f) {
m_function = f;
}
void FunctionCell::setFocused(bool focused) {