Files
Upsilon/apps/regression/store_controller.cpp
Émilie Feral b78aaf08d7 [apps/graph/values] Adjust display mode in values page according to
preferences

Change-Id: I79e8bee7f35904cd54c74dce9cd456d921103e1d
2017-02-02 10:29:07 +01:00

34 lines
1.3 KiB
C++

#include "store_controller.h"
#include "app.h"
#include "../apps_container.h"
#include "../constant.h"
#include "../../poincare/src/layout/baseline_relative_layout.h"
#include "../../poincare/src/layout/string_layout.h"
#include <assert.h>
namespace Regression {
StoreController::StoreController(Responder * parentResponder, Store * store, HeaderViewController * header) :
::StoreController(parentResponder, store, header),
m_titleCells{EvenOddExpressionCell(0.5f, 0.5f), EvenOddExpressionCell(0.5f, 0.5f)}
{
m_titleLayout[0] = new BaselineRelativeLayout(new StringLayout("X", 1, KDText::FontSize::Small), new StringLayout("i", 1, KDText::FontSize::Small), BaselineRelativeLayout::Type::Subscript);
m_titleLayout[1] = new BaselineRelativeLayout(new StringLayout("Y", 1, KDText::FontSize::Small), new StringLayout("i", 1, KDText::FontSize::Small), BaselineRelativeLayout::Type::Subscript);
}
void StoreController::willDisplayCellAtLocation(TableViewCell * cell, int i, int j) {
::StoreController::willDisplayCellAtLocation(cell, i, j);
if (cellAtLocationIsEditable(i, j)) {
return;
}
EvenOddExpressionCell * mytitleCell = (EvenOddExpressionCell *)cell;
mytitleCell->setExpression(m_titleLayout[i]);
}
TableViewCell * StoreController::titleCells(int index) {
assert(index >= 0 && index < k_numberOfTitleCells);
return &m_titleCells[index];
}
}