Fixed editName() 128x64

This commit is contained in:
Raphael Coeffic
2021-06-05 20:29:09 +02:00
committed by Raphael Coeffic
parent b429855675
commit 27252a41ac
10 changed files with 59 additions and 26 deletions
+12 -9
View File
@@ -61,6 +61,8 @@ void menuModelCustomScriptOne(event_t event)
drawStringWithIndex(PSIZE(TR_MENUCUSTOMSCRIPTS)*FW+FW, 0, "LUA", s_currIdx+1, 0);
lcdDrawFilledRect(0, 0, LCD_W, FH, SOLID, 0);
uint8_t old_editMode = s_editMode;
SUBMENU(STR_MENUCUSTOMSCRIPTS, 3+scriptInputsOutputs[s_currIdx].inputsCount+scriptInputsOutputs[s_currIdx].outputsCount + 1 /*outputs label*/, { 0, 0, LABEL(inputs), 0/*repeated*/ });
int8_t sub = menuVerticalPosition;
@@ -88,12 +90,12 @@ void menuModelCustomScriptOne(event_t event)
}
else if (i == ITEM_MODEL_CUSTOMSCRIPT_NAME) {
lcdDrawTextAlignedLeft(y, TR_NAME);
editName(SCRIPT_ONE_2ND_COLUMN_POS, y, sd.name, sizeof(sd.name), event, attr);
}
else if (i == ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL) {
editName(SCRIPT_ONE_2ND_COLUMN_POS, y, sd.name, sizeof(sd.name), event,
(attr != 0), attr, old_editMode);
} else if (i == ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL) {
lcdDrawTextAlignedLeft(y, STR_INPUTS);
}
else if (i <= ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL+scriptInputsOutputs[s_currIdx].inputsCount) {
} else if (i <= ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL +
scriptInputsOutputs[s_currIdx].inputsCount) {
int inputIdx = i-ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL-1;
lcdDrawSizedText(INDENT_WIDTH, y, scriptInputsOutputs[s_currIdx].inputs[inputIdx].name, 10, 0);
if (scriptInputsOutputs[s_currIdx].inputs[inputIdx].type == INPUT_TYPE_VALUE) {
@@ -111,14 +113,15 @@ void menuModelCustomScriptOne(event_t event)
CHECK_INCDEC_MODELSOURCE(event, g_model.scriptsData[s_currIdx].inputs[inputIdx].source, 0, MIXSRC_LAST_TELEM);
}
}
}
else if (i == ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL+scriptInputsOutputs[s_currIdx].inputsCount+1) {
} else if (i == ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL +
scriptInputsOutputs[s_currIdx].inputsCount + 1) {
lcdDrawTextAlignedLeft(y, STR_OUTPUTS);
if (attr) {
REPEAT_LAST_CURSOR_MOVE();
}
}
else if (i <= ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL+scriptInputsOutputs[s_currIdx].inputsCount+scriptInputsOutputs[s_currIdx].outputsCount+1) {
} else if (i <= ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL +
scriptInputsOutputs[s_currIdx].inputsCount +
scriptInputsOutputs[s_currIdx].outputsCount + 1) {
int outputIdx = i-(ITEM_MODEL_CUSTOMSCRIPT_PARAMS_LABEL+scriptInputsOutputs[s_currIdx].inputsCount)-2;
lcdDrawSizedText(INDENT_WIDTH, y, scriptInputsOutputs[s_currIdx].outputs[outputIdx].name, 10, 0);
lcdDrawNumber(SCRIPT_ONE_2ND_COLUMN_POS, y, calcRESXto1000(scriptInputsOutputs[s_currIdx].outputs[outputIdx].value), attr|PREC1|LEFT);