mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[apps/sequence][apps/graph] Clear the function expression when handling
event backspace Change-Id: I89319a2dee21b162dd9ffe16f02eda99c26207b2
This commit is contained in:
@@ -231,4 +231,20 @@ void ListController::editExpression(Shared::Function * function, Ion::Events::Ev
|
||||
editExpression(sequence, sequenceDefinitionForRow(m_selectableTableView.selectedRow()), event);
|
||||
}
|
||||
|
||||
void ListController::reinitExpression(Shared::Function * function) {
|
||||
Sequence * sequence = (Sequence *)function;
|
||||
switch (sequenceDefinitionForRow(m_selectableTableView.selectedRow())) {
|
||||
case 1:
|
||||
sequence->setFirstInitialConditionContent("");
|
||||
break;
|
||||
case 2:
|
||||
sequence->setSecondInitialConditionContent("");
|
||||
break;
|
||||
default:
|
||||
sequence->setContent("");
|
||||
break;
|
||||
}
|
||||
m_selectableTableView.reloadData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ private:
|
||||
int sequenceDefinitionForRow(int j);
|
||||
void addEmptyFunction() override;
|
||||
void editExpression(Shared::Function * function, Ion::Events::Event event) override;
|
||||
void reinitExpression(Shared::Function * function) override;
|
||||
static constexpr KDCoordinate k_emptySubRowHeight = 30;
|
||||
constexpr static int k_maxNumberOfRows = 9;
|
||||
SequenceStore * m_sequenceStore;
|
||||
|
||||
@@ -168,6 +168,10 @@ bool ListController::handleEvent(Ion::Events::Event event) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (event == Ion::Events::Backspace && m_selectableTableView.selectedColumn() == 1) {
|
||||
Shared::Function * function = m_functionStore->functionAtIndex(functionIndexForRow(m_selectableTableView.selectedRow()));
|
||||
reinitExpression(function);
|
||||
}
|
||||
if ((event.hasText() || event == Ion::Events::XNT)
|
||||
&& m_selectableTableView.selectedColumn() == 1
|
||||
&& (m_selectableTableView.selectedRow() != numberOfRows() - 1
|
||||
@@ -193,6 +197,11 @@ void ListController::configureFunction(Shared::Function * function) {
|
||||
stack->push(parameterController());
|
||||
}
|
||||
|
||||
void ListController::reinitExpression(Function * function) {
|
||||
function->setContent("");
|
||||
m_selectableTableView.reloadData();
|
||||
}
|
||||
|
||||
Responder * ListController::tabController() const{
|
||||
return (parentResponder()->parentResponder()->parentResponder());
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@ public:
|
||||
protected:
|
||||
static constexpr KDCoordinate k_emptyRowHeight = 50;
|
||||
StackViewController * stackController() const;
|
||||
void configureFunction(Shared::Function * function);
|
||||
void configureFunction(Function * function);
|
||||
virtual void reinitExpression(Function * function);
|
||||
SelectableTableView m_selectableTableView;
|
||||
FunctionStore * m_functionStore;
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user