[apps/escher/toolbox] handleEventWithText for all responders.

This makes the code in the various toolbox more generic. The arguments
of the text to insert are each replaced by a Ion::Charset::Empty.
These Empty chars are used to create layouts in ExpressionLayoutFields,
and to compute the position of the cursor in other fields, before being
removed.

Change-Id: Ie81c1e394b06fef2ab801ccff919d6550f70ec30
This commit is contained in:
Léa Saviot
2018-04-23 14:57:46 +02:00
parent 643aa89f74
commit 13ae1d2545
23 changed files with 153 additions and 152 deletions

View File

@@ -294,8 +294,7 @@ bool PythonToolbox::selectLeaf(ToolboxMessageTree * selectedMessageTree) {
int strippedEditedTextMaxLength = strlen(editedText)+1;
char strippedEditedText[strippedEditedTextMaxLength];
Shared::ToolboxHelpers::TextToInsertForCommandMessage(node->insertedText(), strippedEditedText, strippedEditedTextMaxLength);
TextInput * textInput = static_cast<TextInput *>(sender());
textInput->handleEventWithText(strippedEditedText, true);
sender()->handleEventWithText(strippedEditedText, true);
app()->dismissModalViewController();
return true;
}