[apps] Delete unused ListController

This commit is contained in:
Émilie Feral
2018-10-09 15:14:54 +02:00
parent 97cba08b23
commit c5f86e136b
3 changed files with 0 additions and 103 deletions

View File

@@ -26,7 +26,6 @@ app_objs += $(addprefix apps/graph/,\
graph/storage_intersection_graph_controller.o\
graph/storage_tangent_graph_controller.o\
graph/tangent_graph_controller.o\
list/list_controller.o\
list/storage_list_controller.o\
values/derivative_parameter_controller.o\
values/function_parameter_controller.o\

View File

@@ -1,69 +0,0 @@
#include "list_controller.h"
#include "../app.h"
#include "../../i18n.h"
#include <assert.h>
#include <escher/metric.h>
using namespace Shared;
namespace Graph {
ListController::ListController(Responder * parentResponder, CartesianFunctionStore * functionStore, ButtonRowController * header, ButtonRowController * footer) :
Shared::FunctionListController(parentResponder, functionStore, header, footer, I18n::Message::AddFunction),
m_functionTitleCells{},
m_expressionCells{},
m_parameterController(this, functionStore, I18n::Message::FunctionColor, I18n::Message::DeleteFunction)
{
for (int i = 0; i < k_maxNumberOfRows; i++) {
m_expressionCells[i].setLeftMargin(k_expressionMargin);
}
}
const char * ListController::title() {
return I18n::translate(I18n::Message::FunctionTab);
}
ListParameterController * ListController::parameterController() {
return &m_parameterController;
}
int ListController::maxNumberOfRows() {
return k_maxNumberOfRows;
}
HighlightCell * ListController::titleCells(int index) {
assert(index >= 0 && index < k_maxNumberOfRows);
return &m_functionTitleCells[index];
}
HighlightCell * ListController::expressionCells(int index) {
assert(index >= 0 && index < k_maxNumberOfRows);
return &m_expressionCells[index];
}
void ListController::willDisplayTitleCellAtIndex(HighlightCell * cell, int j) {
Shared::BufferFunctionTitleCell * myFunctionCell = (Shared::BufferFunctionTitleCell *)cell;
CartesianFunction * function = ((CartesianFunctionStore *)m_functionStore)->modelAtIndex(j);
char bufferName[5] = {*function->name(),'(', m_functionStore->symbol(),')', 0};
myFunctionCell->setText(bufferName);
KDColor functionNameColor = function->isActive() ? function->color() : Palette::GreyDark;
myFunctionCell->setColor(functionNameColor);
}
void ListController::willDisplayExpressionCellAtIndex(HighlightCell * cell, int j) {
Shared::FunctionListController::willDisplayExpressionCellAtIndex(cell, j);
FunctionExpressionCell * myCell = (FunctionExpressionCell *)cell;
Function * f = m_functionStore->modelAtIndex(j);
bool active = f->isActive();
KDColor textColor = active ? KDColorBlack : Palette::GreyDark;
myCell->setTextColor(textColor);
}
bool ListController::removeModelRow(ExpressionModel * model) {
if (m_functionStore->numberOfModels() > 1) {
return Shared::FunctionListController::removeModelRow(model);
}
return false;
}
}

View File

@@ -1,33 +0,0 @@
#ifndef GRAPH_LIST_CONTROLLER_H
#define GRAPH_LIST_CONTROLLER_H
#include <escher.h>
#include "../../shared/function_list_controller.h"
#include "../cartesian_function_store.h"
#include "../../shared/buffer_function_title_cell.h"
#include "../../shared/function_expression_cell.h"
#include "../../shared/list_parameter_controller.h"
namespace Graph {
class ListController : public Shared::FunctionListController {
public:
ListController(Responder * parentResponder, CartesianFunctionStore * functionStore, ButtonRowController * header, ButtonRowController * footer);
const char * title() override;
private:
Shared::ListParameterController * parameterController() override;
int maxNumberOfRows() override;
HighlightCell * titleCells(int index) override;
HighlightCell * expressionCells(int index) override;
void willDisplayTitleCellAtIndex(HighlightCell * cell, int j) override;
void willDisplayExpressionCellAtIndex(HighlightCell * cell, int j) override;
bool removeModelRow(Shared::ExpressionModel * function) override;
constexpr static int k_maxNumberOfRows = 5;
Shared::BufferFunctionTitleCell m_functionTitleCells[k_maxNumberOfRows];
Shared::FunctionExpressionCell m_expressionCells[k_maxNumberOfRows];
Shared::ListParameterController m_parameterController;
};
}
#endif