mirror of
https://github.com/opentx/opentx.git
synced 2025-07-22 15:55:26 +03:00
[X7D/X9E] GVars display fixed (menus INPUTS / MIXES / OUTPUTS) (#4053)
This commit is contained in:
parent
2d0a8a9611
commit
b93b0a6500
6 changed files with 25 additions and 14 deletions
|
@ -137,10 +137,13 @@ int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int
|
|||
}
|
||||
|
||||
if (GV_IS_GV_VALUE(value, min, max)) {
|
||||
if (attr & LEFT)
|
||||
if (IS_LEFT_ALIGNED(attr)) {
|
||||
attr -= LEFT; /* because of ZCHAR */
|
||||
else
|
||||
x -= 2*FW+FWNUM;
|
||||
}
|
||||
else {
|
||||
x -= 3*FW;
|
||||
attr -= RIGHT;
|
||||
}
|
||||
|
||||
attr &= ~PREC1;
|
||||
|
||||
|
|
|
@ -234,14 +234,14 @@ swsrc_t editSwitch(coord_t x, coord_t y, swsrc_t value, LcdFlags attr, event_t e
|
|||
#define ON_OFF_MENU_ITEM(value, x, y, label, attr, event) value = editCheckBox(value, x, y, label, attr, event)
|
||||
|
||||
#if defined(GVARS)
|
||||
void drawGVarName(coord_t x, coord_t y, int8_t index, LcdFlags flags=0);
|
||||
void drawGVarName(coord_t x, coord_t y, int8_t index, LcdFlags flags=0);
|
||||
void drawGVarValue(coord_t x, coord_t y, uint8_t gvar, gvar_t value, LcdFlags flags=0);
|
||||
int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, uint8_t editflags, event_t event);
|
||||
#define GVAR_MENU_ITEM(x, y, v, min, max, lcdattr, editflags, event) editGVarFieldValue(x, y, v, min, max, lcdattr, editflags, event)
|
||||
#define displayGVar(x, y, v, min, max) GVAR_MENU_ITEM(x, y, v, min, max, 0, 0, 0)
|
||||
#else
|
||||
#define GVAR_MENU_ITEM(x, y, v, min, max, lcdattr, editflags, event) editGVarFieldValue(x, y, v, min, max, lcdattr, event)
|
||||
int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, event_t event);
|
||||
int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int16_t max, LcdFlags attr, event_t event);
|
||||
#define displayGVar(x, y, v, min, max) lcdDrawNumber(x, y, v)
|
||||
#endif
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ void menuModelLimits(event_t event)
|
|||
|
||||
case ITEM_LIMITS_OFFSET:
|
||||
if (GV_IS_GV_VALUE(ld->offset, -1000, 1000) || (attr && event == EVT_KEY_LONG(KEY_ENTER))) {
|
||||
ld->offset = GVAR_MENU_ITEM(LIMITS_OFFSET_POS, y, ld->offset, -1000, 1000, attr|PREC1, 0, event);
|
||||
ld->offset = GVAR_MENU_ITEM(LIMITS_OFFSET_POS, y, ld->offset, -1000, 1000, RIGHT|attr|PREC1, 0, event);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -198,8 +198,10 @@ int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int
|
|||
}
|
||||
|
||||
if (GV_IS_GV_VALUE(value, min, max)) {
|
||||
if (attr & RIGHT)
|
||||
x -= 2*FW+FWNUM;
|
||||
if (attr & RIGHT) {
|
||||
x -= 3*FW;
|
||||
attr -= RIGHT;
|
||||
}
|
||||
|
||||
attr &= ~PREC1;
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ void onMixesMenu(const char * result)
|
|||
}
|
||||
|
||||
#if LCD_W >= 212
|
||||
#define MIX_LINE_WEIGHT_POS 2*FW+32
|
||||
#define MIX_LINE_WEIGHT_POS 2*FW+34
|
||||
#define MIX_LINE_SRC_POS 7*FW+5
|
||||
#define MIX_LINE_CURVE_POS 13*FW+3
|
||||
#define MIX_LINE_SWITCH_POS 19*FW+1
|
||||
|
@ -402,7 +402,7 @@ void menuModelMixAll(event_t event)
|
|||
int cur = 0;
|
||||
int i = 0;
|
||||
|
||||
for (int ch=1; ch<=MAX_OUTPUT_CHANNELS; ch++) {
|
||||
for (uint8_t ch=1; ch<=MAX_OUTPUT_CHANNELS; ch++) {
|
||||
MixData * md;
|
||||
coord_t y = MENU_HEADER_HEIGHT+1+(cur-menuVerticalOffset)*FH;
|
||||
if (i<MAX_MIXERS && (md=mixAddress(i))->srcRaw && md->destCh+1 == ch) {
|
||||
|
@ -426,7 +426,7 @@ void menuModelMixAll(event_t event)
|
|||
s_currIdx = i;
|
||||
}
|
||||
if (cur-menuVerticalOffset >= 0 && cur-menuVerticalOffset < NUM_BODY_LINES) {
|
||||
uint8_t attr = ((s_copyMode || sub != cur) ? 0 : INVERS);
|
||||
LcdFlags attr = ((s_copyMode || sub != cur) ? 0 : INVERS);
|
||||
|
||||
if (mixCnt > 0) lcdDrawTextAtIndex(FW, y, STR_VMLTPX2, md->mltpx, 0);
|
||||
|
||||
|
|
|
@ -20,10 +20,16 @@
|
|||
|
||||
#include "opentx.h"
|
||||
|
||||
void drawStringWithIndex(coord_t x, coord_t y, const pm_char * str, uint8_t idx, LcdFlags att)
|
||||
void drawStringWithIndex(coord_t x, coord_t y, const pm_char * str, uint8_t idx, LcdFlags flags)
|
||||
{
|
||||
lcdDrawText(x, y, str, att & ~LEADING0);
|
||||
lcdDrawNumber(lcdNextPos, y, idx, att|LEFT, 2);
|
||||
if (flags & RIGHT) {
|
||||
lcdDrawNumber(x, y, idx, flags);
|
||||
lcdDrawText(x-FW, y, str, flags & ~LEADING0);
|
||||
}
|
||||
else {
|
||||
lcdDrawText(x, y, str, flags & ~LEADING0);
|
||||
lcdDrawNumber(lcdNextPos, y, idx, flags|LEFT, 2);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(CPUARM)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue