mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[apps/graph/values] Enable to overwrite interval parameters by typing
numerical values Change-Id: I2c19dde8f7e01cec1d0b31ec320209b77a97c43e
This commit is contained in:
@@ -110,18 +110,28 @@ bool ValuesParameterController::handleEvent(Ion::Events::Event event) {
|
||||
setActiveCell(m_activeCell-1);
|
||||
return true;
|
||||
case Ion::Events::Event::ENTER:
|
||||
editParameterInterval();
|
||||
editInterval(false);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
if ((int)event >= 0x100) {
|
||||
return false;
|
||||
}
|
||||
editInterval(true, (char)event);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void ValuesParameterController::editParameterInterval() {
|
||||
void ValuesParameterController::editInterval(bool overwrite, char initialDigit) {
|
||||
/* This code assumes that the active cell remains the one which is edited
|
||||
* until the invocation is performed. This could lead to concurrency issue in
|
||||
* other cases. */
|
||||
const char * initialTextContent = ListViewCellAtIndex(m_activeCell)->textContent();
|
||||
char initialTextContent[16];
|
||||
if (overwrite) {
|
||||
initialTextContent[0] = initialDigit;
|
||||
initialTextContent[1] = 0;
|
||||
} else {
|
||||
strlcpy(initialTextContent, ListViewCellAtIndex(m_activeCell)->textContent(), sizeof(initialTextContent));
|
||||
}
|
||||
App * myApp = (App *)app();
|
||||
InputViewController * inputController = myApp->inputViewController();
|
||||
inputController->edit(this, initialTextContent, this,
|
||||
|
||||
Reference in New Issue
Block a user