chore(bw): tidy up Radio Setup menu (#4939)

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
philmoz
2024-05-30 15:59:15 +10:00
committed by GitHub
co-authored by Peter Feerick
parent e1b1b88f01
commit 9bdd5664a0
58 changed files with 1282 additions and 1587 deletions
+10 -5
View File
@@ -82,25 +82,30 @@ void title(const char * s)
lcdDrawText(0, 0, s, INVERS);
}
choice_t editChoice(coord_t x, coord_t y, const char * label, const char* const* values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, IsValueAvailable isValueAvailable)
choice_t editChoice(coord_t x, coord_t y, const char * label, const char* const* values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, coord_t lblX, IsValueAvailable isValueAvailable)
{
if (label) {
drawFieldLabel(x, y, label);
lcdDrawText(lblX, y, label);
}
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
if (attr & (~RIGHT)) value = checkIncDec(event, value, min, max, (isModelMenuDisplayed()) ? EE_MODEL : EE_GENERAL, isValueAvailable);
return value;
}
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event )
choice_t editChoice(coord_t x, coord_t y, const char * label, const char* const* values, choice_t value, choice_t min, choice_t max, LcdFlags attr, event_t event, coord_t lblX)
{
return editChoice(x, y, label, values, value, min, max, attr, event, lblX, nullptr);
}
uint8_t editCheckBox(uint8_t value, coord_t x, coord_t y, const char *label, LcdFlags attr, event_t event, coord_t lblX)
{
drawCheckBox(x, y, value, attr);
return editChoice(x, y, label, nullptr, value, 0, 1, attr, event);
return editChoice(x, y, label, nullptr, value, 0, 1, attr, event, lblX);
}
swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, event_t event)
{
drawFieldLabel(x, y, STR_SWITCH);
lcdDrawTextAlignedLeft(y, STR_SWITCH);
drawSwitch(x, y, value, attr);
if (attr & (~RIGHT)) CHECK_INCDEC_MODELSWITCH(event, value, SWSRC_FIRST_IN_MIXES, SWSRC_LAST_IN_MIXES, isSwitchAvailableInMixes);
return value;