mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 08:47:28 +01:00
[apps][escher] Add methods 'handleEventWithText' in TextField and
TextArea to fix bug in probability (adding a toolbox text from the calculations controller)
This commit is contained in:
committed by
EmilieNumworks
parent
7fcf77ce23
commit
576caa039f
@@ -122,19 +122,11 @@ void VariableBoxController::ContentViewController::insertTextInCaller(const char
|
||||
char commandBuffer[strlen(text)+1];
|
||||
Shared::ToolboxHelpers::TextToInsertForCommandText(text, commandBuffer);
|
||||
if (m_textFieldCaller != nullptr) {
|
||||
if (!m_textFieldCaller->isEditing()) {
|
||||
m_textFieldCaller->setEditing(true);
|
||||
}
|
||||
int previousCursorLocation = m_textFieldCaller->cursorLocation();
|
||||
m_textFieldCaller->insertTextAtLocation(commandBuffer, previousCursorLocation);
|
||||
m_textFieldCaller->setCursorLocation(previousCursorLocation + Shared::ToolboxHelpers::CursorIndexInCommand(commandBuffer));
|
||||
m_textFieldCaller->handleEventWithText(commandBuffer);
|
||||
return;
|
||||
}
|
||||
if (m_textAreaCaller != nullptr) {
|
||||
int previousCursorLocation = m_textAreaCaller->cursorLocation();
|
||||
m_textAreaCaller->insertText(commandBuffer);
|
||||
int deltaCursorLocation = - m_textAreaCaller->cursorLocation() + previousCursorLocation + Shared::ToolboxHelpers::CursorIndexInCommand(commandBuffer);
|
||||
m_textAreaCaller->moveCursor(deltaCursorLocation);
|
||||
m_textAreaCaller->handleEventWithText(commandBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user