Cosmetics
This commit is contained in:
@@ -40,9 +40,9 @@
|
||||
|
||||
/* drawText flags */
|
||||
#define INVERS 0x02
|
||||
#define LEFT 0x00
|
||||
#define CENTERED 0x04 /* align left */
|
||||
#define RIGHT 0x08 /* align left */
|
||||
#define LEFT 0x00 /* align left */
|
||||
#define CENTERED 0x04 /* align center */
|
||||
#define RIGHT 0x08 /* align right */
|
||||
|
||||
/* drawNumber flags */
|
||||
#define LEADING0 0x10
|
||||
|
||||
@@ -38,11 +38,8 @@ const MenuHandlerFunc menuTabModel[] = {
|
||||
#endif
|
||||
CASE_FRSKY(menuModelTelemetryFrsky)
|
||||
CASE_MAVLINK(menuModelTelemetryMavlink)
|
||||
CASE_TEMPLATES(menuModelTemplates)
|
||||
};
|
||||
|
||||
extern uint8_t s_curveChan;
|
||||
|
||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlags attr);
|
||||
|
||||
uint8_t editDelay(const coord_t x, const coord_t y, const event_t event, const uint8_t attr, uint8_t delay)
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
extern uint8_t menuPageIndex;
|
||||
extern uint8_t menuPageCount;
|
||||
extern uint16_t linesCount;
|
||||
extern uint8_t linesDisplayed;
|
||||
extern int menuVerticalPosition;
|
||||
extern int menuHorizontalPosition;
|
||||
extern int menuVerticalOffset;
|
||||
@@ -349,7 +350,7 @@ swsrc_t checkIncDecMovedSwitch(swsrc_t val);
|
||||
checkIncDec(event, var, min, max, incdecFlag, isValueAvailable)
|
||||
|
||||
int8_t navigate(event_t event, int count, int rows, int columns=1, bool loop=true);
|
||||
bool check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, int maxrow, uint8_t flags=0);
|
||||
bool check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, const uint8_t * horTab, uint8_t horTabMax, int maxrow, uint8_t flags=0);
|
||||
bool check_simple(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t menuTabSize, int maxrow);
|
||||
bool check_submenu_simple(event_t event, uint8_t maxrow);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ enum MenuModelHeliItems {
|
||||
bool menuModelHeli(event_t event)
|
||||
{
|
||||
SIMPLE_MENU(STR_MENUHELISETUP, MODEL_ICONS, menuTabModel, MENU_MODEL_HELI, ITEM_HELI_MAX);
|
||||
|
||||
|
||||
uint8_t sub = menuVerticalPosition;
|
||||
|
||||
for (uint8_t i=0; i<NUM_BODY_LINES; i++) {
|
||||
@@ -46,7 +46,7 @@ bool menuModelHeli(event_t event)
|
||||
LcdFlags blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);
|
||||
LcdFlags attr = (sub == k ? blink : 0);
|
||||
|
||||
switch(k) {
|
||||
switch (k) {
|
||||
case ITEM_HELI_SWASHTYPE:
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_SWASHTYPE);
|
||||
g_model.swashR.type = selectMenuItem(MODEL_HELI_2ND_COLUMN, y, STR_VSWASHTYPE, g_model.swashR.type, 0, SWASH_TYPE_MAX, attr, event);
|
||||
|
||||
@@ -443,7 +443,7 @@ bool menuModelExposAll(event_t event)
|
||||
pushMenu(menuModelExpoOne);
|
||||
s_copyMode = 0;
|
||||
}
|
||||
else if (menuVerticalPosition >= 0) {
|
||||
else {
|
||||
event = 0;
|
||||
s_copyMode = 0;
|
||||
POPUP_MENU_ADD_ITEM(STR_EDIT);
|
||||
|
||||
@@ -54,7 +54,7 @@ void putsEdgeDelayParam(coord_t x, coord_t y, LogicalSwitchData *cs, uint8_t lat
|
||||
lcdDrawChar(lcdNextPos+3, y, ']');
|
||||
}
|
||||
|
||||
void onLogicalSwitchesMenu(const char *result)
|
||||
void onLogicalSwitchesMenu(const char * result)
|
||||
{
|
||||
LogicalSwitchData * cs = lswAddress(menuVerticalPosition);
|
||||
|
||||
|
||||
@@ -355,15 +355,13 @@ void displayMixLine(coord_t y, MixData *md)
|
||||
lcdDrawSizedText(MIX_LINE_NAME_FM_POS, y, md->name, sizeof(md->name), ZCHAR);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (md->name[0]) {
|
||||
lcd->drawBitmap(MIX_LINE_NAME_FM_ICON, y + 2, mixerSetupLabelBitmap);
|
||||
lcdDrawSizedText(MIX_LINE_NAME_FM_POS, y, md->name, sizeof(md->name), ZCHAR);
|
||||
}
|
||||
if (md->flightModes) {
|
||||
lcd->drawBitmap(MIX_LINE_NAME_FM_ICON, y + 2, mixerSetupFlightmodeBitmap);
|
||||
displayMixSmallFlightModes(MIX_LINE_NAME_FM_POS, y + 2, md->flightModes);
|
||||
}
|
||||
else if (md->name[0]) {
|
||||
lcd->drawBitmap(MIX_LINE_NAME_FM_ICON, y + 2, mixerSetupLabelBitmap);
|
||||
lcdDrawSizedText(MIX_LINE_NAME_FM_POS, y, md->name, sizeof(md->name), ZCHAR);
|
||||
}
|
||||
else if (md->flightModes) {
|
||||
lcd->drawBitmap(MIX_LINE_NAME_FM_ICON, y + 2, mixerSetupFlightmodeBitmap);
|
||||
displayMixSmallFlightModes(MIX_LINE_NAME_FM_POS, y + 2, md->flightModes);
|
||||
}
|
||||
displayMixInfos(y, md);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
uint8_t g_moduleIdx;
|
||||
bool menuModelFailsafe(event_t event);
|
||||
|
||||
enum menuModelSetupItems {
|
||||
enum MenuModelSetupItems {
|
||||
ITEM_MODEL_NAME,
|
||||
ITEM_MODEL_BITMAP,
|
||||
ITEM_MODEL_TIMER1,
|
||||
|
||||
@@ -66,7 +66,7 @@ void onCustomFunctionsFileSelectionMenu(const char * result)
|
||||
}
|
||||
}
|
||||
|
||||
void onCustomFunctionsMenu(const char *result)
|
||||
void onCustomFunctionsMenu(const char * result)
|
||||
{
|
||||
CustomFunctionData * cfn;
|
||||
uint8_t eeFlags;
|
||||
@@ -174,8 +174,8 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
drawStringWithIndex(MENUS_MARGIN_LEFT, y, functions == g_model.customFn ? STR_SF : STR_GF, k+1, (menuVerticalPosition==k && menuHorizontalPosition<0) ? INVERS : 0);
|
||||
|
||||
CustomFunctionData * cfn = &functions[k];
|
||||
unsigned int func = CFN_FUNC(cfn);
|
||||
for (int j=0; j<ITEM_SPECIAL_FUNCTIONS_COUNT; j++) {
|
||||
uint8_t func = CFN_FUNC(cfn);
|
||||
for (uint8_t j=0; j<ITEM_SPECIAL_FUNCTIONS_COUNT; j++) {
|
||||
LcdFlags attr = ((menuVerticalPosition==k && menuHorizontalPosition==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||
LcdFlags active = (attr && s_editMode>0);
|
||||
switch (j) {
|
||||
@@ -224,7 +224,7 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
}
|
||||
#endif
|
||||
else if (func == FUNC_SET_TIMER) {
|
||||
maxParam = MAX_TIMERS-1;
|
||||
maxParam = TIMERS-1;
|
||||
drawStringWithIndex(MODEL_SPECIAL_FUNC_2ND_COLUMN_EXT, y, STR_TIMER, CFN_TIMER_INDEX(cfn)+1, attr);
|
||||
if (active) CFN_TIMER_INDEX(cfn) = checkIncDec(event, CFN_TIMER_INDEX(cfn), 0, maxParam, eeFlags);
|
||||
break;
|
||||
@@ -259,6 +259,7 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
}
|
||||
#endif
|
||||
else if (func == FUNC_SET_TIMER) {
|
||||
// TODO 539 ? TIMEHOUR ?
|
||||
val_max = 59*60+59;
|
||||
drawTimer(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT);
|
||||
}
|
||||
@@ -324,14 +325,6 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
lcdDrawTextAtIndex(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, STR_MMMINV, 0, attr);
|
||||
}
|
||||
}
|
||||
#if defined(PCBX9DP) || defined(PCBX9E)
|
||||
else if (func == FUNC_BACKLIGHT) {
|
||||
drawSlider(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, CFN_PARAM(cfn), 100, attr);
|
||||
INCDEC_SET_FLAG(eeFlags | NO_INCDEC_MARKS);
|
||||
val_min = 0;
|
||||
val_max = 100;
|
||||
}
|
||||
#endif
|
||||
#if defined(GVARS)
|
||||
else if (func == FUNC_ADJUST_GVAR) {
|
||||
switch (CFN_GVAR_MODE(cfn)) {
|
||||
@@ -359,6 +352,7 @@ bool menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF
|
||||
else
|
||||
lcdDrawText(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, "+= ", attr);
|
||||
lcdDrawNumber(lcdNextPos, y, abs(val_displayed), attr|LEFT);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -115,8 +115,9 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
|
||||
if (!(i_flags & NO_DBLKEYS) && (EVT_KEY_MASK(event))) {
|
||||
bool dblkey = true;
|
||||
if (DBLKEYS_PRESSED_RGT_LFT(in)) {
|
||||
if (!isValueAvailable || isValueAvailable(-val))
|
||||
if (!isValueAvailable || isValueAvailable(-val)) {
|
||||
newval = -val;
|
||||
}
|
||||
}
|
||||
else if (DBLKEYS_PRESSED_RGT_UP(in)) {
|
||||
newval = (i_max > stops.max() ? stops.max() : i_max);
|
||||
@@ -297,6 +298,7 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
|
||||
uint8_t menuPageIndex;
|
||||
uint8_t menuPageCount;
|
||||
uint16_t linesCount;
|
||||
uint8_t linesDisplayed;
|
||||
|
||||
int8_t navigate(event_t event, int count, int rows, int columns, bool loop)
|
||||
{
|
||||
@@ -389,7 +391,7 @@ bool check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t
|
||||
menuPageCount = menuTabSize;
|
||||
}
|
||||
|
||||
switch(event) {
|
||||
switch (event) {
|
||||
case EVT_ENTRY:
|
||||
s_editMode = EDIT_MODE_INIT;
|
||||
menuVerticalPosition = MENU_FIRST_LINE_EDIT;
|
||||
@@ -477,7 +479,6 @@ bool check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t
|
||||
INC(menuVerticalPosition, MENU_FIRST_LINE_EDIT, rowcount-1);
|
||||
} while (CURSOR_NOT_ALLOWED_IN_ROW(menuVerticalPosition));
|
||||
menuHorizontalPosition = POS_HORZ_INIT(menuVerticalPosition);
|
||||
|
||||
break;
|
||||
|
||||
case EVT_ROTARY_LEFT:
|
||||
|
||||
@@ -139,9 +139,11 @@ const char * runPopupMenu(event_t event)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
result = popupMenuItems[s_menu_item + (popupMenuOffsetType == MENU_OFFSET_INTERNAL ? popupMenuOffset : 0)];
|
||||
// no break
|
||||
|
||||
case EVT_KEY_BREAK(KEY_EXIT):
|
||||
popupMenuNoItems = 0;
|
||||
s_menu_item = 0;
|
||||
|
||||
@@ -43,17 +43,16 @@ bool menuAboutView(event_t event)
|
||||
static uint8_t screenIndex = 0;
|
||||
static uint8_t greyIndex = 0;
|
||||
|
||||
switch(event)
|
||||
{
|
||||
switch (event) {
|
||||
case EVT_ENTRY:
|
||||
screenIndex = 0;
|
||||
greyIndex = 0;
|
||||
break;
|
||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
case EVT_KEY_FIRST(KEY_PGDN):
|
||||
screenIndex < ABOUT_PARENTS ? screenIndex++ : screenIndex = ABOUT_OPENTX;
|
||||
greyIndex = 0;
|
||||
break;
|
||||
case EVT_KEY_FIRST(KEY_LEFT):
|
||||
case EVT_KEY_FIRST(KEY_PGUP):
|
||||
screenIndex > ABOUT_OPENTX ? screenIndex-- : screenIndex = ABOUT_PARENTS;
|
||||
greyIndex = 0;
|
||||
break;
|
||||
|
||||
@@ -126,8 +126,6 @@ void drawShadow(coord_t x, coord_t y, coord_t w, coord_t h)
|
||||
lcdDrawSolidHorizontalLine(x+2, y+h+1, w, LINE_COLOR);
|
||||
}
|
||||
|
||||
uint8_t linesDisplayed;
|
||||
|
||||
void drawMenuTemplate(const char * title, uint8_t icon, const uint8_t * icons, uint32_t options)
|
||||
{
|
||||
coord_t bodyTop, bodyBottom;
|
||||
|
||||
@@ -80,6 +80,4 @@ void drawTopBar();
|
||||
void drawMainPots();
|
||||
void drawTrims(uint8_t flightMode);
|
||||
|
||||
extern uint8_t linesDisplayed;
|
||||
|
||||
#endif // _WIDGETS_H_
|
||||
|
||||
Reference in New Issue
Block a user