diff --git a/apps/graph/float_parameter_controller.cpp b/apps/graph/float_parameter_controller.cpp index 3ce80f7ba..4c44937d8 100644 --- a/apps/graph/float_parameter_controller.cpp +++ b/apps/graph/float_parameter_controller.cpp @@ -59,22 +59,20 @@ void FloatParameterController::editParameter(const char * initialText) { strlcpy(initialTextContent, textMenuListCell->accessoryText(), sizeof(initialTextContent)); } int cursorLocation = strlen(initialTextContent) + cursorDelta; + EditableTextMenuListCell * cell = (EditableTextMenuListCell *)m_selectableTableView.cellAtLocation(0, activeCell()); + cell->setParentResponder(&m_selectableTableView); App * myApp = (App *)app(); - InputViewController * inputController = myApp->inputViewController(); - inputController->edit(this, initialTextContent, cursorLocation, this, + cell->editValue(myApp, initialTextContent, cursorLocation, this, [](void * context, void * sender){ FloatParameterController * floatParameterController = (FloatParameterController *)context; int activeCell = floatParameterController->activeCell(); - TextMenuListCell * cell = (TextMenuListCell *)floatParameterController->reusableCell(activeCell); - InputViewController * myInputViewController = (InputViewController *)sender; - const char * textBody = myInputViewController->textBody(); + EditableTextMenuListCell * cell = (EditableTextMenuListCell *)sender; + const char * textBody = cell->editedText(); AppsContainer * appsContainer = (AppsContainer *)floatParameterController->app()->container(); Context * globalContext = appsContainer->context(); float floatBody = Expression::parse(textBody)->approximate(*globalContext); floatParameterController->setParameterAtIndex(activeCell, floatBody); floatParameterController->willDisplayCellForIndex(cell, activeCell); - }, - [](void * context, void * sender){ }); } diff --git a/apps/graph/graph/axis_parameter_controller.h b/apps/graph/graph/axis_parameter_controller.h index 4c1d37146..46d9ee723 100644 --- a/apps/graph/graph/axis_parameter_controller.h +++ b/apps/graph/graph/axis_parameter_controller.h @@ -21,7 +21,7 @@ private: void setParameterAtIndex(int parameterIndex, float f) override; constexpr static int k_numberOfTextCell = 4; AxisInterval * m_axisInterval; - TextMenuListCell m_axisCells[k_numberOfTextCell]; + EditableTextMenuListCell m_axisCells[k_numberOfTextCell]; SwitchMenuListCell m_yAutoCell; GraphView * m_graphView; }; diff --git a/apps/graph/graph/goto_parameter_controller.cpp b/apps/graph/graph/goto_parameter_controller.cpp index 13d3bd051..ee8598d38 100644 --- a/apps/graph/graph/goto_parameter_controller.cpp +++ b/apps/graph/graph/goto_parameter_controller.cpp @@ -5,7 +5,7 @@ namespace Graph { GoToParameterController::GoToParameterController(Responder * parentResponder, GraphView * graphView) : FloatParameterController(parentResponder), - m_abscisseCell(TextMenuListCell((char*)"x")), + m_abscisseCell(EditableTextMenuListCell((char*)"x")), m_graphView(graphView), m_function(nullptr) { diff --git a/apps/graph/graph/goto_parameter_controller.h b/apps/graph/graph/goto_parameter_controller.h index 61945268d..ebc681f68 100644 --- a/apps/graph/graph/goto_parameter_controller.h +++ b/apps/graph/graph/goto_parameter_controller.h @@ -18,7 +18,7 @@ public: private: float parameterAtIndex(int index) override; void setParameterAtIndex(int parameterIndex, float f) override; - TextMenuListCell m_abscisseCell; + EditableTextMenuListCell m_abscisseCell; GraphView * m_graphView; Function * m_function; }; diff --git a/apps/graph/values/interval_parameter_controller.cpp b/apps/graph/values/interval_parameter_controller.cpp index 1d9dbc5d0..b62aeb1fd 100644 --- a/apps/graph/values/interval_parameter_controller.cpp +++ b/apps/graph/values/interval_parameter_controller.cpp @@ -6,9 +6,9 @@ namespace Graph { IntervalParameterController::IntervalParameterController(Responder * parentResponder, Interval * interval) : FloatParameterController(parentResponder), m_interval(interval), - m_intervalStartCell(TextMenuListCell((char*)"X Debut")), - m_intervalEndCell(TextMenuListCell((char*)"X Fin")), - m_intervalStepCell(TextMenuListCell((char*)"Pas")) + m_intervalStartCell(EditableTextMenuListCell((char*)"X Debut")), + m_intervalEndCell(EditableTextMenuListCell((char*)"X Fin")), + m_intervalStepCell(EditableTextMenuListCell((char*)"Pas")) { } diff --git a/apps/graph/values/interval_parameter_controller.h b/apps/graph/values/interval_parameter_controller.h index fc2a44b18..657181ab5 100644 --- a/apps/graph/values/interval_parameter_controller.h +++ b/apps/graph/values/interval_parameter_controller.h @@ -20,9 +20,9 @@ private: void setParameterAtIndex(int parameterIndex, float f) override; constexpr static int k_totalNumberOfCell = 3; Interval * m_interval; - TextMenuListCell m_intervalStartCell; - TextMenuListCell m_intervalEndCell; - TextMenuListCell m_intervalStepCell; + EditableTextMenuListCell m_intervalStartCell; + EditableTextMenuListCell m_intervalEndCell; + EditableTextMenuListCell m_intervalStepCell; }; }