mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 22:30:30 +01:00
[apps/graph] Use editable text menu list cell in float parameter
controller to enable editing parameter "inline" Change-Id: Ibfb8134242ebdcdc8e17027f31196b94a537bd1b
This commit is contained in:
@@ -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){
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user