mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph/list] handle deleting functions from the parameter page
Change-Id: I34eff520f40ed5901011499c770c1b06d72b3cc7
This commit is contained in:
@@ -7,7 +7,7 @@ ListController::ListController(Responder * parentResponder, Graph::FunctionStore
|
||||
m_activeCell(-1),
|
||||
m_manualScrolling(0),
|
||||
m_functionStore(functionStore),
|
||||
m_parameterController(ParameterController(this))
|
||||
m_parameterController(ParameterController(this, functionStore))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#include "parameter_controller.h"
|
||||
#include <assert.h>
|
||||
|
||||
ParameterController::ParameterController(Responder * parentResponder) :
|
||||
ParameterController::ParameterController(Responder * parentResponder, Graph::FunctionStore * functionStore) :
|
||||
ViewController(parentResponder),
|
||||
m_colorCell(TableViewCell((char*)"Couleur de la fonction")),
|
||||
m_enableCell(SwitchTableViewCell((char*)"Activer/Desactiver")),
|
||||
m_deleteCell(TableViewCell((char*)"Supprimer la fonction")),
|
||||
m_tableView(TableView(this)),
|
||||
m_activeCell(0)
|
||||
m_activeCell(0),
|
||||
m_functionStore(functionStore)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -78,13 +79,19 @@ bool ParameterController::handleEnter() {
|
||||
return true;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
m_functionStore->removeFunction(m_function);
|
||||
StackViewController * stack = (StackViewController *)(parentResponder());
|
||||
stack->pop();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int ParameterController::numberOfCells() {
|
||||
return k_totalNumberOfCell;
|
||||
};
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
class ParameterController : public ViewController, public TableViewDataSource {
|
||||
public:
|
||||
ParameterController(Responder * parentResponder);
|
||||
ParameterController(Responder * parentResponder, Graph::FunctionStore * functionStore);
|
||||
|
||||
View * view() override;
|
||||
const char * title() const override;
|
||||
@@ -30,6 +30,7 @@ private:
|
||||
TableView m_tableView;
|
||||
int m_activeCell;
|
||||
Graph::Function * m_function;
|
||||
Graph::FunctionStore * m_functionStore;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user