mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[escher] Reorganize all cells'name and factorize their layouts
Change-Id: I69900ee98ff6a6868f96d70a0e335a589ef16c3f
This commit is contained in:
@@ -19,7 +19,6 @@ app_objs += $(addprefix apps/,\
|
||||
math_toolbox.o\
|
||||
node.o\
|
||||
title_bar_view.o\
|
||||
toolbox_leaf_cell.o\
|
||||
toolbox_node.o\
|
||||
variable_box_controller.o\
|
||||
variable_box_leaf_cell.o\
|
||||
|
||||
@@ -131,7 +131,7 @@ int HistoryController::numberOfRows() {
|
||||
return m_calculationStore->numberOfCalculations();
|
||||
};
|
||||
|
||||
TableViewCell * HistoryController::reusableCell(int index, int type) {
|
||||
HighlightCell * HistoryController::reusableCell(int index, int type) {
|
||||
assert(type == 0);
|
||||
assert(index >= 0);
|
||||
assert(index < k_maxNumberOfDisplayedRows);
|
||||
@@ -143,7 +143,7 @@ int HistoryController::reusableCellCount(int type) {
|
||||
return k_maxNumberOfDisplayedRows;
|
||||
}
|
||||
|
||||
void HistoryController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
void HistoryController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
HistoryViewCell * myCell = (HistoryViewCell *)cell;
|
||||
myCell->setCalculation(m_calculationStore->calculationAtIndex(index));
|
||||
myCell->setEven(index%2 == 0);
|
||||
|
||||
@@ -21,9 +21,9 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
void reload();
|
||||
int numberOfRows() override;
|
||||
TableViewCell * reusableCell(int index, int type) override;
|
||||
HighlightCell * reusableCell(int index, int type) override;
|
||||
int reusableCellCount(int type) override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
KDCoordinate rowHeight(int j) override;
|
||||
KDCoordinate cumulatedHeightFromIndex(int j) override;
|
||||
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
|
||||
|
||||
@@ -42,7 +42,7 @@ void CalculationSelectableTableView::scrollToSubviewOfTypeOfCellAtLocation(Histo
|
||||
/* As we scroll, the selected calculation does not use the same history view
|
||||
* cell, thus, we want to deselect the previous used history view cell. */
|
||||
if (selectedRow() >= 0) {
|
||||
TableViewCell * previousCell = cellAtLocation(selectedColumn(), selectedRow());
|
||||
HighlightCell * previousCell = cellAtLocation(selectedColumn(), selectedRow());
|
||||
previousCell->setHighlighted(false);
|
||||
}
|
||||
/* Main part of the scroll */
|
||||
@@ -61,7 +61,7 @@ void CalculationSelectableTableView::scrollToSubviewOfTypeOfCellAtLocation(Histo
|
||||
* inform the delegate which history view cell is highlighted even if the
|
||||
* selected calculation has not changed. */
|
||||
setContentOffset(KDPoint(contentOffsetX, contentOffsetY));
|
||||
TableViewCell * cell = cellAtLocation(i, j);
|
||||
HighlightCell * cell = cellAtLocation(i, j);
|
||||
cell->setHighlighted(true);
|
||||
if (m_delegate) {
|
||||
m_delegate->tableViewDidChangeSelection(this, selectedColumn(), selectedRow());
|
||||
|
||||
@@ -9,9 +9,9 @@ CurveParameterController::CurveParameterController(InteractiveCurveViewRange * g
|
||||
ViewController(nullptr),
|
||||
m_bannerView(bannerView),
|
||||
m_function(nullptr),
|
||||
m_calculationCell(ChevronMenuListCell((char*)"Calculer")),
|
||||
m_goToCell(ChevronMenuListCell((char*)"Aller a")),
|
||||
m_derivativeCell(SwitchMenuListCell((char*)"Nombre derivee")),
|
||||
m_calculationCell(PointerTableCellWithChevron((char*)"Calculer")),
|
||||
m_goToCell(PointerTableCellWithChevron((char*)"Aller a")),
|
||||
m_derivativeCell(PointerTableCellWithSwitch((char*)"Nombre derivee")),
|
||||
m_selectableTableView(SelectableTableView(this, this, Metric::TopMargin, Metric::RightMargin,
|
||||
Metric::BottomMargin, Metric::LeftMargin)),
|
||||
m_goToParameterController(GoToParameterController(this, graphRange, cursor))
|
||||
@@ -31,7 +31,7 @@ void CurveParameterController::didBecomeFirstResponder() {
|
||||
app()->setFirstResponder(&m_selectableTableView);
|
||||
}
|
||||
|
||||
void CurveParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
void CurveParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
if (cell == &m_derivativeCell) {
|
||||
SwitchView * switchView = (SwitchView *)m_derivativeCell.accessoryView();
|
||||
switchView->setState(m_bannerView->displayDerivative());
|
||||
@@ -67,10 +67,10 @@ int CurveParameterController::numberOfRows() {
|
||||
return k_totalNumberOfCells;
|
||||
};
|
||||
|
||||
TableViewCell * CurveParameterController::reusableCell(int index) {
|
||||
HighlightCell * CurveParameterController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCells);
|
||||
TableViewCell * cells[] = {&m_calculationCell, &m_goToCell, &m_derivativeCell};
|
||||
HighlightCell * cells[] = {&m_calculationCell, &m_goToCell, &m_derivativeCell};
|
||||
return cells[index];
|
||||
}
|
||||
|
||||
|
||||
@@ -20,17 +20,17 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
int numberOfRows() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
void setFunction(CartesianFunction * function);
|
||||
private:
|
||||
BannerView * m_bannerView;
|
||||
CartesianFunction * m_function;
|
||||
constexpr static int k_totalNumberOfCells = 3;
|
||||
ChevronMenuListCell m_calculationCell;
|
||||
ChevronMenuListCell m_goToCell;
|
||||
SwitchMenuListCell m_derivativeCell;
|
||||
PointerTableCellWithChevron m_calculationCell;
|
||||
PointerTableCellWithChevron m_goToCell;
|
||||
PointerTableCellWithSwitch m_derivativeCell;
|
||||
SelectableTableView m_selectableTableView;
|
||||
GoToParameterController m_goToParameterController;
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Graph {
|
||||
|
||||
GoToParameterController::GoToParameterController(Responder * parentResponder, InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor) :
|
||||
FloatParameterController(parentResponder),
|
||||
m_abscisseCell(EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer, (char*)"x")),
|
||||
m_abscisseCell(PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer, (char*)"x")),
|
||||
m_graphRange(graphRange),
|
||||
m_cursor(cursor),
|
||||
m_function(nullptr)
|
||||
@@ -38,7 +38,7 @@ int GoToParameterController::numberOfRows() {
|
||||
return 1;
|
||||
};
|
||||
|
||||
TableViewCell * GoToParameterController::reusableCell(int index) {
|
||||
HighlightCell * GoToParameterController::reusableCell(int index) {
|
||||
assert(index == 0);
|
||||
return &m_abscisseCell;
|
||||
}
|
||||
|
||||
@@ -13,15 +13,15 @@ public:
|
||||
GoToParameterController(Responder * parentResponder, Shared::InteractiveCurveViewRange * graphRange, Shared::CurveViewCursor * cursor);
|
||||
const char * title() const override;
|
||||
int numberOfRows() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void setFunction(CartesianFunction * function);
|
||||
bool textFieldDidFinishEditing(TextField * textField, const char * text) override;
|
||||
private:
|
||||
float parameterAtIndex(int index) override;
|
||||
void setParameterAtIndex(int parameterIndex, float f) override;
|
||||
char m_draftTextBuffer[EditableTextMenuListCell::k_bufferLength];
|
||||
EditableTextMenuListCell m_abscisseCell;
|
||||
char m_draftTextBuffer[PointerTableCellWithEditableText::k_bufferLength];
|
||||
PointerTableCellWithEditableText m_abscisseCell;
|
||||
Shared::InteractiveCurveViewRange * m_graphRange;
|
||||
Shared::CurveViewCursor * m_cursor;
|
||||
CartesianFunction * m_function;
|
||||
|
||||
@@ -45,7 +45,7 @@ int InitialisationParameterController::numberOfRows() {
|
||||
};
|
||||
|
||||
|
||||
TableViewCell * InitialisationParameterController::reusableCell(int index) {
|
||||
HighlightCell * InitialisationParameterController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCells);
|
||||
return &m_cells[index];
|
||||
@@ -59,8 +59,8 @@ KDCoordinate InitialisationParameterController::cellHeight() {
|
||||
return Metric::ParameterCellHeight;
|
||||
}
|
||||
|
||||
void InitialisationParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
MenuListCell * myCell = (MenuListCell *)cell;
|
||||
void InitialisationParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
PointerTableCell * myCell = (PointerTableCell *)cell;
|
||||
const char * titles[4] = {"Trigonometrique", "Abscisses entieres", "Orthonorme", "Reglage de base"};
|
||||
myCell->setText(titles[index]);
|
||||
}
|
||||
|
||||
@@ -15,12 +15,12 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
int numberOfRows() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
private:
|
||||
constexpr static int k_totalNumberOfCells = 4;
|
||||
MenuListCell m_cells[k_totalNumberOfCells];
|
||||
PointerTableCell m_cells[k_totalNumberOfCells];
|
||||
SelectableTableView m_selectableTableView;
|
||||
Shared::InteractiveCurveViewRange * m_graphRange;
|
||||
};
|
||||
|
||||
@@ -112,18 +112,18 @@ int ListController::maxNumberOfRows() {
|
||||
return k_maxNumberOfRows;
|
||||
}
|
||||
|
||||
TableViewCell * ListController::titleCells(int index) {
|
||||
HighlightCell * ListController::titleCells(int index) {
|
||||
assert(index >= 0 && index < k_maxNumberOfRows);
|
||||
return &m_functionTitleCells[index];
|
||||
}
|
||||
|
||||
TableViewCell * ListController::expressionCells(int index) {
|
||||
HighlightCell * ListController::expressionCells(int index) {
|
||||
assert(index >= 0 && index < k_maxNumberOfRows);
|
||||
return &m_expressionCells[index];
|
||||
}
|
||||
|
||||
|
||||
void ListController::willDisplayTitleCellAtIndex(TableViewCell * cell, int j) {
|
||||
void ListController::willDisplayTitleCellAtIndex(HighlightCell * cell, int j) {
|
||||
FunctionTitleCell * myFunctionCell = (FunctionTitleCell *)cell;
|
||||
CartesianFunction * function = ((CartesianFunctionStore *)m_functionStore)->functionAtIndex(j);
|
||||
char bufferName[5] = {*function->name(),'(',function->symbol(),')', 0};
|
||||
@@ -132,7 +132,7 @@ void ListController::willDisplayTitleCellAtIndex(TableViewCell * cell, int j) {
|
||||
myFunctionCell->setColor(functionNameColor);
|
||||
}
|
||||
|
||||
void ListController::willDisplayExpressionCellAtIndex(TableViewCell * cell, int j) {
|
||||
void ListController::willDisplayExpressionCellAtIndex(HighlightCell * cell, int j) {
|
||||
FunctionExpressionCell * myCell = (FunctionExpressionCell *)cell;
|
||||
Function * f = m_functionStore->functionAtIndex(j);
|
||||
myCell->setExpression(f->layout());
|
||||
|
||||
@@ -23,10 +23,10 @@ private:
|
||||
void editExpression(Shared::Function * function, Ion::Events::Event event);
|
||||
Shared::ListParameterController * parameterController() override;
|
||||
int maxNumberOfRows() override;
|
||||
TableViewCell * titleCells(int index) override;
|
||||
TableViewCell * expressionCells(int index) override;
|
||||
void willDisplayTitleCellAtIndex(TableViewCell * cell, int j) override;
|
||||
void willDisplayExpressionCellAtIndex(TableViewCell * cell, int j) 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;
|
||||
constexpr static int k_maxNumberOfRows = 5;
|
||||
FunctionTitleCell m_functionTitleCells[k_maxNumberOfRows];
|
||||
Shared::FunctionExpressionCell m_expressionCells[k_maxNumberOfRows];
|
||||
|
||||
@@ -5,9 +5,9 @@ namespace Graph {
|
||||
|
||||
AbscissaParameterController::AbscissaParameterController(Responder * parentResponder, IntervalParameterController * intervalParameterController) :
|
||||
ViewController(parentResponder),
|
||||
m_deleteColumn(MenuListCell((char*)"Effacer la colonne")),
|
||||
m_copyColumn(ChevronMenuListCell((char*)"Copier la colonne dans une liste")),
|
||||
m_setInterval(ChevronMenuListCell((char*)"Regler l'intervalle")),
|
||||
m_deleteColumn(PointerTableCell((char*)"Effacer la colonne")),
|
||||
m_copyColumn(PointerTableCellWithChevron((char*)"Copier la colonne dans une liste")),
|
||||
m_setInterval(PointerTableCellWithChevron((char*)"Regler l'intervalle")),
|
||||
m_selectableTableView(SelectableTableView(this, this, Metric::TopMargin, Metric::RightMargin,
|
||||
Metric::BottomMargin, Metric::LeftMargin)),
|
||||
m_intervalParameterController(intervalParameterController)
|
||||
@@ -60,10 +60,10 @@ int AbscissaParameterController::numberOfRows() {
|
||||
return k_totalNumberOfCell;
|
||||
};
|
||||
|
||||
TableViewCell * AbscissaParameterController::reusableCell(int index) {
|
||||
HighlightCell * AbscissaParameterController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCell);
|
||||
TableViewCell * cells[] = {&m_deleteColumn, &m_copyColumn, &m_setInterval};
|
||||
HighlightCell * cells[] = {&m_deleteColumn, &m_copyColumn, &m_setInterval};
|
||||
return cells[index];
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,13 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
int numberOfRows() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
private:
|
||||
constexpr static int k_totalNumberOfCell = 3;
|
||||
MenuListCell m_deleteColumn;
|
||||
ChevronMenuListCell m_copyColumn;
|
||||
ChevronMenuListCell m_setInterval;
|
||||
PointerTableCell m_deleteColumn;
|
||||
PointerTableCellWithChevron m_copyColumn;
|
||||
PointerTableCellWithChevron m_setInterval;
|
||||
SelectableTableView m_selectableTableView;
|
||||
IntervalParameterController * m_intervalParameterController;
|
||||
};
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Graph {
|
||||
DerivativeParameterController::DerivativeParameterController(ValuesController * valuesController) :
|
||||
ViewController(valuesController),
|
||||
m_pageTitle{"Colonne f'(x)"},
|
||||
m_hideColumn(MenuListCell((char*)"Masquer la colonne de la derivee")),
|
||||
m_copyColumn(ChevronMenuListCell((char*)"Copier la colonne dans une liste")),
|
||||
m_hideColumn(PointerTableCell((char*)"Masquer la colonne de la derivee")),
|
||||
m_copyColumn(PointerTableCellWithChevron((char*)"Copier la colonne dans une liste")),
|
||||
m_selectableTableView(SelectableTableView(this, this, Metric::TopMargin, Metric::RightMargin,
|
||||
Metric::BottomMargin, Metric::LeftMargin)),
|
||||
m_function(nullptr),
|
||||
@@ -65,10 +65,10 @@ int DerivativeParameterController::numberOfRows() {
|
||||
return k_totalNumberOfCell;
|
||||
};
|
||||
|
||||
TableViewCell * DerivativeParameterController::reusableCell(int index) {
|
||||
HighlightCell * DerivativeParameterController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCell);
|
||||
TableViewCell * cells[] = {&m_hideColumn, &m_copyColumn};
|
||||
HighlightCell * cells[] = {&m_hideColumn, &m_copyColumn};
|
||||
return cells[index];
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
int numberOfRows() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
|
||||
void setFunction(CartesianFunction * function);
|
||||
@@ -26,8 +26,8 @@ private:
|
||||
constexpr static int k_totalNumberOfCell = 2;
|
||||
constexpr static int k_maxNumberOfCharsInTitle = 16;
|
||||
char m_pageTitle[k_maxNumberOfCharsInTitle];
|
||||
MenuListCell m_hideColumn;
|
||||
ChevronMenuListCell m_copyColumn;
|
||||
PointerTableCell m_hideColumn;
|
||||
PointerTableCellWithChevron m_copyColumn;
|
||||
SelectableTableView m_selectableTableView;
|
||||
CartesianFunction * m_function;
|
||||
ValuesController * m_valuesController;
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Graph {
|
||||
FunctionParameterController::FunctionParameterController(ValuesController * valuesController) :
|
||||
ViewController(nullptr),
|
||||
m_pageTitle{"Colonne f(x)"},
|
||||
m_displayDerivativeColumn(SwitchMenuListCell((char*)"Colonne de la fonction derivee")),
|
||||
m_copyColumn(ChevronMenuListCell((char*)"Copier la colonne dans une liste")),
|
||||
m_displayDerivativeColumn(PointerTableCellWithSwitch((char*)"Colonne de la fonction derivee")),
|
||||
m_copyColumn(PointerTableCellWithChevron((char*)"Copier la colonne dans une liste")),
|
||||
m_selectableTableView(SelectableTableView(this, this, Metric::TopMargin, Metric::RightMargin,
|
||||
Metric::BottomMargin, Metric::LeftMargin)),
|
||||
m_function(nullptr),
|
||||
@@ -67,10 +67,10 @@ int FunctionParameterController::numberOfRows() {
|
||||
return k_totalNumberOfCell;
|
||||
};
|
||||
|
||||
TableViewCell * FunctionParameterController::reusableCell(int index) {
|
||||
HighlightCell * FunctionParameterController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCell);
|
||||
TableViewCell * cells[] = {&m_displayDerivativeColumn, &m_copyColumn};
|
||||
HighlightCell * cells[] = {&m_displayDerivativeColumn, &m_copyColumn};
|
||||
return cells[index];
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ KDCoordinate FunctionParameterController::cellHeight() {
|
||||
return Metric::ParameterCellHeight;
|
||||
}
|
||||
|
||||
void FunctionParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
void FunctionParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
if (cell == &m_displayDerivativeColumn) {
|
||||
SwitchView * switchView = (SwitchView *)m_displayDerivativeColumn.accessoryView();
|
||||
switchView->setState(m_function->displayDerivative());
|
||||
|
||||
@@ -18,17 +18,17 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
int numberOfRows() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
|
||||
void setFunction(CartesianFunction * function);
|
||||
private:
|
||||
constexpr static int k_totalNumberOfCell = 2;
|
||||
constexpr static int k_maxNumberOfCharsInTitle = 16;
|
||||
char m_pageTitle[k_maxNumberOfCharsInTitle];
|
||||
SwitchMenuListCell m_displayDerivativeColumn;
|
||||
ChevronMenuListCell m_copyColumn;
|
||||
PointerTableCellWithSwitch m_displayDerivativeColumn;
|
||||
PointerTableCellWithChevron m_copyColumn;
|
||||
SelectableTableView m_selectableTableView;
|
||||
CartesianFunction * m_function;
|
||||
ValuesController * m_valuesController;
|
||||
|
||||
@@ -9,9 +9,9 @@ namespace Graph {
|
||||
IntervalParameterController::IntervalParameterController(Responder * parentResponder, Interval * interval) :
|
||||
FloatParameterController(parentResponder),
|
||||
m_interval(interval),
|
||||
m_intervalStartCell(EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer, (char*)"X Debut")),
|
||||
m_intervalEndCell(EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer, (char*)"X Fin")),
|
||||
m_intervalStepCell(EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer, (char*)"Pas"))
|
||||
m_intervalStartCell(PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer, (char*)"X Debut")),
|
||||
m_intervalEndCell(PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer, (char*)"X Fin")),
|
||||
m_intervalStepCell(PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer, (char*)"Pas"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ int IntervalParameterController::numberOfRows() {
|
||||
return k_totalNumberOfCell;
|
||||
};
|
||||
|
||||
TableViewCell * IntervalParameterController::reusableCell(int index) {
|
||||
HighlightCell * IntervalParameterController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCell);
|
||||
TableViewCell * cells[] = {&m_intervalStartCell, &m_intervalEndCell, &m_intervalStepCell};
|
||||
HighlightCell * cells[] = {&m_intervalStartCell, &m_intervalEndCell, &m_intervalStepCell};
|
||||
return cells[index];
|
||||
}
|
||||
|
||||
|
||||
@@ -13,17 +13,17 @@ public:
|
||||
Interval * interval();
|
||||
const char * title() const override;
|
||||
int numberOfRows() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
private:
|
||||
float parameterAtIndex(int index) override;
|
||||
void setParameterAtIndex(int parameterIndex, float f) override;
|
||||
constexpr static int k_totalNumberOfCell = 3;
|
||||
Interval * m_interval;
|
||||
char m_draftTextBuffer[EditableTextMenuListCell::k_bufferLength];
|
||||
EditableTextMenuListCell m_intervalStartCell;
|
||||
EditableTextMenuListCell m_intervalEndCell;
|
||||
EditableTextMenuListCell m_intervalStepCell;
|
||||
char m_draftTextBuffer[PointerTableCellWithEditableText::k_bufferLength];
|
||||
PointerTableCellWithEditableText m_intervalStartCell;
|
||||
PointerTableCellWithEditableText m_intervalEndCell;
|
||||
PointerTableCellWithEditableText m_intervalStepCell;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ int ValuesController::numberOfColumns() {
|
||||
return result;
|
||||
}
|
||||
|
||||
void ValuesController::willDisplayCellAtLocation(TableViewCell * cell, int i, int j) {
|
||||
void ValuesController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
|
||||
App * graphApp = (App *)app();
|
||||
willDisplayCellAtLocationWithDisplayMode(cell, i, j, Expression::FloatDisplayMode::Default);
|
||||
if (cellAtLocationIsEditable(i, j)) {
|
||||
@@ -206,7 +206,7 @@ int ValuesController::indexFromCumulatedWidth(KDCoordinate offsetX) {
|
||||
}
|
||||
}
|
||||
|
||||
TableViewCell * ValuesController::reusableCell(int index, int type) {
|
||||
HighlightCell * ValuesController::reusableCell(int index, int type) {
|
||||
assert(index >= 0);
|
||||
switch (type) {
|
||||
case 0:
|
||||
|
||||
@@ -24,11 +24,11 @@ public:
|
||||
int numberOfButtons() const override;
|
||||
Button * buttonAtIndex(int index) override;
|
||||
int numberOfColumns() override;
|
||||
void willDisplayCellAtLocation(TableViewCell * cell, int i, int j) override;
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
|
||||
KDCoordinate columnWidth(int i) override;
|
||||
KDCoordinate cumulatedWidthFromIndex(int i) override;
|
||||
int indexFromCumulatedWidth(KDCoordinate offsetX) override;
|
||||
TableViewCell * reusableCell(int index, int type) override;
|
||||
HighlightCell * reusableCell(int index, int type) override;
|
||||
int reusableCellCount(int type) override;
|
||||
int typeAtLocation(int i, int j) override;
|
||||
bool isEmpty() const override;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace Home {
|
||||
|
||||
AppCell::AppCell() :
|
||||
TableViewCell(),
|
||||
HighlightCell(),
|
||||
m_nameView(PointerTextView(KDText::FontSize::Small, nullptr, 0.5f, 0.5f, KDColorBlack, KDColorWhite)),
|
||||
m_visible(true)
|
||||
{
|
||||
@@ -39,7 +39,7 @@ void AppCell::setVisible(bool visible) {
|
||||
}
|
||||
|
||||
void AppCell::reloadCell() {
|
||||
TableViewCell::reloadCell();
|
||||
HighlightCell::reloadCell();
|
||||
m_nameView.setBackgroundColor(isHighlighted() ? Palette::YellowDark : KDColorWhite);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Home {
|
||||
|
||||
class AppCell : public TableViewCell {
|
||||
class AppCell : public HighlightCell {
|
||||
public:
|
||||
AppCell();
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ KDCoordinate Controller::cellWidth() {
|
||||
return k_cellWidth;
|
||||
}
|
||||
|
||||
TableViewCell * Controller::reusableCell(int index) {
|
||||
HighlightCell * Controller::reusableCell(int index) {
|
||||
return &m_cells[index];
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ int Controller::reusableCellCount() {
|
||||
return k_maxNumberOfCells;
|
||||
}
|
||||
|
||||
void Controller::willDisplayCellAtLocation(TableViewCell * cell, int i, int j) {
|
||||
void Controller::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
|
||||
AppCell * appCell = (AppCell *)cell;
|
||||
int appIndex = (j*k_numberOfColumns+i)+1;
|
||||
if (appIndex >= m_container->numberOfApps()) {
|
||||
|
||||
@@ -21,9 +21,9 @@ public:
|
||||
virtual int numberOfColumns() override;
|
||||
virtual KDCoordinate cellHeight() override;
|
||||
virtual KDCoordinate cellWidth() override;
|
||||
virtual TableViewCell * reusableCell(int index) override;
|
||||
virtual HighlightCell * reusableCell(int index) override;
|
||||
virtual int reusableCellCount() override;
|
||||
void willDisplayCellAtLocation(TableViewCell * cell, int i, int j) override;
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
|
||||
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
|
||||
private:
|
||||
int numberOfIcons();
|
||||
|
||||
@@ -148,7 +148,7 @@ int MathToolbox::numberOfRows() {
|
||||
return m_nodeModel->numberOfChildren();
|
||||
}
|
||||
|
||||
TableViewCell * MathToolbox::reusableCell(int index, int type) {
|
||||
HighlightCell * MathToolbox::reusableCell(int index, int type) {
|
||||
assert(type < 2);
|
||||
assert(index >= 0);
|
||||
assert(index < k_maxNumberOfDisplayedRows);
|
||||
@@ -162,15 +162,16 @@ int MathToolbox::reusableCellCount(int type) {
|
||||
return k_maxNumberOfDisplayedRows;
|
||||
}
|
||||
|
||||
void MathToolbox::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
void MathToolbox::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
ToolboxNode * node = (ToolboxNode *)m_nodeModel->children(index);
|
||||
if (node->numberOfChildren() == 0) {
|
||||
ToolboxLeafCell * myCell = (ToolboxLeafCell *)cell;
|
||||
myCell->setLabel(node->label());
|
||||
myCell->setSubtitle(node->text());
|
||||
PointerTableCellWithPointer * myCell = (PointerTableCellWithPointer *)cell;
|
||||
myCell->setText(node->label());
|
||||
myCell->setAccessoryText(node->text());
|
||||
myCell->setAccessoryTextColor(Palette::GreyDark);
|
||||
return;
|
||||
}
|
||||
MenuListCell * myCell = (MenuListCell *)cell;
|
||||
PointerTableCell * myCell = (PointerTableCell *)cell;
|
||||
myCell->setText(node->label());
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include <escher.h>
|
||||
#include "toolbox_node.h"
|
||||
#include "toolbox_leaf_cell.h"
|
||||
|
||||
/* m_nodeModel points at the node of the tree (describing the whole model)
|
||||
* where we are located. It enables to know which rows are leaves and which are
|
||||
@@ -16,9 +15,9 @@ public:
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
|
||||
int numberOfRows() override;
|
||||
TableViewCell * reusableCell(int index, int type) override;
|
||||
HighlightCell * reusableCell(int index, int type) override;
|
||||
int reusableCellCount(int type) override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
KDCoordinate rowHeight(int j) override;
|
||||
KDCoordinate cumulatedHeightFromIndex(int j) override;
|
||||
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
|
||||
@@ -70,8 +69,8 @@ private:
|
||||
bool selectSubMenu(ToolboxNode * selectedNode);
|
||||
bool returnToPreviousMenu();
|
||||
Stack m_stack;
|
||||
ToolboxLeafCell m_leafCells[k_maxNumberOfDisplayedRows];
|
||||
ChevronMenuListCell m_nodeCells[k_maxNumberOfDisplayedRows];
|
||||
PointerTableCellWithPointer m_leafCells[k_maxNumberOfDisplayedRows];
|
||||
PointerTableCellWithChevron m_nodeCells[k_maxNumberOfDisplayedRows];
|
||||
ListController m_listController;
|
||||
ToolboxNode * m_nodeModel;
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
namespace Probability {
|
||||
|
||||
Cell::Cell() :
|
||||
TableViewCell(),
|
||||
HighlightCell(),
|
||||
m_labelView(PointerTextView(KDText::FontSize::Large, nullptr, 0, 0.5, KDColorBlack, KDColorWhite))
|
||||
{
|
||||
}
|
||||
@@ -33,7 +33,7 @@ void Cell::layoutSubviews() {
|
||||
}
|
||||
|
||||
void Cell::reloadCell() {
|
||||
TableViewCell::reloadCell();
|
||||
HighlightCell::reloadCell();
|
||||
KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite;
|
||||
m_labelView.setBackgroundColor(backgroundColor);
|
||||
m_chevronView.setHighlighted(isHighlighted());
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace Probability {
|
||||
|
||||
class Cell : public TableViewCell {
|
||||
class Cell : public HighlightCell {
|
||||
public:
|
||||
Cell();
|
||||
void reloadCell() override;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace Probability {
|
||||
|
||||
ImageTableView::ImageCell::ImageCell() :
|
||||
TableViewCell()
|
||||
HighlightCell()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void ImageTableView::ImageCell::layoutSubviews() {
|
||||
}
|
||||
|
||||
void ImageTableView::ImageCell::reloadCell() {
|
||||
TableViewCell::reloadCell();
|
||||
HighlightCell::reloadCell();
|
||||
if (isHighlighted()) {
|
||||
m_iconView.setImage(m_focusedIcon);
|
||||
} else {
|
||||
@@ -108,7 +108,7 @@ int ImageTableView::numberOfRows() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
TableViewCell * ImageTableView::reusableCell(int index) {
|
||||
HighlightCell * ImageTableView::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_numberOfImages);
|
||||
return &m_imageCells[index];
|
||||
@@ -118,7 +118,7 @@ int ImageTableView::reusableCellCount() {
|
||||
return k_numberOfImages;
|
||||
}
|
||||
|
||||
void ImageTableView::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
void ImageTableView::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
ImageCell * myCell = (ImageCell *)cell;
|
||||
const Image * images[3] = {ImageStore::Calcul1Icon, ImageStore::Calcul2Icon, ImageStore::Calcul3Icon};
|
||||
const Image * focusedImages[3] = {ImageStore::FocusedCalcul1Icon, ImageStore::FocusedCalcul2Icon, ImageStore::FocusedCalcul3Icon};
|
||||
|
||||
@@ -17,9 +17,9 @@ public:
|
||||
void select(bool select);
|
||||
void setHighlight(bool highlight);
|
||||
int numberOfRows() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
constexpr static KDCoordinate k_imageWidth = 35;
|
||||
constexpr static KDCoordinate k_imageHeight = 19;
|
||||
@@ -28,7 +28,7 @@ private:
|
||||
View * subviewAtIndex(int index) override;
|
||||
void layoutSubviews() override;
|
||||
void setCalculationAccordingToIndex(int index);
|
||||
class ImageCell : public TableViewCell {
|
||||
class ImageCell : public HighlightCell {
|
||||
public:
|
||||
ImageCell();
|
||||
void reloadCell() override;
|
||||
|
||||
@@ -94,7 +94,7 @@ int Probability::LawController::numberOfRows() {
|
||||
return k_totalNumberOfModels;
|
||||
};
|
||||
|
||||
TableViewCell * Probability::LawController::reusableCell(int index) {
|
||||
HighlightCell * Probability::LawController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfModels);
|
||||
return &m_cells[index];
|
||||
@@ -104,7 +104,7 @@ int Probability::LawController::reusableCellCount() {
|
||||
return k_totalNumberOfModels;
|
||||
}
|
||||
|
||||
void Probability::LawController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
void Probability::LawController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
Cell * myCell = (Cell *)cell;
|
||||
myCell->setLabel(m_messages[index]);
|
||||
const Image * images[5] = {ImageStore::BinomialIcon, ImageStore::UniformIcon, ImageStore::ExponentialIcon,
|
||||
|
||||
@@ -16,9 +16,9 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
|
||||
int numberOfRows() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
private:
|
||||
class ContentView : public View {
|
||||
|
||||
@@ -86,8 +86,8 @@ void ParametersController::ContentView::layoutSubviews() {
|
||||
|
||||
ParametersController::ParametersController(Responder * parentResponder) :
|
||||
FloatParameterController(parentResponder),
|
||||
m_menuListCell{EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer),
|
||||
EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer)},
|
||||
m_menuListCell{PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer),
|
||||
PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer)},
|
||||
m_contentView(ContentView(this, &m_selectableTableView)),
|
||||
m_law(nullptr),
|
||||
m_buttonSelected(false),
|
||||
@@ -154,13 +154,13 @@ int ParametersController::numberOfRows() {
|
||||
return m_law->numberOfParameter();
|
||||
};
|
||||
|
||||
void ParametersController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
EditableTextMenuListCell * myCell = (EditableTextMenuListCell *) cell;
|
||||
void ParametersController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
PointerTableCellWithEditableText * myCell = (PointerTableCellWithEditableText *) cell;
|
||||
myCell->setText(m_law->parameterNameAtIndex(index));
|
||||
FloatParameterController::willDisplayCellForIndex(cell, index);
|
||||
}
|
||||
|
||||
TableViewCell * ParametersController::reusableCell(int index) {
|
||||
HighlightCell * ParametersController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < 2);
|
||||
return &m_menuListCell[index];
|
||||
|
||||
@@ -19,8 +19,8 @@ public:
|
||||
StackViewController * stackController();
|
||||
CalculationController * calculationController();
|
||||
int numberOfRows() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
private:
|
||||
float parameterAtIndex(int index) override;
|
||||
@@ -47,8 +47,8 @@ private:
|
||||
SelectableTableView * m_selectableTableView;
|
||||
};
|
||||
constexpr static int k_maxNumberOfCells = 2;
|
||||
char m_draftTextBuffer[EditableTextMenuListCell::k_bufferLength];
|
||||
EditableTextMenuListCell m_menuListCell[k_maxNumberOfCells];
|
||||
char m_draftTextBuffer[PointerTableCellWithEditableText::k_bufferLength];
|
||||
PointerTableCellWithEditableText m_menuListCell[k_maxNumberOfCells];
|
||||
ContentView m_contentView;
|
||||
Law * m_law;
|
||||
bool m_buttonSelected;
|
||||
|
||||
@@ -105,7 +105,7 @@ int CalculationController::numberOfColumns() {
|
||||
return k_totalNumberOfColumns;
|
||||
}
|
||||
|
||||
void CalculationController::willDisplayCellAtLocation(TableViewCell * cell, int i, int j) {
|
||||
void CalculationController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
|
||||
EvenOddCell * myCell = (EvenOddCell *)cell;
|
||||
myCell->setEven(j%2 == 0);
|
||||
myCell->setHighlighted(i == m_selectableTableView.selectedColumn() && j == m_selectableTableView.selectedRow());
|
||||
@@ -176,7 +176,7 @@ int CalculationController::indexFromCumulatedHeight(KDCoordinate offsetY) {
|
||||
return (offsetY-1) / k_cellHeight;
|
||||
}
|
||||
|
||||
TableViewCell * CalculationController::reusableCell(int index, int type) {
|
||||
HighlightCell * CalculationController::reusableCell(int index, int type) {
|
||||
if (type == 0) {
|
||||
assert(index < k_totalNumberOfRows + 2);
|
||||
return &m_titleCells[index];
|
||||
|
||||
@@ -23,14 +23,14 @@ public:
|
||||
|
||||
int numberOfRows() override;
|
||||
int numberOfColumns() override;
|
||||
void willDisplayCellAtLocation(TableViewCell * cell, int i, int j) override;
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
|
||||
KDCoordinate columnWidth(int i) override;
|
||||
KDCoordinate rowHeight(int j) override;
|
||||
KDCoordinate cumulatedWidthFromIndex(int i) override;
|
||||
KDCoordinate cumulatedHeightFromIndex(int j) override;
|
||||
int indexFromCumulatedWidth(KDCoordinate offsetX) override;
|
||||
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
|
||||
TableViewCell * reusableCell(int index, int type) override;
|
||||
HighlightCell * reusableCell(int index, int type) override;
|
||||
int reusableCellCount(int type) override;
|
||||
int typeAtLocation(int i, int j) override;
|
||||
void viewWillAppear() override;
|
||||
|
||||
@@ -29,7 +29,7 @@ void EvenOddDoubleBufferTextCell::reloadCell() {
|
||||
void EvenOddDoubleBufferTextCell::setHighlighted(bool highlight) {
|
||||
m_firstBufferTextView.setHighlighted(false);
|
||||
m_secondBufferTextView.setHighlighted(false);
|
||||
TableViewCell::setHighlighted(highlight);
|
||||
HighlightCell::setHighlighted(highlight);
|
||||
if (isHighlighted()) {
|
||||
if (m_firstTextSelected) {
|
||||
m_firstBufferTextView.setHighlighted(true);
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Regression {
|
||||
|
||||
GoToParameterController::GoToParameterController(Responder * parentResponder, Store * store, CurveViewCursor * cursor) :
|
||||
FloatParameterController(parentResponder),
|
||||
m_abscisseCell(EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer)),
|
||||
m_abscisseCell(PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer)),
|
||||
m_store(store),
|
||||
m_cursor(cursor),
|
||||
m_xPrediction(true)
|
||||
@@ -52,7 +52,7 @@ int GoToParameterController::numberOfRows() {
|
||||
return 1;
|
||||
};
|
||||
|
||||
TableViewCell * GoToParameterController::reusableCell(int index) {
|
||||
HighlightCell * GoToParameterController::reusableCell(int index) {
|
||||
assert(index == 0);
|
||||
return &m_abscisseCell;
|
||||
}
|
||||
@@ -61,8 +61,8 @@ int GoToParameterController::reusableCellCount() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void GoToParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
EditableTextMenuListCell * myCell = (EditableTextMenuListCell *) cell;
|
||||
void GoToParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
PointerTableCellWithEditableText * myCell = (PointerTableCellWithEditableText *) cell;
|
||||
if (m_xPrediction) {
|
||||
myCell->setText("x");
|
||||
} else {
|
||||
|
||||
@@ -14,15 +14,15 @@ public:
|
||||
void setXPrediction(bool xPrediction);
|
||||
const char * title() const override;
|
||||
int numberOfRows() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
bool textFieldDidFinishEditing(TextField * textField, const char * text) override;
|
||||
private:
|
||||
float parameterAtIndex(int index) override;
|
||||
void setParameterAtIndex(int parameterIndex, float f) override;
|
||||
char m_draftTextBuffer[EditableTextMenuListCell::k_bufferLength];
|
||||
EditableTextMenuListCell m_abscisseCell;
|
||||
char m_draftTextBuffer[PointerTableCellWithEditableText::k_bufferLength];
|
||||
PointerTableCellWithEditableText m_abscisseCell;
|
||||
Store * m_store;
|
||||
Shared::CurveViewCursor * m_cursor;
|
||||
bool m_xPrediction;
|
||||
|
||||
@@ -44,7 +44,7 @@ int InitialisationParameterController::numberOfRows() {
|
||||
};
|
||||
|
||||
|
||||
TableViewCell * InitialisationParameterController::reusableCell(int index) {
|
||||
HighlightCell * InitialisationParameterController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCells);
|
||||
return &m_cells[index];
|
||||
@@ -58,8 +58,8 @@ KDCoordinate InitialisationParameterController::cellHeight() {
|
||||
return Metric::ParameterCellHeight;
|
||||
}
|
||||
|
||||
void InitialisationParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
MenuListCell * myCell = (MenuListCell *)cell;
|
||||
void InitialisationParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
PointerTableCell * myCell = (PointerTableCell *)cell;
|
||||
const char * titles[3] = {"Abscisses entieres", "Orthonorme", "Reglage de base"};
|
||||
myCell->setText(titles[index]);
|
||||
}
|
||||
|
||||
@@ -15,12 +15,12 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
int numberOfRows() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
private:
|
||||
constexpr static int k_totalNumberOfCells = 3;
|
||||
MenuListCell m_cells[k_totalNumberOfCells];
|
||||
PointerTableCell m_cells[k_totalNumberOfCells];
|
||||
SelectableTableView m_selectableTableView;
|
||||
Store * m_store;
|
||||
};
|
||||
|
||||
@@ -40,7 +40,7 @@ int PredictionParameterController::numberOfRows() {
|
||||
return k_totalNumberOfCells;
|
||||
};
|
||||
|
||||
TableViewCell * PredictionParameterController::reusableCell(int index) {
|
||||
HighlightCell * PredictionParameterController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCells);
|
||||
return &m_cells[index];
|
||||
@@ -54,8 +54,8 @@ KDCoordinate PredictionParameterController::cellHeight() {
|
||||
return Metric::ParameterCellHeight;
|
||||
}
|
||||
|
||||
void PredictionParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
ChevronMenuListCell * myCell = (ChevronMenuListCell *)cell;
|
||||
void PredictionParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
PointerTableCellWithChevron * myCell = (PointerTableCellWithChevron *)cell;
|
||||
const char * titles[3] = {"Prediction sachant x", "Prediction sachant y"};
|
||||
myCell->setText(titles[index]);
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
int numberOfRows() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
private:
|
||||
constexpr static int k_totalNumberOfCells = 2;
|
||||
ChevronMenuListCell m_cells[2];
|
||||
PointerTableCellWithChevron m_cells[2];
|
||||
SelectableTableView m_selectableTableView;
|
||||
GoToParameterController m_goToParameterController;
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ StoreController::StoreController(Responder * parentResponder, Store * store, Hea
|
||||
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) {
|
||||
void StoreController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
|
||||
::StoreController::willDisplayCellAtLocation(cell, i, j);
|
||||
if (cellAtLocationIsEditable(i, j)) {
|
||||
return;
|
||||
@@ -28,7 +28,7 @@ void StoreController::willDisplayCellAtLocation(TableViewCell * cell, int i, int
|
||||
mytitleCell->setExpression(m_titleLayout[i]);
|
||||
}
|
||||
|
||||
TableViewCell * StoreController::titleCells(int index) {
|
||||
HighlightCell * StoreController::titleCells(int index) {
|
||||
assert(index >= 0 && index < k_numberOfTitleCells);
|
||||
return &m_titleCells[index];
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace Regression {
|
||||
class StoreController : public Shared::StoreController {
|
||||
public:
|
||||
StoreController(Responder * parentResponder, Store * store, HeaderViewController * header);
|
||||
void willDisplayCellAtLocation(TableViewCell * cell, int i, int j) override;
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
|
||||
private:
|
||||
TableViewCell * titleCells(int index) override;
|
||||
HighlightCell * titleCells(int index) override;
|
||||
EvenOddExpressionCell m_titleCells[k_numberOfTitleCells];
|
||||
Poincare::ExpressionLayout * m_titleLayout[2];
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@ ListController::ListController(Responder * parentResponder, SequenceStore * sequ
|
||||
SequenceTitleCell(FunctionTitleCell::Orientation::VerticalIndicator), SequenceTitleCell(FunctionTitleCell::Orientation::VerticalIndicator), SequenceTitleCell(FunctionTitleCell::Orientation::VerticalIndicator), SequenceTitleCell(FunctionTitleCell::Orientation::VerticalIndicator),
|
||||
SequenceTitleCell(FunctionTitleCell::Orientation::VerticalIndicator), SequenceTitleCell(FunctionTitleCell::Orientation::VerticalIndicator)},
|
||||
m_parameterController(ListParameterController(this, sequenceStore)),
|
||||
m_typeParameterController(this, sequenceStore),
|
||||
m_typeParameterController(this, sequenceStore, TableCell::Layout::Vertical),
|
||||
m_typeStackController(StackViewController(nullptr, &m_typeParameterController, true, KDColorWhite, Palette::PurpleDark, Palette::PurpleDark)),
|
||||
m_sequenceToolbox(SequenceToolbox(m_sequenceStore))
|
||||
{
|
||||
@@ -71,7 +71,7 @@ KDCoordinate ListController::rowHeight(int j) {
|
||||
return sequenceSize + defaultHeight - KDText::stringSize(" ").height();
|
||||
}
|
||||
|
||||
void ListController::willDisplayCellAtLocation(TableViewCell * cell, int i, int j) {
|
||||
void ListController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
|
||||
Shared::ListController::willDisplayCellAtLocation(cell, i, j);
|
||||
EvenOddCell * myCell = (EvenOddCell *)cell;
|
||||
myCell->setEven(sequenceIndexForRow(j)%2 == 0);
|
||||
@@ -176,18 +176,18 @@ int ListController::maxNumberOfRows() {
|
||||
return k_maxNumberOfRows;
|
||||
}
|
||||
|
||||
TableViewCell * ListController::titleCells(int index) {
|
||||
HighlightCell * ListController::titleCells(int index) {
|
||||
assert(index >= 0 && index < k_maxNumberOfRows);
|
||||
return &m_sequenceTitleCells[index];
|
||||
}
|
||||
|
||||
TableViewCell * ListController::expressionCells(int index) {
|
||||
HighlightCell * ListController::expressionCells(int index) {
|
||||
assert(index >= 0 && index < k_maxNumberOfRows);
|
||||
return &m_expressionCells[index];
|
||||
}
|
||||
|
||||
|
||||
void ListController::willDisplayTitleCellAtIndex(TableViewCell * cell, int j) {
|
||||
void ListController::willDisplayTitleCellAtIndex(HighlightCell * cell, int j) {
|
||||
SequenceTitleCell * myCell = (SequenceTitleCell *)cell;
|
||||
Sequence * sequence = m_sequenceStore->functionAtIndex(sequenceIndexForRow(j));
|
||||
if (sequenceDefinitionForRow(j) == 0) {
|
||||
@@ -203,7 +203,7 @@ void ListController::willDisplayTitleCellAtIndex(TableViewCell * cell, int j) {
|
||||
myCell->setColor(nameColor);
|
||||
}
|
||||
|
||||
void ListController::willDisplayExpressionCellAtIndex(TableViewCell * cell, int j) {
|
||||
void ListController::willDisplayExpressionCellAtIndex(HighlightCell * cell, int j) {
|
||||
FunctionExpressionCell * myCell = (FunctionExpressionCell *)cell;
|
||||
Sequence * sequence = m_sequenceStore->functionAtIndex(sequenceIndexForRow(j));
|
||||
if (sequenceDefinitionForRow(j) == 0) {
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
const char * title() const override;
|
||||
int numberOfRows() override;
|
||||
virtual KDCoordinate rowHeight(int j) override;
|
||||
void willDisplayCellAtLocation(TableViewCell * cell, int i, int j) override;
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
Toolbox * toolboxForTextField(TextField * textField) override;
|
||||
private:
|
||||
@@ -29,10 +29,10 @@ private:
|
||||
void editExpression(Sequence * sequence, int sequenceDefinitionIndex, Ion::Events::Event event);
|
||||
ListParameterController * parameterController() override;
|
||||
int maxNumberOfRows() override;
|
||||
TableViewCell * titleCells(int index) override;
|
||||
TableViewCell * expressionCells(int index) override;
|
||||
void willDisplayTitleCellAtIndex(TableViewCell * cell, int j) override;
|
||||
void willDisplayExpressionCellAtIndex(TableViewCell * cell, int j) 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;
|
||||
int sequenceIndexForRow(int j);
|
||||
int sequenceDefinitionForRow(int j);
|
||||
static constexpr KDCoordinate k_emptySubRowHeight = 30;
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Sequence {
|
||||
|
||||
ListParameterController::ListParameterController(Responder * parentResponder, SequenceStore * sequenceStore) :
|
||||
Shared::ListParameterController(parentResponder, sequenceStore),
|
||||
m_typeCell(ChevronExpressionMenuListCell((char *)"Type de suite")),
|
||||
m_typeParameterController(TypeParameterController(this, sequenceStore, Metric::TopMargin, Metric::RightMargin,
|
||||
m_typeCell(PointerTableCellWithChevronAndExpression((char *)"Type de suite")),
|
||||
m_typeParameterController(TypeParameterController(this, sequenceStore, TableCell::Layout::Horizontal, Metric::TopMargin, Metric::RightMargin,
|
||||
Metric::BottomMargin, Metric::LeftMargin))
|
||||
{
|
||||
}
|
||||
@@ -44,7 +44,7 @@ int ListParameterController::numberOfRows() {
|
||||
return k_totalNumberOfCell;
|
||||
};
|
||||
|
||||
TableViewCell * ListParameterController::reusableCell(int index) {
|
||||
HighlightCell * ListParameterController::reusableCell(int index) {
|
||||
if (index == 3) {
|
||||
return &m_typeCell;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ int ListParameterController::reusableCellCount() {
|
||||
return k_totalNumberOfCell;
|
||||
}
|
||||
|
||||
void ListParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
void ListParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
Shared::ListParameterController::willDisplayCellForIndex(cell, index);
|
||||
if (cell == &m_typeCell && m_sequence != nullptr) {
|
||||
m_typeCell.setExpression(m_sequence->definitionName());
|
||||
|
||||
@@ -15,12 +15,12 @@ public:
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
void setFunction(Shared::Function * function) override;
|
||||
int numberOfRows() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
private:
|
||||
constexpr static int k_totalNumberOfCell = 4;
|
||||
ChevronExpressionMenuListCell m_typeCell;
|
||||
PointerTableCellWithChevronAndExpression m_typeCell;
|
||||
TypeParameterController m_typeParameterController;
|
||||
Sequence * m_sequence;
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ int SequenceToolbox::numberOfRows() {
|
||||
return MathToolbox::numberOfRows();
|
||||
}
|
||||
|
||||
TableViewCell * SequenceToolbox::reusableCell(int index, int type) {
|
||||
HighlightCell * SequenceToolbox::reusableCell(int index, int type) {
|
||||
assert(type < 3);
|
||||
assert(index >= 0);
|
||||
assert(index < k_maxNumberOfDisplayedRows);
|
||||
@@ -41,9 +41,9 @@ TableViewCell * SequenceToolbox::reusableCell(int index, int type) {
|
||||
return MathToolbox::reusableCell(index, type);
|
||||
}
|
||||
|
||||
void SequenceToolbox::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
void SequenceToolbox::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
if (typeAtLocation(0, index) == 2) {
|
||||
ExpressionMenuListCell * myCell = (ExpressionMenuListCell *)cell;
|
||||
ExpressionTableCell * myCell = (ExpressionTableCell *)cell;
|
||||
myCell->setExpression(m_addedCellLayout[index]);
|
||||
return;
|
||||
} else {
|
||||
|
||||
@@ -11,15 +11,15 @@ public:
|
||||
SequenceToolbox(SequenceStore * sequenceStore);
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
int numberOfRows() override;
|
||||
TableViewCell * reusableCell(int index, int type) override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
HighlightCell * reusableCell(int index, int type) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
KDCoordinate rowHeight(int j) override;
|
||||
int typeAtLocation(int i, int j) override;
|
||||
void addCells(int recurrenceDepth);
|
||||
private:
|
||||
bool selectAddedCell(int selectedRow);
|
||||
constexpr static KDCoordinate k_addedRowHeight = 20;
|
||||
ExpressionMenuListCell m_addedCells[k_maxNumberOfDisplayedRows];
|
||||
ExpressionTableCell m_addedCells[k_maxNumberOfDisplayedRows];
|
||||
Poincare::ExpressionLayout * m_addedCellLayout[k_maxNumberOfDisplayedRows];
|
||||
int m_numberOfAddedCells;
|
||||
SequenceStore * m_sequenceStore;
|
||||
|
||||
@@ -7,12 +7,12 @@ using namespace Poincare;
|
||||
|
||||
namespace Sequence {
|
||||
|
||||
TypeParameterController::TypeParameterController(Responder * parentResponder, SequenceStore * sequenceStore,
|
||||
TypeParameterController::TypeParameterController(Responder * parentResponder, SequenceStore * sequenceStore, TableCell::Layout cellLayout,
|
||||
KDCoordinate topMargin, KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin) :
|
||||
ViewController(parentResponder),
|
||||
m_expliciteCell(TextExpressionMenuListCell((char*)"Explicite")),
|
||||
m_singleRecurrenceCell(TextExpressionMenuListCell((char*)"Recurrence d'ordre 1")),
|
||||
m_doubleRecurenceCell(TextExpressionMenuListCell((char*)"Recurrence d'ordre 2")),
|
||||
m_expliciteCell(ExpressionTableCellWithPointer((char*)"Explicite", cellLayout)),
|
||||
m_singleRecurrenceCell(ExpressionTableCellWithPointer((char*)"Recurrence d'ordre 1", cellLayout)),
|
||||
m_doubleRecurenceCell(ExpressionTableCellWithPointer((char*)"Recurrence d'ordre 2", cellLayout)),
|
||||
m_selectableTableView(SelectableTableView(this, this, topMargin, rightMargin, bottomMargin, leftMargin)),
|
||||
m_sequenceStore(sequenceStore),
|
||||
m_sequence(nullptr)
|
||||
@@ -65,10 +65,10 @@ int TypeParameterController::numberOfRows() {
|
||||
return k_totalNumberOfCell;
|
||||
};
|
||||
|
||||
TableViewCell * TypeParameterController::reusableCell(int index) {
|
||||
HighlightCell * TypeParameterController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCell);
|
||||
TableViewCell * cells[] = {&m_expliciteCell, &m_singleRecurrenceCell, &m_doubleRecurenceCell};
|
||||
HighlightCell * cells[] = {&m_expliciteCell, &m_singleRecurrenceCell, &m_doubleRecurenceCell};
|
||||
return cells[index];
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ KDCoordinate TypeParameterController::cellHeight() {
|
||||
return 50;
|
||||
}
|
||||
|
||||
void TypeParameterController::willDisplayCellAtLocation(TableViewCell * cell, int i, int j) {
|
||||
void TypeParameterController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
|
||||
const char * nextName = m_sequenceStore->firstAvailableName();
|
||||
KDText::FontSize size = KDText::FontSize::Large;
|
||||
if (m_sequence) {
|
||||
@@ -96,7 +96,7 @@ void TypeParameterController::willDisplayCellAtLocation(TableViewCell * cell, in
|
||||
m_expressionLayouts[j] = nullptr;
|
||||
}
|
||||
m_expressionLayouts[j] = new BaselineRelativeLayout(new StringLayout(nextName, 1, size), new StringLayout(subscripts[j], strlen(subscripts[j]), KDText::FontSize::Small), BaselineRelativeLayout::Type::Subscript);
|
||||
TextExpressionMenuListCell * myCell = (TextExpressionMenuListCell *)cell;
|
||||
ExpressionTableCellWithPointer * myCell = (ExpressionTableCellWithPointer *)cell;
|
||||
myCell->setExpression(m_expressionLayouts[j]);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ namespace Sequence {
|
||||
class TypeParameterController : public ViewController, public SimpleListViewDataSource {
|
||||
public:
|
||||
TypeParameterController(Responder * parentResponder, SequenceStore * sequenceStore,
|
||||
KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0, KDCoordinate bottomMargin = 0,
|
||||
KDCoordinate leftMargin = 0);
|
||||
TableCell::Layout cellLayout, KDCoordinate topMargin = 0, KDCoordinate rightMargin = 0,
|
||||
KDCoordinate bottomMargin = 0, KDCoordinate leftMargin = 0);
|
||||
~TypeParameterController();
|
||||
const char * title() const override;
|
||||
View * view() override;
|
||||
@@ -18,16 +18,16 @@ public:
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
int numberOfRows() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void willDisplayCellAtLocation(TableViewCell * cell, int i, int j) override;
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
|
||||
void setSequence(Sequence * sequence);
|
||||
private:
|
||||
StackViewController * stackController() const;
|
||||
constexpr static int k_totalNumberOfCell = 3;
|
||||
TextExpressionMenuListCell m_expliciteCell;
|
||||
TextExpressionMenuListCell m_singleRecurrenceCell;
|
||||
TextExpressionMenuListCell m_doubleRecurenceCell;
|
||||
ExpressionTableCellWithPointer m_expliciteCell;
|
||||
ExpressionTableCellWithPointer m_singleRecurrenceCell;
|
||||
ExpressionTableCellWithPointer m_doubleRecurenceCell;
|
||||
Poincare::ExpressionLayout * m_expressionLayouts[k_totalNumberOfCell];
|
||||
SelectableTableView m_selectableTableView;
|
||||
SequenceStore * m_sequenceStore;
|
||||
|
||||
@@ -20,8 +20,8 @@ const SettingsNode model = SettingsNode("Parametres", menu, 5);
|
||||
|
||||
MainController::MainController(Responder * parentResponder) :
|
||||
ViewController(parentResponder),
|
||||
m_cells{ChevronTextMenuListCell(KDText::FontSize::Large), ChevronTextMenuListCell(KDText::FontSize::Large), ChevronTextMenuListCell(KDText::FontSize::Large),
|
||||
ChevronTextMenuListCell(KDText::FontSize::Large), ChevronTextMenuListCell(KDText::FontSize::Large)},
|
||||
m_cells{PointerTableCellWithChevronAndPointer(KDText::FontSize::Large), PointerTableCellWithChevronAndPointer(KDText::FontSize::Large), PointerTableCellWithChevronAndPointer(KDText::FontSize::Large),
|
||||
PointerTableCellWithChevronAndPointer(KDText::FontSize::Large), PointerTableCellWithChevronAndPointer(KDText::FontSize::Large)},
|
||||
m_selectableTableView(SelectableTableView(this, this, Metric::TopMargin, Metric::RightMargin,
|
||||
Metric::BottomMargin, Metric::LeftMargin)),
|
||||
m_nodeModel((Node *)&model),
|
||||
@@ -57,7 +57,7 @@ int MainController::numberOfRows() {
|
||||
return m_nodeModel->numberOfChildren();
|
||||
};
|
||||
|
||||
TableViewCell * MainController::reusableCell(int index) {
|
||||
HighlightCell * MainController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCell);
|
||||
return &m_cells[index];
|
||||
@@ -71,8 +71,8 @@ KDCoordinate MainController::cellHeight() {
|
||||
return Metric::ParameterCellHeight;
|
||||
}
|
||||
|
||||
void MainController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
ChevronTextMenuListCell * myCell = (ChevronTextMenuListCell *)cell;
|
||||
void MainController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
PointerTableCellWithChevronAndPointer * myCell = (PointerTableCellWithChevronAndPointer *)cell;
|
||||
myCell->setText(m_nodeModel->children(index)->label());
|
||||
switch (index) {
|
||||
case 0:
|
||||
|
||||
@@ -17,14 +17,14 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
int numberOfRows() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
void viewWillAppear() override;
|
||||
private:
|
||||
StackViewController * stackController() const;
|
||||
constexpr static int k_totalNumberOfCell = 5;
|
||||
ChevronTextMenuListCell m_cells[k_totalNumberOfCell];
|
||||
PointerTableCellWithChevronAndPointer m_cells[k_totalNumberOfCell];
|
||||
SelectableTableView m_selectableTableView;
|
||||
Node * m_nodeModel;
|
||||
SubController m_subController;
|
||||
|
||||
@@ -9,8 +9,8 @@ namespace Settings {
|
||||
|
||||
SubController::SubController(Responder * parentResponder) :
|
||||
ViewController(parentResponder),
|
||||
m_cells{MenuListCell(nullptr, KDText::FontSize::Large), MenuListCell(nullptr, KDText::FontSize::Large),
|
||||
MenuListCell(nullptr, KDText::FontSize::Large)},
|
||||
m_cells{PointerTableCell(nullptr, KDText::FontSize::Large), PointerTableCell(nullptr, KDText::FontSize::Large),
|
||||
PointerTableCell(nullptr, KDText::FontSize::Large)},
|
||||
m_selectableTableView(SelectableTableView(this, this, Metric::TopMargin, Metric::RightMargin,
|
||||
Metric::BottomMargin, Metric::LeftMargin)),
|
||||
m_nodeModel(nullptr),
|
||||
@@ -52,7 +52,7 @@ int SubController::numberOfRows() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
TableViewCell * SubController::reusableCell(int index) {
|
||||
HighlightCell * SubController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCell);
|
||||
return &m_cells[index];
|
||||
@@ -66,8 +66,8 @@ KDCoordinate SubController::cellHeight() {
|
||||
return Metric::ParameterCellHeight;
|
||||
}
|
||||
|
||||
void SubController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
MenuListCell * myCell = (MenuListCell *)cell;
|
||||
void SubController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
PointerTableCell * myCell = (PointerTableCell *)cell;
|
||||
myCell->setText(m_nodeModel->children(index)->label());
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
int numberOfRows() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
void setNodeModel(const Node * nodeModel, int preferenceIndex);
|
||||
void viewWillAppear() override;
|
||||
private:
|
||||
@@ -25,7 +25,7 @@ private:
|
||||
void setPreferenceAtIndexWithValueIndex(int preferenceIndex, int valueIndex);
|
||||
int valueIndexAtPreferenceIndex(int preferenceIndex);
|
||||
constexpr static int k_totalNumberOfCell = 3;
|
||||
MenuListCell m_cells[k_totalNumberOfCell];
|
||||
PointerTableCell m_cells[k_totalNumberOfCell];
|
||||
SelectableTableView m_selectableTableView;
|
||||
Node * m_nodeModel;
|
||||
int m_preferenceIndex;
|
||||
|
||||
@@ -62,7 +62,7 @@ int EditableCellTableViewController::indexFromCumulatedHeight(KDCoordinate offse
|
||||
return (offsetY-1) / k_cellHeight;
|
||||
}
|
||||
|
||||
void EditableCellTableViewController::willDisplayCellAtLocationWithDisplayMode(TableViewCell * cell, int i, int j, Expression::FloatDisplayMode floatDisplayMode) {
|
||||
void EditableCellTableViewController::willDisplayCellAtLocationWithDisplayMode(HighlightCell * cell, int i, int j, Expression::FloatDisplayMode floatDisplayMode) {
|
||||
EvenOddCell * myCell = (EvenOddCell *)cell;
|
||||
myCell->setEven(j%2 == 0);
|
||||
// The cell is editable
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
|
||||
|
||||
int numberOfRows() override;
|
||||
void willDisplayCellAtLocationWithDisplayMode(TableViewCell * cell, int i, int j, Poincare::Expression::FloatDisplayMode FloatDisplayMode);
|
||||
void willDisplayCellAtLocationWithDisplayMode(HighlightCell * cell, int i, int j, Poincare::Expression::FloatDisplayMode FloatDisplayMode);
|
||||
KDCoordinate rowHeight(int j) override;
|
||||
KDCoordinate cumulatedHeightFromIndex(int j) override;
|
||||
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
|
||||
|
||||
@@ -28,8 +28,8 @@ int FloatParameterController::activeCell() {
|
||||
return m_selectableTableView.selectedRow();
|
||||
}
|
||||
|
||||
void FloatParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
EditableTextMenuListCell * myCell = (EditableTextMenuListCell *) cell;
|
||||
void FloatParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
PointerTableCellWithEditableText * myCell = (PointerTableCellWithEditableText *) cell;
|
||||
char buffer[Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits)];
|
||||
Complex::convertFloatToText(parameterAtIndex(index), buffer, Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, Expression::FloatDisplayMode::Decimal);
|
||||
myCell->setAccessoryText(buffer);
|
||||
@@ -46,9 +46,9 @@ bool FloatParameterController::textFieldDidFinishEditing(TextField * textField,
|
||||
}
|
||||
|
||||
void FloatParameterController::tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) {
|
||||
EditableTextMenuListCell * myCell = (EditableTextMenuListCell *)t->cellAtLocation(previousSelectedCellX, previousSelectedCellY);
|
||||
PointerTableCellWithEditableText * myCell = (PointerTableCellWithEditableText *)t->cellAtLocation(previousSelectedCellX, previousSelectedCellY);
|
||||
myCell->setEditing(false);
|
||||
EditableTextMenuListCell * myNewCell = (EditableTextMenuListCell *)t->cellAtLocation(t->selectedColumn(), t->selectedRow());
|
||||
PointerTableCellWithEditableText * myNewCell = (PointerTableCellWithEditableText *)t->cellAtLocation(t->selectedColumn(), t->selectedRow());
|
||||
app()->setFirstResponder(myNewCell);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
View * view() override;
|
||||
void didBecomeFirstResponder() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
bool textFieldDidFinishEditing(TextField * textField, const char * text) override;
|
||||
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
|
||||
protected:
|
||||
|
||||
@@ -83,7 +83,7 @@ int ListController::typeAtLocation(int i, int j) {
|
||||
return i;
|
||||
}
|
||||
|
||||
TableViewCell * ListController::reusableCell(int index, int type) {
|
||||
HighlightCell * ListController::reusableCell(int index, int type) {
|
||||
assert(index >= 0);
|
||||
assert(index < maxNumberOfRows());
|
||||
switch (type) {
|
||||
@@ -108,7 +108,7 @@ int ListController::reusableCellCount(int type) {
|
||||
return maxNumberOfRows();
|
||||
}
|
||||
|
||||
void ListController::willDisplayCellAtLocation(TableViewCell * cell, int i, int j) {
|
||||
void ListController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
|
||||
if (j < numberOfRows() - 1 || m_functionStore->numberOfFunctions() == m_functionStore->maxNumberOfFunctions()) {
|
||||
if (i == 0) {
|
||||
willDisplayTitleCellAtIndex(cell, j);
|
||||
|
||||
@@ -19,9 +19,9 @@ public:
|
||||
int indexFromCumulatedWidth(KDCoordinate offsetX) override;
|
||||
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
|
||||
int typeAtLocation(int i, int j) override;
|
||||
TableViewCell * reusableCell(int index, int type) override;
|
||||
HighlightCell * reusableCell(int index, int type) override;
|
||||
int reusableCellCount(int type) override;
|
||||
void willDisplayCellAtLocation(TableViewCell * cell, int i, int j) override;
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
|
||||
void didBecomeFirstResponder() override;
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
void viewWillAppear() override;
|
||||
@@ -36,10 +36,10 @@ private:
|
||||
Responder * tabController() const;
|
||||
virtual ListParameterController * parameterController() = 0;
|
||||
virtual int maxNumberOfRows() = 0;
|
||||
virtual TableViewCell * titleCells(int index) = 0;
|
||||
virtual TableViewCell * expressionCells(int index) = 0;
|
||||
virtual void willDisplayTitleCellAtIndex(TableViewCell * cell, int j) = 0;
|
||||
virtual void willDisplayExpressionCellAtIndex(TableViewCell * cell, int j) = 0;
|
||||
virtual HighlightCell * titleCells(int index) = 0;
|
||||
virtual HighlightCell * expressionCells(int index) = 0;
|
||||
virtual void willDisplayTitleCellAtIndex(HighlightCell * cell, int j) = 0;
|
||||
virtual void willDisplayExpressionCellAtIndex(HighlightCell * cell, int j) = 0;
|
||||
EvenOddCell m_emptyCell;
|
||||
NewFunctionCell m_addNewFunction;
|
||||
};
|
||||
|
||||
@@ -8,9 +8,9 @@ ListParameterController::ListParameterController(Responder * parentResponder, Fu
|
||||
m_selectableTableView(SelectableTableView(this, this, Metric::TopMargin, Metric::RightMargin,
|
||||
Metric::BottomMargin, Metric::LeftMargin)),
|
||||
m_functionStore(functionStore),
|
||||
m_colorCell(ChevronMenuListCell((char*)"Couleur de la fonction")),
|
||||
m_enableCell(SwitchMenuListCell((char*)"Activer/Desactiver")),
|
||||
m_deleteCell(MenuListCell((char*)"Supprimer la fonction"))
|
||||
m_colorCell(PointerTableCellWithChevron((char*)"Couleur de la fonction")),
|
||||
m_enableCell(PointerTableCellWithSwitch((char*)"Activer/Desactiver")),
|
||||
m_deleteCell(PointerTableCell((char*)"Supprimer la fonction"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ void ListParameterController::didBecomeFirstResponder() {
|
||||
app()->setFirstResponder(&m_selectableTableView);
|
||||
}
|
||||
|
||||
void ListParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
void ListParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
if (cell == &m_enableCell) {
|
||||
SwitchView * switchView = (SwitchView *)m_enableCell.accessoryView();
|
||||
switchView->setState(m_function->isActive());
|
||||
@@ -83,10 +83,10 @@ int ListParameterController::numberOfRows() {
|
||||
return k_totalNumberOfCell;
|
||||
};
|
||||
|
||||
TableViewCell * ListParameterController::reusableCell(int index) {
|
||||
HighlightCell * ListParameterController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCell);
|
||||
TableViewCell * cells[] = {&m_colorCell, &m_enableCell, &m_deleteCell};
|
||||
HighlightCell * cells[] = {&m_colorCell, &m_enableCell, &m_deleteCell};
|
||||
return cells[index];
|
||||
}
|
||||
|
||||
|
||||
@@ -18,18 +18,18 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
int numberOfRows() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
protected:
|
||||
SelectableTableView m_selectableTableView;
|
||||
FunctionStore * m_functionStore;
|
||||
Function * m_function;
|
||||
private:
|
||||
constexpr static int k_totalNumberOfCell = 3;
|
||||
ChevronMenuListCell m_colorCell;
|
||||
SwitchMenuListCell m_enableCell;
|
||||
MenuListCell m_deleteCell;
|
||||
PointerTableCellWithChevron m_colorCell;
|
||||
PointerTableCellWithSwitch m_enableCell;
|
||||
PointerTableCell m_deleteCell;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace Shared {
|
||||
RangeParameterController::RangeParameterController(Responder * parentResponder, InteractiveCurveViewRange * interactiveRange) :
|
||||
FloatParameterController(parentResponder),
|
||||
m_interactiveRange(interactiveRange),
|
||||
m_rangeCells{EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer, (char *)"Xmin"), EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer, (char *)"Xmax"),
|
||||
EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer, (char *)"Ymin"), EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer, (char *)"Ymax")},
|
||||
m_yAutoCell(SwitchMenuListCell((char*)"Y auto"))
|
||||
m_rangeCells{PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer, (char *)"Xmin"), PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer, (char *)"Xmax"),
|
||||
PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer, (char *)"Ymin"), PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer, (char *)"Ymax")},
|
||||
m_yAutoCell(PointerTableCellWithSwitch((char*)"Y auto"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ const char * RangeParameterController::title() const {
|
||||
return "Axes";
|
||||
}
|
||||
|
||||
void RangeParameterController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
void RangeParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
if (index == 2) {
|
||||
SwitchView * switchView = (SwitchView *)m_yAutoCell.accessoryView();
|
||||
switchView->setState(m_interactiveRange->yAuto());
|
||||
@@ -49,12 +49,12 @@ bool RangeParameterController::textFieldDidFinishEditing(TextField * textField,
|
||||
|
||||
void RangeParameterController::tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) {
|
||||
if (previousSelectedCellX == 0 && previousSelectedCellY >= 0 && previousSelectedCellY !=2) {
|
||||
EditableTextMenuListCell * myCell = (EditableTextMenuListCell *)t->cellAtLocation(previousSelectedCellX, previousSelectedCellY);
|
||||
PointerTableCellWithEditableText * myCell = (PointerTableCellWithEditableText *)t->cellAtLocation(previousSelectedCellX, previousSelectedCellY);
|
||||
myCell->setEditing(false);
|
||||
app()->setFirstResponder(t);
|
||||
}
|
||||
if (t->selectedColumn() == 0 && t->selectedRow() >= 0 && t->selectedRow() !=2) {
|
||||
EditableTextMenuListCell * myNewCell = (EditableTextMenuListCell *)t->cellAtLocation(t->selectedColumn(), t->selectedRow());
|
||||
PointerTableCellWithEditableText * myNewCell = (PointerTableCellWithEditableText *)t->cellAtLocation(t->selectedColumn(), t->selectedRow());
|
||||
if ((t->selectedRow() == 0 || t->selectedRow() == 1) || !m_interactiveRange->yAuto()) {
|
||||
app()->setFirstResponder(myNewCell);
|
||||
}
|
||||
@@ -94,7 +94,7 @@ int RangeParameterController::numberOfRows() {
|
||||
return k_numberOfTextCell+1;
|
||||
};
|
||||
|
||||
TableViewCell * RangeParameterController::reusableCell(int index) {
|
||||
HighlightCell * RangeParameterController::reusableCell(int index) {
|
||||
if (index == 2) {
|
||||
return &m_yAutoCell;
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ public:
|
||||
RangeParameterController(Responder * parentResponder, InteractiveCurveViewRange * interactiveCurveViewRange);
|
||||
const char * title() const override;
|
||||
int numberOfRows() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
bool textFieldDidFinishEditing(TextField * textField, const char * text) override;
|
||||
void tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) override;
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
@@ -23,9 +23,9 @@ private:
|
||||
void setParameterAtIndex(int parameterIndex, float f) override;
|
||||
constexpr static int k_numberOfTextCell = 4;
|
||||
InteractiveCurveViewRange * m_interactiveRange;
|
||||
char m_draftTextBuffer[EditableTextMenuListCell::k_bufferLength];
|
||||
EditableTextMenuListCell m_rangeCells[k_numberOfTextCell];
|
||||
SwitchMenuListCell m_yAutoCell;
|
||||
char m_draftTextBuffer[PointerTableCellWithEditableText::k_bufferLength];
|
||||
PointerTableCellWithEditableText m_rangeCells[k_numberOfTextCell];
|
||||
PointerTableCellWithSwitch m_yAutoCell;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ int StoreController::indexFromCumulatedWidth(KDCoordinate offsetX) {
|
||||
return (offsetX-1) / k_cellWidth;
|
||||
}
|
||||
|
||||
TableViewCell * StoreController::reusableCell(int index, int type) {
|
||||
HighlightCell * StoreController::reusableCell(int index, int type) {
|
||||
assert(index >= 0);
|
||||
switch (type) {
|
||||
case 0:
|
||||
@@ -66,7 +66,7 @@ int StoreController::typeAtLocation(int i, int j) {
|
||||
return j!=0;
|
||||
}
|
||||
|
||||
void StoreController::willDisplayCellAtLocation(TableViewCell * cell, int i, int j) {
|
||||
void StoreController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
|
||||
willDisplayCellAtLocationWithDisplayMode(cell, i, j, Expression::FloatDisplayMode::Decimal);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@ public:
|
||||
KDCoordinate columnWidth(int i) override;
|
||||
KDCoordinate cumulatedWidthFromIndex(int i) override;
|
||||
int indexFromCumulatedWidth(KDCoordinate offsetX) override;
|
||||
TableViewCell * reusableCell(int index, int type) override;
|
||||
HighlightCell * reusableCell(int index, int type) override;
|
||||
int reusableCellCount(int type) override;
|
||||
int typeAtLocation(int i, int j) override;
|
||||
void willDisplayCellAtLocation(TableViewCell * cell, int i, int j) override;
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
protected:
|
||||
static constexpr KDCoordinate k_cellWidth = Ion::Display::Width/2 - Metric::RightMargin/2 - Metric::LeftMargin/2;
|
||||
@@ -31,7 +31,7 @@ protected:
|
||||
float dataAtLocation(int columnIndex, int rowIndex) override;
|
||||
int numberOfElements() override;
|
||||
int maxNumberOfElements() const override;
|
||||
virtual TableViewCell * titleCells(int index) = 0;
|
||||
virtual HighlightCell * titleCells(int index) = 0;
|
||||
char m_draftTextBuffer[EditableTextCell::k_bufferLength];
|
||||
EvenOddEditableTextCell m_editableCells[k_maxNumberOfEditableCells];
|
||||
FloatPairStore * m_store;
|
||||
|
||||
@@ -5,9 +5,9 @@ namespace Shared {
|
||||
|
||||
StoreParameterController::StoreParameterController(Responder * parentResponder, FloatPairStore * store) :
|
||||
ViewController(parentResponder),
|
||||
m_deleteColumn(MenuListCell((char*)"Effacer la colonne")),
|
||||
m_copyColumn(ChevronMenuListCell((char*)"Copier la colonne dans une liste")),
|
||||
m_importList(ChevronMenuListCell((char*)"Importer une liste")),
|
||||
m_deleteColumn(PointerTableCell((char*)"Effacer la colonne")),
|
||||
m_copyColumn(PointerTableCellWithChevron((char*)"Copier la colonne dans une liste")),
|
||||
m_importList(PointerTableCellWithChevron((char*)"Importer une liste")),
|
||||
m_selectableTableView(SelectableTableView(this, this, Metric::TopMargin, Metric::RightMargin,
|
||||
Metric::BottomMargin, Metric::LeftMargin)),
|
||||
m_store(store),
|
||||
@@ -62,10 +62,10 @@ int StoreParameterController::numberOfRows() {
|
||||
return k_totalNumberOfCell;
|
||||
};
|
||||
|
||||
TableViewCell * StoreParameterController::reusableCell(int index) {
|
||||
HighlightCell * StoreParameterController::reusableCell(int index) {
|
||||
assert(index >= 0);
|
||||
assert(index < k_totalNumberOfCell);
|
||||
TableViewCell * cells[] = {&m_deleteColumn, &m_copyColumn, &m_importList};
|
||||
HighlightCell * cells[] = {&m_deleteColumn, &m_copyColumn, &m_importList};
|
||||
return cells[index];
|
||||
}
|
||||
|
||||
|
||||
@@ -16,13 +16,13 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
int numberOfRows() override;
|
||||
KDCoordinate cellHeight() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
private:
|
||||
constexpr static int k_totalNumberOfCell = 3;
|
||||
MenuListCell m_deleteColumn;
|
||||
ChevronMenuListCell m_copyColumn;
|
||||
ChevronMenuListCell m_importList;
|
||||
PointerTableCell m_deleteColumn;
|
||||
PointerTableCellWithChevron m_copyColumn;
|
||||
PointerTableCellWithChevron m_importList;
|
||||
SelectableTableView m_selectableTableView;
|
||||
FloatPairStore * m_store;
|
||||
bool m_xColumnSelected;
|
||||
|
||||
@@ -74,7 +74,7 @@ int CalculationController::numberOfColumns() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
void CalculationController::willDisplayCellAtLocation(TableViewCell * cell, int i, int j) {
|
||||
void CalculationController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
|
||||
EvenOddCell * myCell = (EvenOddCell *)cell;
|
||||
myCell->setEven(j%2 == 0);
|
||||
myCell->setHighlighted(i == m_selectableTableView.selectedColumn() && j == m_selectableTableView.selectedRow());
|
||||
@@ -120,7 +120,7 @@ int CalculationController::indexFromCumulatedHeight(KDCoordinate offsetY) {
|
||||
return (offsetY-1) / k_cellHeight;
|
||||
}
|
||||
|
||||
TableViewCell * CalculationController::reusableCell(int index, int type) {
|
||||
HighlightCell * CalculationController::reusableCell(int index, int type) {
|
||||
assert(index < k_totalNumberOfRows);
|
||||
if (type == 0) {
|
||||
return &m_titleCells[index];
|
||||
|
||||
@@ -21,14 +21,14 @@ public:
|
||||
|
||||
int numberOfRows() override;
|
||||
int numberOfColumns() override;
|
||||
void willDisplayCellAtLocation(TableViewCell * cell, int i, int j) override;
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
|
||||
KDCoordinate columnWidth(int i) override;
|
||||
KDCoordinate rowHeight(int j) override;
|
||||
KDCoordinate cumulatedWidthFromIndex(int i) override;
|
||||
KDCoordinate cumulatedHeightFromIndex(int j) override;
|
||||
int indexFromCumulatedWidth(KDCoordinate offsetX) override;
|
||||
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
|
||||
TableViewCell * reusableCell(int index, int type) override;
|
||||
HighlightCell * reusableCell(int index, int type) override;
|
||||
int reusableCellCount(int type) override;
|
||||
int typeAtLocation(int i, int j) override;
|
||||
void viewWillAppear() override;
|
||||
|
||||
@@ -8,8 +8,8 @@ namespace Statistics {
|
||||
|
||||
HistogramParameterController::HistogramParameterController(Responder * parentResponder, Store * store) :
|
||||
FloatParameterController(parentResponder),
|
||||
m_binWidthCell(EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer, (char*)"Largeur des rectanges : ")),
|
||||
m_minValueCell(EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer, (char*)"Debut de la serie : ")),
|
||||
m_binWidthCell(PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer, (char*)"Largeur des rectanges : ")),
|
||||
m_minValueCell(PointerTableCellWithEditableText(&m_selectableTableView, this, m_draftTextBuffer, (char*)"Debut de la serie : ")),
|
||||
m_store(store)
|
||||
{
|
||||
}
|
||||
@@ -43,7 +43,7 @@ int HistogramParameterController::numberOfRows() {
|
||||
return 2;
|
||||
};
|
||||
|
||||
TableViewCell * HistogramParameterController::reusableCell(int index) {
|
||||
HighlightCell * HistogramParameterController::reusableCell(int index) {
|
||||
assert(index >= 0 && index < 2);
|
||||
if (index == 0) {
|
||||
return &m_binWidthCell;
|
||||
|
||||
@@ -12,14 +12,14 @@ public:
|
||||
HistogramParameterController(Responder * parentResponder, Store * store);
|
||||
const char * title() const override;
|
||||
int numberOfRows() override;
|
||||
TableViewCell * reusableCell(int index) override;
|
||||
HighlightCell * reusableCell(int index) override;
|
||||
int reusableCellCount() override;
|
||||
private:
|
||||
float parameterAtIndex(int index) override;
|
||||
void setParameterAtIndex(int parameterIndex, float f) override;
|
||||
char m_draftTextBuffer[EditableTextMenuListCell::k_bufferLength];
|
||||
EditableTextMenuListCell m_binWidthCell;
|
||||
EditableTextMenuListCell m_minValueCell;
|
||||
char m_draftTextBuffer[PointerTableCellWithEditableText::k_bufferLength];
|
||||
PointerTableCellWithEditableText m_binWidthCell;
|
||||
PointerTableCellWithEditableText m_minValueCell;
|
||||
Store * m_store;
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ StoreController::StoreController(Responder * parentResponder, Store * store, Hea
|
||||
{
|
||||
}
|
||||
|
||||
void StoreController::willDisplayCellAtLocation(TableViewCell * cell, int i, int j) {
|
||||
void StoreController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
|
||||
::StoreController::willDisplayCellAtLocation(cell, i, j);
|
||||
if (cellAtLocationIsEditable(i, j)) {
|
||||
return;
|
||||
@@ -27,7 +27,7 @@ void StoreController::willDisplayCellAtLocation(TableViewCell * cell, int i, int
|
||||
mytitleCell->setText("Effectifs");
|
||||
}
|
||||
|
||||
TableViewCell * StoreController::titleCells(int index) {
|
||||
HighlightCell * StoreController::titleCells(int index) {
|
||||
assert(index >= 0 && index < k_numberOfTitleCells);
|
||||
return &m_titleCells[index];
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ namespace Statistics {
|
||||
class StoreController : public Shared::StoreController {
|
||||
public:
|
||||
StoreController(Responder * parentResponder, Store * store, HeaderViewController * header);
|
||||
void willDisplayCellAtLocation(TableViewCell * cell, int i, int j) override;
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
|
||||
private:
|
||||
TableViewCell * titleCells(int index) override;
|
||||
HighlightCell * titleCells(int index) override;
|
||||
EvenOddPointerTextCell m_titleCells[k_numberOfTitleCells];
|
||||
};
|
||||
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#include "toolbox_leaf_cell.h"
|
||||
#include <assert.h>
|
||||
|
||||
ToolboxLeafCell::ToolboxLeafCell() :
|
||||
TableViewCell(),
|
||||
m_labelView(PointerTextView(KDText::FontSize::Small, nullptr, 0, 0.5, KDColorBlack, KDColorWhite)),
|
||||
m_subtitleView(PointerTextView(KDText::FontSize::Small, nullptr, 0, 0.5, Palette::GreyDark, KDColorWhite))
|
||||
{
|
||||
}
|
||||
|
||||
int ToolboxLeafCell::numberOfSubviews() const {
|
||||
return 2;
|
||||
}
|
||||
|
||||
View * ToolboxLeafCell::subviewAtIndex(int index) {
|
||||
assert(index == 0 || index == 1);
|
||||
if (index == 0) {
|
||||
return &m_labelView;
|
||||
}
|
||||
return &m_subtitleView;
|
||||
}
|
||||
|
||||
void ToolboxLeafCell::layoutSubviews() {
|
||||
KDCoordinate width = bounds().width();
|
||||
KDCoordinate height = bounds().height();
|
||||
m_labelView.setFrame(KDRect(1, 1, width-2, height/2 - 1));
|
||||
m_subtitleView.setFrame(KDRect(1, height/2, width-2, height/2 - 1));
|
||||
}
|
||||
|
||||
void ToolboxLeafCell::reloadCell() {
|
||||
TableViewCell::reloadCell();
|
||||
KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite;
|
||||
m_labelView.setBackgroundColor(backgroundColor);
|
||||
m_subtitleView.setBackgroundColor(backgroundColor);
|
||||
}
|
||||
|
||||
void ToolboxLeafCell::setLabel(const char * text) {
|
||||
m_labelView.setText(text);
|
||||
}
|
||||
|
||||
void ToolboxLeafCell::setSubtitle(const char * text) {
|
||||
m_subtitleView.setText(text);
|
||||
}
|
||||
|
||||
void ToolboxLeafCell::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
KDCoordinate width = bounds().width();
|
||||
KDCoordinate height = bounds().height();
|
||||
KDColor backgroundColor = isHighlighted() ? Palette::Select : KDColorWhite;
|
||||
ctx->fillRect(KDRect(1, 0, width-2, height-1), backgroundColor);
|
||||
ctx->fillRect(KDRect(0, height-1, width, 1), Palette::GreyBright);
|
||||
ctx->fillRect(KDRect(0, 0, 1, height-1), Palette::GreyBright);
|
||||
ctx->fillRect(KDRect(width-1, 0, 1, height-1), Palette::GreyBright);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#ifndef APPS_TOOLBOX_LEAF_CELL_H
|
||||
#define APPS_TOOLBOX_LEAF_CELL_H
|
||||
|
||||
#include <escher.h>
|
||||
|
||||
class ToolboxLeafCell : public TableViewCell {
|
||||
public:
|
||||
ToolboxLeafCell();
|
||||
void reloadCell() override;
|
||||
void setLabel(const char * text);
|
||||
void setSubtitle(const char * text);
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
private:
|
||||
int numberOfSubviews() const override;
|
||||
View * subviewAtIndex(int index) override;
|
||||
void layoutSubviews() override;
|
||||
PointerTextView m_labelView;
|
||||
PointerTextView m_subtitleView;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -84,7 +84,7 @@ int VariableBoxController::ContentViewController::numberOfRows() {
|
||||
}
|
||||
}
|
||||
|
||||
TableViewCell * VariableBoxController::ContentViewController::reusableCell(int index, int type) {
|
||||
HighlightCell * VariableBoxController::ContentViewController::reusableCell(int index, int type) {
|
||||
assert(type < 2);
|
||||
assert(index >= 0);
|
||||
if (type == 0) {
|
||||
@@ -103,10 +103,10 @@ int VariableBoxController::ContentViewController::reusableCellCount(int type) {
|
||||
return k_numberOfMenuRows;
|
||||
}
|
||||
|
||||
void VariableBoxController::ContentViewController::willDisplayCellForIndex(TableViewCell * cell, int index) {
|
||||
void VariableBoxController::ContentViewController::willDisplayCellForIndex(HighlightCell * cell, int index) {
|
||||
if (m_currentPage == Page::RootMenu) {
|
||||
const char * label = nodeLabelAtIndex(index);
|
||||
MenuListCell * myCell = (MenuListCell *)cell;
|
||||
PointerTableCell * myCell = (PointerTableCell *)cell;
|
||||
myCell->setText(label);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ private:
|
||||
void didBecomeFirstResponder() override;
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
int numberOfRows() override;
|
||||
TableViewCell * reusableCell(int index, int type) override;
|
||||
HighlightCell * reusableCell(int index, int type) override;
|
||||
int reusableCellCount(int type) override;
|
||||
void willDisplayCellForIndex(TableViewCell * cell, int index) override;
|
||||
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
|
||||
KDCoordinate rowHeight(int j) override;
|
||||
KDCoordinate cumulatedHeightFromIndex(int j) override;
|
||||
int indexFromCumulatedHeight(KDCoordinate offsetY) override;
|
||||
@@ -51,7 +51,7 @@ private:
|
||||
int m_previousSelectedRow;
|
||||
Page m_currentPage;
|
||||
VariableBoxLeafCell m_leafCells[k_maxNumberOfDisplayedRows];
|
||||
ChevronMenuListCell m_nodeCells[k_numberOfMenuRows];
|
||||
PointerTableCellWithChevron m_nodeCells[k_numberOfMenuRows];
|
||||
SelectableTableView m_selectableTableView;
|
||||
};
|
||||
ContentViewController m_contentViewController;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
using namespace Poincare;
|
||||
|
||||
VariableBoxLeafCell::VariableBoxLeafCell() :
|
||||
TableViewCell(),
|
||||
HighlightCell(),
|
||||
m_labelView(BufferTextView(KDText::FontSize::Small, 0, 0.5, KDColorBlack, KDColorWhite)),
|
||||
m_subtitleView(BufferTextView(KDText::FontSize::Small, 0, 0.5, Palette::GreyDark, KDColorWhite)),
|
||||
m_displayExpression(false)
|
||||
@@ -50,7 +50,7 @@ void VariableBoxLeafCell::layoutSubviews() {
|
||||
}
|
||||
|
||||
void VariableBoxLeafCell::reloadCell() {
|
||||
TableViewCell::reloadCell();
|
||||
HighlightCell::reloadCell();
|
||||
KDColor backgroundColor = isHighlighted()? Palette::Select : KDColorWhite;
|
||||
m_labelView.setBackgroundColor(backgroundColor);
|
||||
m_subtitleView.setBackgroundColor(backgroundColor);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <escher.h>
|
||||
|
||||
class VariableBoxLeafCell : public TableViewCell {
|
||||
class VariableBoxLeafCell : public HighlightCell {
|
||||
public:
|
||||
VariableBoxLeafCell();
|
||||
void displayExpression(bool displayExpression);
|
||||
|
||||
@@ -5,30 +5,35 @@ objs += $(addprefix escher/src/,\
|
||||
app.o\
|
||||
buffer_text_view.o\
|
||||
button.o\
|
||||
chevron_menu_list_cell.o\
|
||||
chevron_text_menu_list_cell.o\
|
||||
chevron_expression_menu_list_cell.o\
|
||||
chevron_view.o\
|
||||
container.o\
|
||||
editable_text_menu_list_cell.o\
|
||||
editable_text_cell.o\
|
||||
even_odd_cell.o\
|
||||
even_odd_buffer_text_cell.o\
|
||||
even_odd_editable_text_cell.o\
|
||||
even_odd_expression_cell.o\
|
||||
even_odd_pointer_text_cell.o\
|
||||
expression_menu_list_cell.o\
|
||||
expression_table_cell.o\
|
||||
expression_table_cell_with_pointer.o\
|
||||
expression_view.o\
|
||||
header_view_controller.o\
|
||||
header_view_delegate.o\
|
||||
highlight_cell.o\
|
||||
image_view.o\
|
||||
invocation.o\
|
||||
input_view_controller.o\
|
||||
list_view_data_source.o\
|
||||
menu_list_cell.o\
|
||||
metric.o\
|
||||
modal_view_controller.o\
|
||||
palette.o\
|
||||
pointer_table_cell.o\
|
||||
pointer_table_cell_with_buffer.o\
|
||||
pointer_table_cell_with_chevron.o\
|
||||
pointer_table_cell_with_chevron_and_pointer.o\
|
||||
pointer_table_cell_with_chevron_and_expression.o\
|
||||
pointer_table_cell_with_editable_text.o\
|
||||
pointer_table_cell_with_pointer.o\
|
||||
pointer_table_cell_with_switch.o\
|
||||
pointer_text_view.o\
|
||||
responder.o\
|
||||
scroll_view.o\
|
||||
@@ -39,17 +44,14 @@ objs += $(addprefix escher/src/,\
|
||||
solid_color_view.o\
|
||||
stack_view.o\
|
||||
stack_view_controller.o\
|
||||
switch_menu_list_cell.o\
|
||||
switch_view.o\
|
||||
tab_view.o\
|
||||
tab_view_cell.o\
|
||||
tab_view_controller.o\
|
||||
table_cell.o\
|
||||
table_view.o\
|
||||
table_view_cell.o\
|
||||
table_view_data_source.o\
|
||||
text_field.o\
|
||||
text_expression_menu_list_cell.o\
|
||||
text_menu_list_cell.o\
|
||||
text_view.o\
|
||||
tiled_view.o\
|
||||
toolbox.o\
|
||||
|
||||
@@ -6,31 +6,36 @@
|
||||
#include <escher/app.h>
|
||||
#include <escher/buffer_text_view.h>
|
||||
#include <escher/button.h>
|
||||
#include <escher/chevron_menu_list_cell.h>
|
||||
#include <escher/chevron_text_menu_list_cell.h>
|
||||
#include <escher/chevron_expression_menu_list_cell.h>
|
||||
#include <escher/chevron_view.h>
|
||||
#include <escher/container.h>
|
||||
#include <escher/editable_text_menu_list_cell.h>
|
||||
#include <escher/editable_text_cell.h>
|
||||
#include <escher/even_odd_cell.h>
|
||||
#include <escher/even_odd_buffer_text_cell.h>
|
||||
#include <escher/even_odd_editable_text_cell.h>
|
||||
#include <escher/even_odd_expression_cell.h>
|
||||
#include <escher/even_odd_pointer_text_cell.h>
|
||||
#include <escher/expression_menu_list_cell.h>
|
||||
#include <escher/expression_table_cell.h>
|
||||
#include <escher/expression_table_cell_with_pointer.h>
|
||||
#include <escher/expression_view.h>
|
||||
#include <escher/header_view_controller.h>
|
||||
#include <escher/header_view_delegate.h>
|
||||
#include <escher/highlight_cell.h>
|
||||
#include <escher/image.h>
|
||||
#include <escher/image_view.h>
|
||||
#include <escher/input_view_controller.h>
|
||||
#include <escher/invocation.h>
|
||||
#include <escher/list_view_data_source.h>
|
||||
#include <escher/menu_list_cell.h>
|
||||
#include <escher/metric.h>
|
||||
#include <escher/modal_view_controller.h>
|
||||
#include <escher/palette.h>
|
||||
#include <escher/pointer_table_cell.h>
|
||||
#include <escher/pointer_table_cell_with_buffer.h>
|
||||
#include <escher/pointer_table_cell_with_chevron.h>
|
||||
#include <escher/pointer_table_cell_with_chevron_and_pointer.h>
|
||||
#include <escher/pointer_table_cell_with_chevron_and_expression.h>
|
||||
#include <escher/pointer_table_cell_with_editable_text.h>
|
||||
#include <escher/pointer_table_cell_with_pointer.h>
|
||||
#include <escher/pointer_table_cell_with_switch.h>
|
||||
#include <escher/pointer_text_view.h>
|
||||
#include <escher/responder.h>
|
||||
#include <escher/scroll_view.h>
|
||||
@@ -42,15 +47,12 @@
|
||||
#include <escher/solid_color_view.h>
|
||||
#include <escher/stack_view_controller.h>
|
||||
#include <escher/switch_view.h>
|
||||
#include <escher/switch_menu_list_cell.h>
|
||||
#include <escher/text_field.h>
|
||||
#include <escher/text_field_delegate.h>
|
||||
#include <escher/text_expression_menu_list_cell.h>
|
||||
#include <escher/text_menu_list_cell.h>
|
||||
#include <escher/text_view.h>
|
||||
#include <escher/tab_view_controller.h>
|
||||
#include <escher/table_cell.h>
|
||||
#include <escher/table_view.h>
|
||||
#include <escher/table_view_cell.h>
|
||||
#include <escher/table_view_data_source.h>
|
||||
#include <escher/tiled_view.h>
|
||||
#include <escher/toolbox.h>
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef ESCHER_CHEVRON_EXPRESSION_MENU_LIST_CELL_H
|
||||
#define ESCHER_CHEVRON_EXPRESSION_MENU_LIST_CELL_H
|
||||
|
||||
#include <escher/chevron_menu_list_cell.h>
|
||||
#include <escher/expression_view.h>
|
||||
|
||||
class ChevronExpressionMenuListCell : public ChevronMenuListCell {
|
||||
public:
|
||||
ChevronExpressionMenuListCell(char * label = nullptr);
|
||||
void setHighlighted(bool highlight) override;
|
||||
void setExpression(Poincare::ExpressionLayout * expressionLayout);
|
||||
private:
|
||||
static constexpr KDCoordinate k_margin = 8;
|
||||
int numberOfSubviews() const override;
|
||||
View * subviewAtIndex(int index) override;
|
||||
void layoutSubviews() override;
|
||||
ExpressionView m_subtitleView;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,16 +0,0 @@
|
||||
#ifndef ESCHER_CHEVRON_MENU_LIST_CELL_H
|
||||
#define ESCHER_CHEVRON_MENU_LIST_CELL_H
|
||||
|
||||
#include <escher/menu_list_cell.h>
|
||||
#include <escher/chevron_view.h>
|
||||
|
||||
class ChevronMenuListCell : public MenuListCell {
|
||||
public:
|
||||
ChevronMenuListCell(char * label = nullptr, KDText::FontSize size = KDText::FontSize::Small);
|
||||
View * accessoryView() const override;
|
||||
void setHighlighted(bool highlight) override;
|
||||
private:
|
||||
ChevronView m_accessoryView;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,19 +0,0 @@
|
||||
#ifndef ESCHER_CHEVRON_TEXT_MENU_LIST_CELL_H
|
||||
#define ESCHER_CHEVRON_TEXT_MENU_LIST_CELL_H
|
||||
|
||||
#include <escher/chevron_menu_list_cell.h>
|
||||
|
||||
class ChevronTextMenuListCell : public ChevronMenuListCell {
|
||||
public:
|
||||
ChevronTextMenuListCell(KDText::FontSize size = KDText::FontSize::Small);
|
||||
void setHighlighted(bool highlight) override;
|
||||
void setSubtitle(const char * text);
|
||||
private:
|
||||
static constexpr KDCoordinate k_margin = 8;
|
||||
int numberOfSubviews() const override;
|
||||
View * subviewAtIndex(int index) override;
|
||||
void layoutSubviews() override;
|
||||
PointerTextView m_subtitleView;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,20 +1,18 @@
|
||||
#ifndef ESCHER_CHEVRON_VIEW_H
|
||||
#define ESCHER_CHEVRON_VIEW_H
|
||||
|
||||
#include <escher/view.h>
|
||||
#include <escher/highlight_cell.h>
|
||||
|
||||
class ChevronView : public View {
|
||||
class ChevronView : public HighlightCell {
|
||||
public:
|
||||
ChevronView();
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
void setHighlighted(bool highlight);
|
||||
KDSize minimalSizeForOptimalDisplay() override;
|
||||
/* k_chevronHeight and k_chevronWidth are the dimensions of the chevron. */
|
||||
constexpr static KDCoordinate k_chevronHeight = 16;
|
||||
constexpr static KDCoordinate k_chevronWidth = 8;
|
||||
private:
|
||||
constexpr static KDCoordinate k_chevronRightMargin = 20;
|
||||
bool m_highlighted;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
#define ESCHER_EDITABLE_TEXT_CELL_H
|
||||
|
||||
#include <escher/responder.h>
|
||||
#include <escher/table_view_cell.h>
|
||||
#include <escher/highlight_cell.h>
|
||||
#include <escher/text_field_delegate.h>
|
||||
#include <escher/text_field.h>
|
||||
|
||||
class EditableTextCell : public TableViewCell, public Responder {
|
||||
class EditableTextCell : public HighlightCell, public Responder {
|
||||
public:
|
||||
EditableTextCell(Responder * parentResponder, TextFieldDelegate * delegate, char * draftTextBuffer, KDText::FontSize size = KDText::FontSize::Large,
|
||||
float horizontalAlignment = 0.0f, float verticalAlignment = 0.5f, KDColor textColor = KDColorBlack, KDColor = KDColorWhite);
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
bool isEditing();
|
||||
void setEditing(bool isEditing);
|
||||
KDSize minimalSizeForOptimalDisplay() override;
|
||||
constexpr static int k_bufferLength = 255;
|
||||
private:
|
||||
constexpr static KDCoordinate k_textHeight = 12;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#ifndef ESCHER_EVEN_ODD_CELL_H
|
||||
#define ESCHER_EVEN_ODD_CELL_H
|
||||
|
||||
#include <escher/table_view_cell.h>
|
||||
#include <escher/highlight_cell.h>
|
||||
|
||||
class EvenOddCell : public TableViewCell {
|
||||
class EvenOddCell : public HighlightCell {
|
||||
public:
|
||||
EvenOddCell();
|
||||
virtual void setEven(bool even);
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#ifndef ESCHER_EXPRESSION_MENU_LIST_CELL_H
|
||||
#define ESCHER_EXPRESSION_MENU_LIST_CELL_H
|
||||
|
||||
#include <escher/view.h>
|
||||
#include <escher/expression_view.h>
|
||||
#include <escher/palette.h>
|
||||
#include <escher/metric.h>
|
||||
#include <escher/table_view_cell.h>
|
||||
|
||||
class ExpressionMenuListCell : public TableViewCell {
|
||||
public:
|
||||
ExpressionMenuListCell();
|
||||
void setHighlighted(bool highlight) override;
|
||||
void setExpression(Poincare::ExpressionLayout * expressionLayout);
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
protected:
|
||||
constexpr static KDCoordinate k_separatorThickness = 1;
|
||||
ExpressionView m_labelExpressionView;
|
||||
private:
|
||||
int numberOfSubviews() const override;
|
||||
View * subviewAtIndex(int index) override;
|
||||
void layoutSubviews() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
17
escher/include/escher/expression_table_cell.h
Normal file
17
escher/include/escher/expression_table_cell.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef ESCHER_EXPRESSION_TABLE_CELL_H
|
||||
#define ESCHER_EXPRESSION_TABLE_CELL_H
|
||||
|
||||
#include <escher/expression_view.h>
|
||||
#include <escher/table_cell.h>
|
||||
|
||||
class ExpressionTableCell : public TableCell {
|
||||
public:
|
||||
ExpressionTableCell(Layout layout = Layout::Horizontal);
|
||||
View * labelView() const override;
|
||||
void setHighlighted(bool highlight) override;
|
||||
void setExpression(Poincare::ExpressionLayout * expressionLayout);
|
||||
private:
|
||||
ExpressionView m_labelExpressionView;
|
||||
};
|
||||
|
||||
#endif
|
||||
17
escher/include/escher/expression_table_cell_with_pointer.h
Normal file
17
escher/include/escher/expression_table_cell_with_pointer.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef ESCHER_EXPRESSION_TABLE_CELL_WITH_POINTER_H
|
||||
#define ESCHER_EXPRESSION_TABLE_CELL_WITH_POINTER_H
|
||||
|
||||
#include <escher/expression_table_cell.h>
|
||||
#include <escher/pointer_text_view.h>
|
||||
|
||||
class ExpressionTableCellWithPointer : public ExpressionTableCell {
|
||||
public:
|
||||
ExpressionTableCellWithPointer(char * accessoryText = nullptr, Layout layout = Layout::Horizontal);
|
||||
View * accessoryView() const override;
|
||||
void setHighlighted(bool highlight) override;
|
||||
void setAccessoryText(const char * textBody);
|
||||
private:
|
||||
PointerTextView m_accessoryView;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,15 +1,15 @@
|
||||
#ifndef ESCHER_TABLE_VIEW_CELL_H
|
||||
#define ESCHER_TABLE_VIEW_CELL_H
|
||||
#ifndef ESCHER_HIGHLIGHT_CELL_H
|
||||
#define ESCHER_HIGHLIGHT_CELL_H
|
||||
|
||||
#include <escher/view.h>
|
||||
|
||||
class TableViewCell : public View {
|
||||
class HighlightCell : public View {
|
||||
public:
|
||||
TableViewCell();
|
||||
HighlightCell();
|
||||
virtual void setHighlighted(bool highlight);
|
||||
bool isHighlighted() const;
|
||||
virtual void reloadCell();
|
||||
private:
|
||||
protected:
|
||||
bool m_highlighted;
|
||||
};
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
#define ESCHER_LIST_VIEW_DATA_SOURCE_H
|
||||
|
||||
#include <escher/table_view_data_source.h>
|
||||
#include <escher/table_view_cell.h>
|
||||
#include <escher/highlight_cell.h>
|
||||
|
||||
class ListViewDataSource : public TableViewDataSource {
|
||||
public:
|
||||
KDCoordinate cellWidth();
|
||||
KDCoordinate columnWidth(int i) override;
|
||||
int numberOfColumns() override;
|
||||
void willDisplayCellAtLocation(TableViewCell * cell, int x, int y) override;
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int x, int y) override;
|
||||
int indexFromCumulatedWidth(KDCoordinate offsetX) override;
|
||||
KDCoordinate cumulatedWidthFromIndex(int i) override;
|
||||
virtual void willDisplayCellForIndex(TableViewCell * cell, int index);
|
||||
virtual void willDisplayCellForIndex(HighlightCell * cell, int index);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,27 +0,0 @@
|
||||
#ifndef ESCHER_MENU_LIST_CELL_H
|
||||
#define ESCHER_MENU_LIST_CELL_H
|
||||
|
||||
#include <escher/view.h>
|
||||
#include <escher/pointer_text_view.h>
|
||||
#include <escher/palette.h>
|
||||
#include <escher/metric.h>
|
||||
#include <escher/table_view_cell.h>
|
||||
|
||||
class MenuListCell : public TableViewCell {
|
||||
public:
|
||||
MenuListCell(char * label = nullptr, KDText::FontSize size = KDText::FontSize::Small);
|
||||
virtual View * accessoryView() const;
|
||||
void setText(const char * text);
|
||||
virtual void setTextColor(KDColor color);
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
void setHighlighted(bool highlight) override;
|
||||
protected:
|
||||
int numberOfSubviews() const override;
|
||||
View * subviewAtIndex(int index) override;
|
||||
void layoutSubviews() override;
|
||||
constexpr static KDCoordinate k_separatorThickness = 1;
|
||||
private:
|
||||
PointerTextView m_pointerTextView;
|
||||
};
|
||||
|
||||
#endif
|
||||
18
escher/include/escher/pointer_table_cell.h
Normal file
18
escher/include/escher/pointer_table_cell.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef ESCHER_POINTER_TABLE_CELL_H
|
||||
#define ESCHER_POINTER_TABLE_CELL_H
|
||||
|
||||
#include <escher/pointer_text_view.h>
|
||||
#include <escher/table_cell.h>
|
||||
|
||||
class PointerTableCell : public TableCell {
|
||||
public:
|
||||
PointerTableCell(char * label = nullptr, KDText::FontSize size = KDText::FontSize::Small, Layout layout = Layout::Horizontal);
|
||||
View * labelView() const override;
|
||||
virtual void setHighlighted(bool highlight) override;
|
||||
void setText(const char * text);
|
||||
virtual void setTextColor(KDColor color);
|
||||
private:
|
||||
PointerTextView m_pointerTextView;
|
||||
};
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user