[apps/shared] In sequence and function list, implement short cup to plot

the function or go to the value table

Change-Id: I08ea3c58cfe060391dceeb7f8c0019aa65571ad4
This commit is contained in:
Émilie Feral
2017-03-01 16:24:52 +01:00
committed by Romain Goyet
parent b36e5dc67c
commit 4e54d92997
2 changed files with 10 additions and 3 deletions

View File

@@ -10,8 +10,14 @@ ListController::ListController(Responder * parentResponder, FunctionStore * func
m_functionStore(functionStore),
m_addNewFunction(text),
m_plotButton(this, "Tracer", Invocation([](void * context, void * sender) {
ListController * list = (ListController *)context;
TabViewController * tabController = list->tabController();
tabController->setActiveTab(1);
}, this), KDText::FontSize::Large),
m_valuesButton(this, "Afficher les valeurs", Invocation([](void * context, void * sender) {
ListController * list = (ListController *)context;
TabViewController * tabController = list->tabController();
tabController->setActiveTab(2);
}, this), KDText::FontSize::Large)
{
}
@@ -149,6 +155,7 @@ void ListController::didBecomeFirstResponder() {
if (m_selectableTableView.selectedRow() >= numberOfRows()) {
m_selectableTableView.selectCellAtLocation(m_selectableTableView.selectedColumn(), numberOfRows()-1);
}
footer()->setSelectedButton(-1);
app()->setFirstResponder(&m_selectableTableView);
}
@@ -235,8 +242,8 @@ void ListController::reinitExpression(Function * function) {
m_selectableTableView.reloadData();
}
Responder * ListController::tabController() const{
return (parentResponder()->parentResponder()->parentResponder()->parentResponder());
TabViewController * ListController::tabController() const{
return (TabViewController *)(parentResponder()->parentResponder()->parentResponder()->parentResponder());
}
int ListController::functionIndexForRow(int j) {

View File

@@ -36,7 +36,7 @@ protected:
FunctionStore * m_functionStore;
private:
static constexpr KDCoordinate k_functionNameWidth = 65;
Responder * tabController() const;
TabViewController * tabController() const;
virtual int functionIndexForRow(int j);
virtual void addEmptyFunction();
virtual void editExpression(Function * function, Ion::Events::Event event) = 0;