mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 14:20:39 +01:00
GraphApp: Use a FunctionStore
Change-Id: Ib75947c40167489726fafc493ccb0ebf2862142b
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user