Merge branch 'next' into kilrah/extratrims
This commit is contained in:
@@ -222,6 +222,35 @@ void BitmapBuffer::drawPie(int x0, int y0, int radius, int startAngle, int endAn
|
||||
}
|
||||
}
|
||||
|
||||
void BitmapBuffer::drawMask(coord_t x, coord_t y, BitmapBuffer * mask, LcdFlags flags, coord_t offset, coord_t width)
|
||||
{
|
||||
if (mask == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
coord_t w = mask->getWidth();
|
||||
coord_t height = mask->getHeight();
|
||||
|
||||
if (!width || width > w) {
|
||||
width = w;
|
||||
}
|
||||
|
||||
if (x+width > this->width) {
|
||||
width = this->width-x;
|
||||
}
|
||||
|
||||
display_t color = lcdColorTable[COLOR_IDX(flags)];
|
||||
|
||||
for (coord_t row=0; row<height; row++) {
|
||||
display_t * p = getPixelPtr(x, y+row);
|
||||
display_t * q = mask->getPixelPtr(offset, row);
|
||||
for (coord_t col=0; col<width; col++) {
|
||||
drawAlphaPixel(p, *((uint8_t *)q), color);
|
||||
p++; q++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BitmapBuffer::drawBitmapPattern(coord_t x, coord_t y, const uint8_t * bmp, LcdFlags flags, coord_t offset, coord_t width)
|
||||
{
|
||||
coord_t w = *((uint16_t *)bmp);
|
||||
@@ -247,8 +276,7 @@ void BitmapBuffer::drawBitmapPattern(coord_t x, coord_t y, const uint8_t * bmp,
|
||||
}
|
||||
}
|
||||
|
||||
#define FONT_MAX_HEIGHT 42
|
||||
void BitmapBuffer::drawFontPattern(coord_t x, coord_t y, const uint8_t * font, const uint16_t * spec, int index, LcdFlags flags)
|
||||
void BitmapBuffer::drawCharWithoutCache(coord_t x, coord_t y, const uint8_t * font, const uint16_t * spec, int index, LcdFlags flags)
|
||||
{
|
||||
coord_t offset = spec[index];
|
||||
coord_t width = spec[index+1] - offset;
|
||||
@@ -256,6 +284,14 @@ void BitmapBuffer::drawFontPattern(coord_t x, coord_t y, const uint8_t * font, c
|
||||
lcdNextPos = x + width;
|
||||
}
|
||||
|
||||
void BitmapBuffer::drawCharWithCache(coord_t x, coord_t y, const BitmapBuffer * font, const uint16_t * spec, int index, LcdFlags flags)
|
||||
{
|
||||
coord_t offset = spec[index];
|
||||
coord_t width = spec[index+1] - offset;
|
||||
drawBitmap(x, y, font, offset, 0, width);
|
||||
lcdNextPos = x + width;
|
||||
}
|
||||
|
||||
void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t len, LcdFlags flags)
|
||||
{
|
||||
int width = getTextWidth(s, len, flags);
|
||||
@@ -263,6 +299,7 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t l
|
||||
int fontindex = FONTSIZE(flags) >> 8;
|
||||
const pm_uchar * font = fontsTable[fontindex];
|
||||
const uint16_t * fontspecs = fontspecsTable[fontindex];
|
||||
BitmapBuffer * fontcache = NULL;
|
||||
|
||||
if (flags & RIGHT)
|
||||
x -= width;
|
||||
@@ -271,12 +308,35 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t l
|
||||
|
||||
if ((flags&INVERS) && ((~flags & BLINK) || BLINK_ON_PHASE)) {
|
||||
flags = TEXT_INVERTED_COLOR | (flags & 0x0ffff);
|
||||
if (FONTSIZE(flags) == TINSIZE)
|
||||
if (fontindex == STDSIZE_INDEX) {
|
||||
drawSolidFilledRect(x-INVERT_HORZ_MARGIN, y, INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
drawSolidFilledRect(x+width, y, INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
fontcache = fontCache[1];
|
||||
}
|
||||
else if (fontindex == TINSIZE_INDEX) {
|
||||
drawSolidFilledRect(x-INVERT_HORZ_MARGIN+2, y-INVERT_VERT_MARGIN+2, width+2*INVERT_HORZ_MARGIN-5, INVERT_LINE_HEIGHT-7, TEXT_INVERTED_BGCOLOR);
|
||||
else if (FONTSIZE(flags) == SMLSIZE)
|
||||
}
|
||||
else if (fontindex == SMLSIZE_INDEX) {
|
||||
drawSolidFilledRect(x-INVERT_HORZ_MARGIN, y+1, width+2*INVERT_HORZ_MARGIN-2, INVERT_LINE_HEIGHT-5, TEXT_INVERTED_BGCOLOR);
|
||||
else
|
||||
}
|
||||
else {
|
||||
drawSolidFilledRect(x-INVERT_HORZ_MARGIN, y, width+2*INVERT_HORZ_MARGIN, INVERT_LINE_HEIGHT, TEXT_INVERTED_BGCOLOR);
|
||||
}
|
||||
}
|
||||
else if (!(flags & NO_FONTCACHE)) {
|
||||
if (fontindex == STDSIZE_INDEX) {
|
||||
uint16_t fgColor = lcdColorTable[COLOR_IDX(flags)];
|
||||
uint16_t bgColor = *getPixelPtr(x, y);
|
||||
if (fgColor == lcdColorTable[TEXT_COLOR_INDEX] && bgColor == lcdColorTable[TEXT_BGCOLOR_INDEX]) {
|
||||
fontcache = fontCache[0];
|
||||
}
|
||||
else if (fgColor == lcdColorTable[TEXT_INVERTED_COLOR_INDEX] && bgColor == lcdColorTable[TEXT_INVERTED_BGCOLOR_INDEX]) {
|
||||
fontcache = fontCache[1];
|
||||
}
|
||||
else {
|
||||
// TRACE("No cache for \"%s\"", s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const coord_t orig_x = x;
|
||||
@@ -295,7 +355,17 @@ void BitmapBuffer::drawSizedText(coord_t x, coord_t y, const char * s, uint8_t l
|
||||
break;
|
||||
}
|
||||
else if (c >= 0x20) {
|
||||
drawFontPattern(x, y, font, fontspecs, getMappedChar(c), flags);
|
||||
#if defined(TRANSLATIONS_FR)
|
||||
if (c >= 0x80 && c <= 0x85) {
|
||||
c = 0x20 + 115 + c - 0x80;
|
||||
}
|
||||
#endif
|
||||
if (fontcache) {
|
||||
drawCharWithCache(x, y, fontcache, fontspecs, getMappedChar(c), flags);
|
||||
}
|
||||
else {
|
||||
drawCharWithoutCache(x, y, font, fontspecs, getMappedChar(c), flags);
|
||||
}
|
||||
x = lcdNextPos;
|
||||
}
|
||||
else if (c == 0x1F) { // X-coord prefix
|
||||
@@ -391,6 +461,19 @@ BitmapBuffer * BitmapBuffer::load(const char * filename)
|
||||
return load_stb(filename);
|
||||
}
|
||||
|
||||
BitmapBuffer * BitmapBuffer::loadMask(const char * filename)
|
||||
{
|
||||
BitmapBuffer * bitmap = BitmapBuffer::load(filename);
|
||||
if (bitmap) {
|
||||
display_t * p = bitmap->getData();
|
||||
for (int i = bitmap->getWidth() * bitmap->getHeight(); i > 0; i--) {
|
||||
*((uint8_t *)p) = OPACITY_MAX - ((*p) >> 12);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
FIL imgFile __DMA;
|
||||
|
||||
BitmapBuffer * BitmapBuffer::load_bmp(const char * filename)
|
||||
|
||||
@@ -174,9 +174,15 @@ class BitmapBuffer: public BitmapBufferBase<uint16_t>
|
||||
|
||||
static BitmapBuffer * load(const char * filename);
|
||||
|
||||
static BitmapBuffer * loadMask(const char * filename);
|
||||
|
||||
void drawMask(coord_t x, coord_t y, BitmapBuffer * mask, LcdFlags flags, coord_t offset=0, coord_t width=0);
|
||||
|
||||
void drawBitmapPattern(coord_t x, coord_t y, const uint8_t * bmp, LcdFlags flags, coord_t offset=0, coord_t width=0);
|
||||
|
||||
void drawFontPattern(coord_t x, coord_t y, const uint8_t * font, const uint16_t * spec, int index, LcdFlags flags);
|
||||
void drawCharWithoutCache(coord_t x, coord_t y, const uint8_t * font, const uint16_t * spec, int index, LcdFlags flags);
|
||||
|
||||
void drawCharWithCache(coord_t x, coord_t y, const BitmapBuffer * font, const uint16_t * spec, int index, LcdFlags flags);
|
||||
|
||||
void drawText(coord_t x, coord_t y, const char * s, LcdFlags flags)
|
||||
{
|
||||
|
||||
@@ -32,18 +32,6 @@ const uint8_t LBM_DOT[] = {
|
||||
#include "mask_dot.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURRENT_BG[] = {
|
||||
#include "mask_current_bg.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURRENT_SHADOW[] = {
|
||||
#include "mask_current_shadow.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURRENT_DOT[] = {
|
||||
#include "mask_current_dot.lbm"
|
||||
};
|
||||
|
||||
/*
|
||||
* Main view bitmaps
|
||||
*/
|
||||
@@ -104,208 +92,10 @@ const uint8_t LBM_RSCALE[] = {
|
||||
#include "mask_rscale.lbm"
|
||||
};
|
||||
|
||||
/*
|
||||
* Stats / Debug menu bitmaps
|
||||
*/
|
||||
|
||||
const uint8_t LBM_STATS_ICON[] = {
|
||||
#include "mask_stats.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_STATS_GRAPH_ICON[] = {
|
||||
#include "mask_stats_graph.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_STATS_TIME_ICON[] = {
|
||||
#include "mask_stats_time.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_STATS_DEBUG_ICON[] = {
|
||||
#include "mask_stats_debug.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_STATS_ANALOGS_ICON[] = {
|
||||
#include "mask_analogs.lbm"
|
||||
};
|
||||
|
||||
const uint8_t * const LBM_STATS_ICONS[] = {
|
||||
LBM_STATS_ICON,
|
||||
LBM_STATS_GRAPH_ICON,
|
||||
LBM_STATS_TIME_ICON,
|
||||
LBM_STATS_ANALOGS_ICON,
|
||||
#if defined(DEBUG_TRACE_BUFFER)
|
||||
LBM_STATS_DEBUG_ICON
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* Radio menu bitmaps
|
||||
*/
|
||||
|
||||
const uint8_t LBM_RADIO_ICON[] = {
|
||||
#include "mask_menu_radio.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_RADIO_SETUP_ICON[] = {
|
||||
#include "mask_radio_setup.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SD_BROWSER_ICON[] = {
|
||||
#include "mask_sd_browser.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_GLOBAL_FUNCTIONS_ICON[] = {
|
||||
#include "mask_global_functions.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TRAINER_ICON[] = {
|
||||
#include "mask_trainer.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CALIBRATION_ICON[] = {
|
||||
#include "mask_calibration.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_VERSION_ICON[] = {
|
||||
#include "mask_version.lbm"
|
||||
};
|
||||
|
||||
const uint8_t * const LBM_RADIO_ICONS[] = {
|
||||
LBM_RADIO_ICON,
|
||||
LBM_RADIO_SETUP_ICON,
|
||||
LBM_SD_BROWSER_ICON,
|
||||
LBM_GLOBAL_FUNCTIONS_ICON,
|
||||
LBM_TRAINER_ICON,
|
||||
LBM_CALIBRATION_ICON,
|
||||
LBM_VERSION_ICON
|
||||
};
|
||||
|
||||
/*
|
||||
* Model menu bitmaps
|
||||
*/
|
||||
|
||||
const uint8_t LBM_MODEL_ICON[] = {
|
||||
#include "mask_menu_model.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MODEL_SETUP_ICON[] = {
|
||||
#include "mask_model_setup.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_HELI_ICON[] = {
|
||||
#include "mask_heli.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_FLIGHT_MODES_ICON[] = {
|
||||
#include "mask_flight_modes.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_INPUTS_ICON[] = {
|
||||
#include "mask_inputs.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MIXER_ICON[] = {
|
||||
#include "mask_mixer.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_OUTPUTS_ICON[] = {
|
||||
#include "mask_outputs.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_CURVES_ICON[] = {
|
||||
#include "mask_curves.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_GVARS_ICON[] = {
|
||||
#include "mask_gvars.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_LOGICAL_SWITCHES_ICON[] = {
|
||||
#include "mask_logical_switches.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_SPECIAL_FUNCTIONS_ICON[] = {
|
||||
#include "mask_special_functions.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_LUA_SCRIPTS_ICON[] = {
|
||||
#include "mask_lua_scripts.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TELEMETRY_ICON[] = {
|
||||
#include "mask_telemetry.lbm"
|
||||
};
|
||||
|
||||
const uint8_t * const LBM_MODEL_ICONS[] = {
|
||||
LBM_MODEL_ICON,
|
||||
LBM_MODEL_SETUP_ICON,
|
||||
CASE_HELI(LBM_HELI_ICON)
|
||||
CASE_FLIGHT_MODES(LBM_FLIGHT_MODES_ICON)
|
||||
LBM_INPUTS_ICON,
|
||||
LBM_MIXER_ICON,
|
||||
LBM_OUTPUTS_ICON,
|
||||
CASE_CURVES(LBM_CURVES_ICON)
|
||||
CASE_GVARS(LBM_GVARS_ICON)
|
||||
LBM_LOGICAL_SWITCHES_ICON,
|
||||
LBM_SPECIAL_FUNCTIONS_ICON,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
LBM_LUA_SCRIPTS_ICON,
|
||||
#endif
|
||||
LBM_TELEMETRY_ICON
|
||||
};
|
||||
|
||||
/*
|
||||
* UI (theme / layout / widgets bitmaps
|
||||
*/
|
||||
|
||||
const uint8_t LBM_MAINVIEWS_ICON[] = {
|
||||
#include "mask_mainviews.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MAINVIEWS_TOPBAR_ICON[] = {
|
||||
#include "mask_mainviews_topbar.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MAINVIEWS_1_ICON[] = {
|
||||
#include "mask_mainviews_1.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MAINVIEWS_2_ICON[] = {
|
||||
#include "mask_mainviews_2.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MAINVIEWS_3_ICON[] = {
|
||||
#include "mask_mainviews_3.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MAINVIEWS_4_ICON[] = {
|
||||
#include "mask_mainviews_4.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MAINVIEWS_5_ICON[] = {
|
||||
#include "mask_mainviews_5.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_MAINVIEWS_ADD_ICON[] = {
|
||||
#include "mask_mainviews_add.lbm"
|
||||
};
|
||||
|
||||
const uint8_t * const LBM_MAINVIEWS_ICONS[] = {
|
||||
LBM_MAINVIEWS_1_ICON,
|
||||
LBM_MAINVIEWS_2_ICON,
|
||||
LBM_MAINVIEWS_3_ICON,
|
||||
LBM_MAINVIEWS_4_ICON,
|
||||
LBM_MAINVIEWS_5_ICON
|
||||
};
|
||||
|
||||
/*
|
||||
* Model selection screen bitmaps
|
||||
*/
|
||||
|
||||
const uint8_t LBM_LIBRARY_ICON[] = {
|
||||
#include "mask_library.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_LIBRARY_SLOT[] = {
|
||||
#include "mask_library_slot.lbm"
|
||||
};
|
||||
|
||||
@@ -24,9 +24,6 @@
|
||||
// Header bitmaps
|
||||
extern const uint8_t LBM_TOPMENU_POLYGON[];
|
||||
extern const uint8_t LBM_DOT[];
|
||||
extern const uint8_t LBM_CURRENT_BG[];
|
||||
extern const uint8_t LBM_CURRENT_SHADOW[];
|
||||
extern const uint8_t LBM_CURRENT_DOT[];
|
||||
|
||||
// Main view icons
|
||||
extern const uint8_t LBM_TOPMENU_USB[];
|
||||
@@ -40,34 +37,11 @@ extern const uint8_t LBM_TOPMENU_TXBATT[];
|
||||
extern const uint8_t LBM_HTRIM_FRAME[];
|
||||
extern const uint8_t LBM_VTRIM_FRAME[];
|
||||
extern const uint8_t LBM_TRIM_SHADOW[];
|
||||
extern const uint8_t LBM_RADIO_ICON[];
|
||||
extern const uint8_t LBM_MODEL_ICON[];
|
||||
extern const uint8_t LBM_TIMER_BACKGROUND[];
|
||||
extern const uint8_t LBM_TIMER[];
|
||||
extern const uint8_t LBM_RSCALE[];
|
||||
|
||||
// Menu icons
|
||||
extern const uint8_t * const LBM_RADIO_ICONS[];
|
||||
extern const uint8_t * const LBM_MODEL_ICONS[];
|
||||
extern const uint8_t * const LBM_STATS_ICONS[];
|
||||
extern const uint8_t LBM_RADIO_ICON[];
|
||||
extern const uint8_t LBM_SD_BROWSER_ICON[];
|
||||
extern const uint8_t LBM_CALIBRATION_ICON[];
|
||||
extern const uint8_t LBM_INPUTS_ICON[];
|
||||
extern const uint8_t LBM_MIXER_ICON[];
|
||||
extern const uint8_t LBM_CURVES_ICON[];
|
||||
extern const uint8_t LBM_LUA_SCRIPTS_ICON[];
|
||||
extern const uint8_t LBM_TELEMETRY_ICON[];
|
||||
extern const uint8_t LBM_STATS_ANALOGS_ICON[];
|
||||
|
||||
// UI (theme / layout / widgets bitmaps
|
||||
extern const uint8_t LBM_MAINVIEWS_ICON[];
|
||||
extern const uint8_t LBM_MAINVIEWS_TOPBAR_ICON[];
|
||||
extern const uint8_t LBM_MAINVIEWS_ADD_ICON[];
|
||||
extern const uint8_t * const LBM_MAINVIEWS_ICONS[];
|
||||
|
||||
// Model selection icons
|
||||
extern const uint8_t LBM_LIBRARY_ICON[];
|
||||
extern const uint8_t LBM_LIBRARY_SLOT[];
|
||||
extern const uint8_t LBM_ACTIVE_MODEL[];
|
||||
extern const uint8_t LBM_LIBRARY_CURSOR[];
|
||||
|
||||
@@ -78,3 +78,23 @@ pm_uchar font_stdsizebold[] = {
|
||||
|
||||
const uint16_t * const fontspecsTable[16] = { font_stdsize_specs, font_tinsize_specs, font_smlsize_specs, font_midsize_specs, font_dblsize_specs, font_xxlsize_specs, font_stdsizebold_specs };
|
||||
const uint8_t * const fontsTable[16] = { font_stdsize, font_tinsize, font_smlsize, font_midsize, font_dblsize, font_xxlsize, font_stdsizebold };
|
||||
|
||||
BitmapBuffer * fontCache[2];
|
||||
|
||||
BitmapBuffer * createFontCache(const uint8_t * font, LcdFlags fg, LcdFlags bg)
|
||||
{
|
||||
coord_t width = *((uint16_t *)font);
|
||||
coord_t height = *(((uint16_t *)font)+1);
|
||||
|
||||
BitmapBuffer * buffer = new BitmapBuffer(BMP_RGB565, width, height);
|
||||
buffer->clear(bg);
|
||||
buffer->drawBitmapPattern(0, 0, font, fg);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void loadFontCache()
|
||||
{
|
||||
fontCache[0] = createFontCache(fontsTable[0], TEXT_COLOR, TEXT_BGCOLOR);
|
||||
fontCache[1] = createFontCache(fontsTable[0], TEXT_INVERTED_COLOR, TEXT_INVERTED_BGCOLOR);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,12 @@
|
||||
#define MENU_TITLE_NEXT_POS (lcdNextPos + 10)
|
||||
#define MENU_INIT_VPOS -1
|
||||
|
||||
#if defined(HELI) && defined(GVARS) && defined(LUA_MODEL_SCRIPTS)
|
||||
#define MENU_ICONS_SPACING 31
|
||||
#else
|
||||
#define MENU_ICONS_SPACING 33
|
||||
#endif
|
||||
|
||||
#define SUBMENU_LINE_WIDTH 230
|
||||
|
||||
#define LOAD_MODEL_BITMAP()
|
||||
|
||||
+42
-31
@@ -24,58 +24,69 @@
|
||||
#include "bitmapbuffer.h"
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#define LCD_W 480
|
||||
#define LCD_H 272
|
||||
#define LCD_COLS 30
|
||||
#define LCD_W 480
|
||||
#define LCD_H 272
|
||||
#define LCD_COLS 30
|
||||
#else
|
||||
#define LCD_W 800
|
||||
#define LCD_H 480
|
||||
#define LCD_COLS 40
|
||||
#define LCD_W 800
|
||||
#define LCD_H 480
|
||||
#define LCD_COLS 40
|
||||
#endif
|
||||
|
||||
#define CENTER
|
||||
|
||||
#define lcdint_t int32_t
|
||||
#define lcdint_t int32_t
|
||||
|
||||
#define BSS 0x00
|
||||
#define BSS 0x00
|
||||
|
||||
/* lcd common flags */
|
||||
#define BLINK 0x01
|
||||
#define BLINK 0x01
|
||||
|
||||
/* drawText flags */
|
||||
#define INVERS 0x02
|
||||
#define LEFT 0x00
|
||||
#define CENTERED 0x04 /* align left */
|
||||
#define RIGHT 0x08 /* align left */
|
||||
#define INVERS 0x02
|
||||
#define LEFT 0x00
|
||||
#define CENTERED 0x04 /* align left */
|
||||
#define RIGHT 0x08 /* align left */
|
||||
|
||||
/* drawNumber flags */
|
||||
#define LEADING0 0x10
|
||||
#define PREC1 0x20
|
||||
#define PREC2 0x30
|
||||
#define MODE(flags) ((((int8_t)(flags) & 0x30) - 0x10) >> 4)
|
||||
#define LEADING0 0x10
|
||||
#define PREC1 0x20
|
||||
#define PREC2 0x30
|
||||
#define MODE(flags) ((((int8_t)(flags) & 0x30) - 0x10) >> 4)
|
||||
|
||||
#define ZCHAR 0x10
|
||||
#define ZCHAR 0x10
|
||||
|
||||
/* rect, square flags */
|
||||
#define ROUND 0x04
|
||||
#define ROUND 0x04
|
||||
|
||||
/* telemetry flags */
|
||||
#define NO_UNIT 0x40
|
||||
#define NO_UNIT 0x40
|
||||
|
||||
#define FONTSIZE(x) ((x) & 0x0700)
|
||||
#define TINSIZE 0x0100
|
||||
#define SMLSIZE 0x0200
|
||||
#define MIDSIZE 0x0300
|
||||
#define DBLSIZE 0x0400
|
||||
#define XXLSIZE 0x0500
|
||||
#define BOLD 0x0600
|
||||
#define VERTICAL 0x0800
|
||||
enum FontSizeIndex {
|
||||
STDSIZE_INDEX,
|
||||
TINSIZE_INDEX,
|
||||
SMLSIZE_INDEX,
|
||||
MIDSIZE_INDEX,
|
||||
DBLSIZE_INDEX,
|
||||
XXLSIZE_INDEX,
|
||||
BOLDSTDSIZE_INDEX,
|
||||
};
|
||||
|
||||
#define TIMEBLINK 0x1000
|
||||
#define TIMEHOUR 0x2000
|
||||
#define STREXPANDED 0x4000
|
||||
#define FONTSIZE(x) ((x) & 0x0700)
|
||||
#define TINSIZE (TINSIZE_INDEX << 8)
|
||||
#define SMLSIZE (SMLSIZE_INDEX << 8)
|
||||
#define MIDSIZE (MIDSIZE_INDEX << 8)
|
||||
#define DBLSIZE (DBLSIZE_INDEX << 8)
|
||||
#define XXLSIZE (XXLSIZE_INDEX << 8)
|
||||
#define BOLD (BOLDSTDSIZE_INDEX << 8)
|
||||
|
||||
#define VERTICAL 0x0800
|
||||
#define TIMEBLINK 0x1000
|
||||
#define TIMEHOUR 0x2000
|
||||
#define NO_FONTCACHE 0x8000
|
||||
|
||||
#include "colors.h"
|
||||
|
||||
#define DISPLAY_PIXELS_COUNT (LCD_W*LCD_H)
|
||||
#define DISPLAY_BUFFER_SIZE (sizeof(display_t)*DISPLAY_PIXELS_COUNT)
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
bool menuGeneralCustomFunctions(evt_t event)
|
||||
{
|
||||
MENU(STR_MENUGLOBALFUNCS, LBM_RADIO_ICONS, menuTabGeneral, e_GeneralCustomFunctions, NUM_CFN, { NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
||||
MENU(STR_MENUGLOBALFUNCS, RADIO_ICONS, menuTabGeneral, e_GeneralCustomFunctions, NUM_CFN, { NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
||||
return menuCustomFunctions(event, g_eeGeneral.customFn, globalFunctionsContext);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ void drawPots()
|
||||
|
||||
bool menuCommonCalib(evt_t event)
|
||||
{
|
||||
drawScreenTemplate(NULL, LBM_CALIBRATION_ICON, OPTION_MENU_NO_FOOTER);
|
||||
drawMenuTemplate(NULL, ICON_RADIO_CALIBRATION, NULL, OPTION_MENU_NO_FOOTER);
|
||||
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) { // get low and high vals for sticks and trims
|
||||
int16_t vt = anaIn(i);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
enum menuGeneralHwItems {
|
||||
ITEM_SETUP_HW_CALIBRATION,
|
||||
@@ -58,7 +58,7 @@ enum menuGeneralHwItems {
|
||||
|
||||
bool menuGeneralHardware(evt_t event)
|
||||
{
|
||||
MENU(STR_HARDWARE, LBM_RADIO_ICONS, menuTabGeneral, e_Hardware, ITEM_SETUP_HW_MAX, { 0, LABEL(Sticks), 0, 0, 0, 0, LABEL(Pots), POTS_ROWS, LABEL(Switches), SWITCHES_ROWS, BLUETOOTH_ROWS 0 });
|
||||
MENU(STR_HARDWARE, RADIO_ICONS, menuTabGeneral, e_Hardware, ITEM_SETUP_HW_MAX, { 0, LABEL(Sticks), 0, 0, 0, 0, LABEL(Pots), POTS_ROWS, LABEL(Switches), SWITCHES_ROWS, BLUETOOTH_ROWS 0 });
|
||||
|
||||
uint8_t sub = menuVerticalPosition;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ BitmapBuffer * currentBitmap = NULL;
|
||||
|
||||
bool menuGeneralSdManagerInfo(evt_t event)
|
||||
{
|
||||
SIMPLE_SUBMENU(STR_SD_INFO_TITLE, LBM_SD_BROWSER_ICON, 1);
|
||||
SIMPLE_SUBMENU(STR_SD_INFO_TITLE, ICON_RADIO_SD_BROWSER, 1);
|
||||
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, 2*FH, STR_SD_TYPE);
|
||||
lcdDrawText(100, 2*FH, SD_IS_HC() ? STR_SDHC_CARD : STR_SD_CARD);
|
||||
@@ -170,7 +170,7 @@ bool menuGeneralSdManager(evt_t _event)
|
||||
}
|
||||
|
||||
evt_t event = (EVT_KEY_MASK(_event) == KEY_ENTER ? 0 : _event);
|
||||
SIMPLE_MENU(SD_IS_HC() ? STR_SDHC_CARD : STR_SD_CARD, LBM_RADIO_ICONS, menuTabGeneral, e_Sd, reusableBuffer.sdmanager.count);
|
||||
SIMPLE_MENU(SD_IS_HC() ? STR_SDHC_CARD : STR_SD_CARD, RADIO_ICONS, menuTabGeneral, e_Sd, reusableBuffer.sdmanager.count);
|
||||
|
||||
int index = menuVerticalPosition-menuVerticalOffset;
|
||||
|
||||
|
||||
@@ -73,12 +73,14 @@ enum menuGeneralSetupItems {
|
||||
ITEM_SETUP_INACTIVITY_ALARM,
|
||||
// ITEM_SETUP_MEMORY_WARNING,
|
||||
ITEM_SETUP_ALARM_WARNING,
|
||||
// ITEM_SETUP_BACKLIGHT_LABEL,
|
||||
// ITEM_SETUP_BACKLIGHT_MODE,
|
||||
// ITEM_SETUP_BACKLIGHT_DELAY,
|
||||
// ITEM_SETUP_BRIGHTNESS,
|
||||
// ITEM_SETUP_FLASH_BEEP,
|
||||
ITEM_SETUP_BACKLIGHT_LABEL,
|
||||
ITEM_SETUP_BACKLIGHT_MODE,
|
||||
ITEM_SETUP_BACKLIGHT_DELAY,
|
||||
ITEM_SETUP_BRIGHTNESS,
|
||||
ITEM_SETUP_DIM_LEVEL,
|
||||
ITEM_SETUP_FLASH_BEEP,
|
||||
// CASE_SPLASH_PARAM(ITEM_SETUP_DISABLE_SPLASH)
|
||||
CASE_GPS(ITEM_SETUP_LABEL_GPS)
|
||||
CASE_GPS(ITEM_SETUP_TIMEZONE)
|
||||
CASE_GPS(ITEM_SETUP_GPSFORMAT)
|
||||
CASE_PXX(ITEM_SETUP_COUNTRYCODE)
|
||||
@@ -114,12 +116,14 @@ bool menuGeneralSetup(evt_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
MENU(STR_MENURADIOSETUP, LBM_RADIO_ICONS, menuTabGeneral, e_Setup, ITEM_SETUP_MAX, {
|
||||
MENU(STR_MENURADIOSETUP, RADIO_ICONS, menuTabGeneral, e_Setup, ITEM_SETUP_MAX, {
|
||||
2|NAVIGATION_LINE_BY_LINE, 2|NAVIGATION_LINE_BY_LINE, 1|NAVIGATION_LINE_BY_LINE,
|
||||
LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0,
|
||||
CASE_VARIO(LABEL(VARIO)) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0)
|
||||
CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0)
|
||||
LABEL(ALARMS), 0, 0, 0, CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, 0, 0, 0, 0, 1/*to force edit mode*/ });
|
||||
LABEL(ALARMS), 0, 0, 0,
|
||||
LABEL(BACKLIGHT), 0, 0, 0, 0, 0,
|
||||
CASE_GPS(LABEL(GPS)) CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, 0, 0, 0, 0, 1/*to force edit mode*/ });
|
||||
|
||||
int sub = menuVerticalPosition;
|
||||
|
||||
@@ -372,7 +376,6 @@ bool menuGeneralSetup(evt_t event)
|
||||
if (attr) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
|
||||
break;
|
||||
|
||||
#if 0
|
||||
case ITEM_SETUP_BACKLIGHT_LABEL:
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_BACKLIGHT_LABEL);
|
||||
break;
|
||||
@@ -394,21 +397,20 @@ bool menuGeneralSetup(evt_t event)
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_BRIGHTNESS:
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_BRIGHTNESS);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_BLONBRIGHTNESS);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, 100-g_eeGeneral.backlightBright, attr|LEFT) ;
|
||||
if (attr) {
|
||||
uint8_t b = 100 - g_eeGeneral.backlightBright;
|
||||
CHECK_INCDEC_GENVAR(event, b, 0, 100);
|
||||
CHECK_INCDEC_GENVAR(event, b, 5, 100);
|
||||
g_eeGeneral.backlightBright = 100 - b;
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_BACKLIGHT_COLOR:
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_BLCOLOR);
|
||||
drawSlider(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.backlightColor, 20, attr);
|
||||
if (attr) g_eeGeneral.backlightColor = checkIncDec(event, g_eeGeneral.backlightColor, 0, 20, EE_GENERAL | NO_INCDEC_MARKS);
|
||||
case ITEM_SETUP_DIM_LEVEL:
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_BLOFFBRIGHTNESS);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.blOffBright, attr|LEFT) ;
|
||||
if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.blOffBright, 5, 100);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
case ITEM_SETUP_DISABLE_SPLASH:
|
||||
@@ -425,6 +427,10 @@ bool menuGeneralSetup(evt_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
case ITEM_SETUP_LABEL_GPS:
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_GPS);
|
||||
break;
|
||||
|
||||
case ITEM_SETUP_TIMEZONE:
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, STR_TIMEZONE);
|
||||
lcdDrawNumber(RADIO_SETUP_2ND_COLUMN, y, g_eeGeneral.timezone, attr|LEFT);
|
||||
|
||||
@@ -30,7 +30,7 @@ bool menuGeneralTrainer(evt_t event)
|
||||
uint8_t y;
|
||||
bool slave = SLAVE_MODE();
|
||||
|
||||
MENU(STR_MENUTRAINER, LBM_RADIO_ICONS, menuTabGeneral, e_Trainer, (slave ? 0 : 6), { 2, 2, 2, 2, 0/*, 0*/ });
|
||||
MENU(STR_MENUTRAINER, RADIO_ICONS, menuTabGeneral, e_Trainer, (slave ? 0 : 6), { 2, 2, 2, 2, 0/*, 0*/ });
|
||||
|
||||
if (slave) {
|
||||
// TODO lcd_putsCenter(5*FH, STR_SLAVE, TEXT_COLOR);
|
||||
|
||||
@@ -22,18 +22,25 @@
|
||||
|
||||
bool menuGeneralVersion(evt_t event)
|
||||
{
|
||||
SIMPLE_MENU(STR_MENUVERSION, LBM_RADIO_ICONS, menuTabGeneral, e_Vers, 0);
|
||||
DEBUG_TIMER_START(debugTimerVersion);
|
||||
DEBUG_TIMER_START(debugTimerSimpleMenu);
|
||||
SIMPLE_MENU(STR_MENUVERSION, RADIO_ICONS, menuTabGeneral, e_Vers, 0);
|
||||
DEBUG_TIMER_STOP(debugTimerSimpleMenu);
|
||||
|
||||
DEBUG_TIMER_START(debugTimerDrawText);
|
||||
DEBUG_TIMER_START(debugTimerDrawText1);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + FH, vers_stamp);
|
||||
DEBUG_TIMER_STOP(debugTimerDrawText1);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 2*FH, date_stamp);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 3*FH, time_stamp);
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 4*FH, eeprom_stamp);
|
||||
DEBUG_TIMER_STOP(debugTimerDrawText);
|
||||
|
||||
// TODO EEPROM erase + backup
|
||||
// lcd_putsCenter(MENU_HEADER_HEIGHT+6*FH, STR_EEBACKUP);
|
||||
// if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
// backupEeprom();
|
||||
// }
|
||||
|
||||
DEBUG_TIMER_STOP(debugTimerVersion);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ bool menuModelCurveOne(evt_t event)
|
||||
CurveData & crv = g_model.curves[s_curveChan];
|
||||
int8_t * points = curveAddress(s_curveChan);
|
||||
|
||||
SUBMENU_WITH_OPTIONS(STR_MENUCURVE, LBM_CURVES_ICON, crv.type==CURVE_TYPE_CUSTOM ? 6 : 5, OPTION_MENU_NO_FOOTER, { 0, 0, 0, 0, uint8_t(5+crv.points-1), uint8_t(5+crv.points-1) });
|
||||
SUBMENU_WITH_OPTIONS(STR_MENUCURVE, ICON_MODEL_CURVES, crv.type==CURVE_TYPE_CUSTOM ? 6 : 5, OPTION_MENU_NO_FOOTER, { 0, 0, 0, 0, uint8_t(5+crv.points-1), uint8_t(5+crv.points-1) });
|
||||
drawStringWithIndex(50, 3+FH, STR_CV, s_curveChan+1, MENU_TITLE_COLOR);
|
||||
lcdDrawSolidFilledRect(0, MENU_FOOTER_TOP, 250, MENU_FOOTER_HEIGHT, HEADER_BGCOLOR);
|
||||
|
||||
@@ -335,7 +335,7 @@ void editCurveRef(coord_t x, coord_t y, CurveRef & curve, evt_t event, uint8_t a
|
||||
|
||||
bool menuModelCurvesAll(evt_t event)
|
||||
{
|
||||
SIMPLE_MENU(STR_MENUCURVES, LBM_MODEL_ICONS, menuTabModel, e_CurvesAll, MAX_CURVES);
|
||||
SIMPLE_MENU(STR_MENUCURVES, MODEL_ICONS, menuTabModel, e_CurvesAll, MAX_CURVES);
|
||||
|
||||
int8_t sub = menuVerticalPosition;
|
||||
|
||||
|
||||
@@ -30,7 +30,18 @@
|
||||
void onCustomFunctionsFileSelectionMenu(const char * result)
|
||||
{
|
||||
int sub = menuVerticalPosition;
|
||||
CustomFunctionData * cf = &g_model.customFn[sub];
|
||||
CustomFunctionData * cf;
|
||||
uint8_t eeFlags;
|
||||
|
||||
if (menuHandlers[menuLevel] == menuModelCustomFunctions) {
|
||||
cf = &g_model.customFn[sub];
|
||||
eeFlags = EE_MODEL;
|
||||
}
|
||||
else {
|
||||
cf = &g_eeGeneral.customFn[sub];
|
||||
eeFlags = EE_GENERAL;
|
||||
}
|
||||
|
||||
uint8_t func = CFN_FUNC(cf);
|
||||
|
||||
if (result == STR_UPDATE_LIST) {
|
||||
@@ -95,6 +106,35 @@ void onCustomFunctionsMenu(const char *result)
|
||||
}
|
||||
}
|
||||
|
||||
void onAdjustGvarSourceLongEnterPress(const char * result)
|
||||
{
|
||||
CustomFunctionData * cfn = &g_model.customFn[menuVerticalPosition];
|
||||
|
||||
if (result == STR_CONSTANT) {
|
||||
CFN_GVAR_MODE(cfn) = FUNC_ADJUST_GVAR_CONSTANT;
|
||||
CFN_PARAM(cfn) = 0;
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
else if (result == STR_MIXSOURCE) {
|
||||
CFN_GVAR_MODE(cfn) = FUNC_ADJUST_GVAR_SOURCE;
|
||||
CFN_PARAM(cfn) = 0;
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
else if (result == STR_GLOBALVAR) {
|
||||
CFN_GVAR_MODE(cfn) = FUNC_ADJUST_GVAR_GVAR;
|
||||
CFN_PARAM(cfn) = 0;
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
else if (result == STR_INCDEC) {
|
||||
CFN_GVAR_MODE(cfn) = FUNC_ADJUST_GVAR_INCDEC;
|
||||
CFN_PARAM(cfn) = 0;
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
else {
|
||||
onSourceLongEnterPress(result);
|
||||
}
|
||||
}
|
||||
|
||||
bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunctionsContext & functionsContext)
|
||||
{
|
||||
uint32_t sub = menuVerticalPosition;
|
||||
@@ -134,7 +174,9 @@ bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
||||
LcdFlags active = (attr && s_editMode>0);
|
||||
switch (j) {
|
||||
case 0:
|
||||
if (active || AUTOSWITCH_ENTER_LONG()) CHECK_INCDEC_SWITCH(event, CFN_SWITCH(cfn), SWSRC_FIRST, SWSRC_LAST, eeFlags, isSwitchAvailableInCustomFunctions);
|
||||
if (active || AUTOSWITCH_ENTER_LONG()) {
|
||||
CHECK_INCDEC_SWITCH(event, CFN_SWITCH(cfn), SWSRC_FIRST, SWSRC_LAST, eeFlags, isSwitchAvailableInCustomFunctions);
|
||||
}
|
||||
putsSwitches(MODEL_CUSTOM_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | ((functionsContext.activeSwitches & ((MASK_CFN_TYPE)1 << k)) ? BOLD : 0));
|
||||
break;
|
||||
|
||||
@@ -254,7 +296,10 @@ bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
||||
else if (func == FUNC_PLAY_VALUE) {
|
||||
val_max = MIXSRC_LAST_TELEM;
|
||||
putsMixerSource(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||
if (active) {
|
||||
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE);
|
||||
INCDEC_ENABLE_CHECK(functions == g_eeGeneral.customFn ? isSourceAvailableInGlobalFunctions : isSourceAvailable);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (func == FUNC_VOLUME) {
|
||||
@@ -290,26 +335,22 @@ bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
||||
case FUNC_ADJUST_GVAR_SOURCE:
|
||||
val_max = MIXSRC_LAST_CH;
|
||||
putsMixerSource(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE);
|
||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||
if (active) {
|
||||
INCDEC_SET_FLAG(eeFlags | INCDEC_SOURCE);
|
||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||
}
|
||||
break;
|
||||
case FUNC_ADJUST_GVAR_GVAR:
|
||||
val_max = MAX_GVARS-1;
|
||||
drawStringWithIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, STR_GV, val_displayed+1, attr);
|
||||
break;
|
||||
default: // FUNC_ADJUST_GVAR_INC
|
||||
val_max = 1;
|
||||
lcdDrawTextAtIndex(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, PSTR("\003-=1+=1"), val_displayed, attr);
|
||||
break;
|
||||
}
|
||||
|
||||
if (attr && event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
killEvents(event);
|
||||
s_editMode = !s_editMode;
|
||||
active = true;
|
||||
CFN_GVAR_MODE(cfn) += 1;
|
||||
CFN_GVAR_MODE(cfn) &= 0x03;
|
||||
val_displayed = 0;
|
||||
val_min = -100; val_max = +100;
|
||||
if (val_displayed < 0)
|
||||
lcdDrawText(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "-= ", attr);
|
||||
else
|
||||
lcdDrawText(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, "+= ", attr);
|
||||
lcdDrawNumber(lcdNextPos, y, abs(val_displayed), attr|LEFT);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -317,8 +358,21 @@ bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
||||
REPEAT_LAST_CURSOR_MOVE(0);
|
||||
}
|
||||
|
||||
if (active) {
|
||||
if (active || event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
CFN_PARAM(cfn) = CHECK_INCDEC_PARAM(event, val_displayed, val_min, val_max);
|
||||
if (func == FUNC_ADJUST_GVAR && attr && event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||
killEvents(event);
|
||||
if (CFN_GVAR_MODE(cfn) != FUNC_ADJUST_GVAR_CONSTANT)
|
||||
POPUP_MENU_ADD_ITEM(STR_CONSTANT);
|
||||
if (CFN_GVAR_MODE(cfn) != FUNC_ADJUST_GVAR_SOURCE)
|
||||
POPUP_MENU_ADD_ITEM(STR_MIXSOURCE);
|
||||
if (CFN_GVAR_MODE(cfn) != FUNC_ADJUST_GVAR_GVAR)
|
||||
POPUP_MENU_ADD_ITEM(STR_GLOBALVAR);
|
||||
if (CFN_GVAR_MODE(cfn) != FUNC_ADJUST_GVAR_INCDEC)
|
||||
POPUP_MENU_ADD_ITEM(STR_INCDEC);
|
||||
popupMenuHandler = onAdjustGvarSourceLongEnterPress;
|
||||
s_editMode = EDIT_MODIFY_FIELD;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -353,6 +407,6 @@ bool menuCustomFunctions(evt_t event, CustomFunctionData * functions, CustomFunc
|
||||
|
||||
bool menuModelCustomFunctions(evt_t event)
|
||||
{
|
||||
MENU(STR_MENUCUSTOMFUNC, LBM_MODEL_ICONS, menuTabModel, e_CustomFunctions, NUM_CFN, { NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
||||
MENU(STR_MENUCUSTOMFUNC, MODEL_ICONS, menuTabModel, e_CustomFunctions, NUM_CFN, { NAVIGATION_LINE_BY_LINE|4/*repeated*/ });
|
||||
return menuCustomFunctions(event, g_model.customFn, modelFunctionsContext);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ bool menuModelCustomScriptOne(evt_t event)
|
||||
|
||||
// drawStringWithIndex(lcdLastPos+FW, 0, "LUA", s_currIdx+1, 0);
|
||||
|
||||
SUBMENU(STR_MENUCUSTOMSCRIPTS, LBM_LUA_SCRIPTS_ICON, 3+scriptInputsOutputs[s_currIdx].inputsCount, { 0, 0, LABEL(inputs), 0/*repeated*/ });
|
||||
SUBMENU(STR_MENUCUSTOMSCRIPTS, ICON_MODEL_LUA_SCRIPTS, 3+scriptInputsOutputs[s_currIdx].inputsCount, { 0, 0, LABEL(inputs), 0/*repeated*/ });
|
||||
|
||||
int8_t sub = menuVerticalPosition;
|
||||
|
||||
@@ -127,7 +127,7 @@ bool menuModelCustomScripts(evt_t event)
|
||||
// lcdDrawNumber(19*FW, 0, luaGetMemUsed(), 0);
|
||||
// lcdDrawText(19*FW+1, 0, STR_BYTES);
|
||||
|
||||
MENU(STR_MENUCUSTOMSCRIPTS, LBM_MODEL_ICONS, menuTabModel, e_CustomScripts, MAX_SCRIPTS, { NAVIGATION_LINE_BY_LINE|3/*repeated*/ });
|
||||
MENU(STR_MENUCUSTOMSCRIPTS, MODEL_ICONS, menuTabModel, e_CustomScripts, MAX_SCRIPTS, { NAVIGATION_LINE_BY_LINE|3/*repeated*/ });
|
||||
|
||||
int8_t sub = menuVerticalPosition;
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ bool isTrimModeAvailable(int mode)
|
||||
|
||||
bool menuModelFlightModesAll(evt_t event)
|
||||
{
|
||||
MENU(STR_MENUFLIGHTPHASES, LBM_MODEL_ICONS, menuTabModel, e_FlightModesAll, MAX_FLIGHT_MODES+1, { NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, 0});
|
||||
MENU(STR_MENUFLIGHTPHASES, MODEL_ICONS, menuTabModel, e_FlightModesAll, MAX_FLIGHT_MODES+1, { NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_FLIGHT_MODES_LAST, 0});
|
||||
|
||||
int sub = menuVerticalPosition;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ void onGVARSMenu(const char *result)
|
||||
|
||||
bool menuModelGVars(evt_t event)
|
||||
{
|
||||
MENU(STR_MENUGLOBALVARS, LBM_MODEL_ICONS, menuTabModel, e_GVars/* TODO, first2seconds ? CHECK_FLAG_NO_SCREEN_INDEX : 0*/, MAX_GVARS, { NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES});
|
||||
MENU(STR_MENUGLOBALVARS, MODEL_ICONS, menuTabModel, e_GVars/* TODO, first2seconds ? CHECK_FLAG_NO_SCREEN_INDEX : 0*/, MAX_GVARS, { NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES, NAVIGATION_LINE_BY_LINE|MAX_FLIGHT_MODES});
|
||||
|
||||
int sub = menuVerticalPosition;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ enum menuModelHeliItems {
|
||||
|
||||
bool menuModelHeli(evt_t event)
|
||||
{
|
||||
SIMPLE_MENU(STR_MENUHELISETUP, LBM_MODEL_ICONS, menuTabModel, e_Heli, ITEM_HELI_MAX);
|
||||
SIMPLE_MENU(STR_MENUHELISETUP, MODEL_ICONS, menuTabModel, e_Heli, ITEM_HELI_MAX);
|
||||
|
||||
int sub = menuVerticalPosition;
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ bool menuModelExpoOne(evt_t event)
|
||||
{
|
||||
ExpoData * ed = expoAddress(s_currIdx);
|
||||
|
||||
SUBMENU_WITH_OPTIONS(STR_MENUINPUTS, LBM_INPUTS_ICON, EXPO_FIELD_MAX, OPTION_MENU_NO_FOOTER|OPTION_MENU_NO_SCROLLBAR, { 0, 0, (ed->srcRaw >= MIXSRC_FIRST_TELEM ? (uint8_t)1 : (uint8_t)0), 0, 0, CASE_CURVES(CURVE_ROWS) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0 /*, ...*/});
|
||||
SUBMENU_WITH_OPTIONS(STR_MENUINPUTS, ICON_MODEL_INPUTS, EXPO_FIELD_MAX, OPTION_MENU_NO_FOOTER|OPTION_MENU_NO_SCROLLBAR, { 0, 0, (ed->srcRaw >= MIXSRC_FIRST_TELEM ? (uint8_t)1 : (uint8_t)0), 0, 0, CASE_CURVES(CURVE_ROWS) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0 /*, ...*/});
|
||||
lcdDrawSizedText(50, 3+FH, g_model.inputNames[ed->chn], LEN_INPUT_NAME, ZCHAR|MENU_TITLE_COLOR);
|
||||
lcdDrawSolidFilledRect(0, MENU_FOOTER_TOP, 230, MENU_FOOTER_HEIGHT, HEADER_BGCOLOR);
|
||||
|
||||
@@ -233,7 +233,7 @@ bool menuModelExpoOne(evt_t event)
|
||||
|
||||
case EXPO_FIELD_SOURCE:
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, NO_INDENT(STR_SOURCE));
|
||||
putsMixerSource(EXPO_ONE_2ND_COLUMN, y, ed->srcRaw, STREXPANDED|(menuHorizontalPosition==0?attr:0));
|
||||
putsMixerSource(EXPO_ONE_2ND_COLUMN, y, ed->srcRaw, menuHorizontalPosition==0 ? attr : 0);
|
||||
if (attr && menuHorizontalPosition==0) ed->srcRaw = checkIncDec(event, ed->srcRaw, INPUTSRC_FIRST, INPUTSRC_LAST, EE_MODEL|INCDEC_SOURCE|NO_INCDEC_MARKS, isInputSourceAvailable);
|
||||
if (ed->srcRaw >= MIXSRC_FIRST_TELEM) {
|
||||
putsTelemetryChannelValue(EXPO_ONE_2ND_COLUMN+60, y, (ed->srcRaw - MIXSRC_FIRST_TELEM)/3, convertTelemValue(ed->srcRaw - MIXSRC_FIRST_TELEM + 1, ed->scale), LEFT|(menuHorizontalPosition==1?attr:0));
|
||||
@@ -370,7 +370,7 @@ bool menuModelExposAll(evt_t event)
|
||||
uint8_t chn = expoAddress(s_currIdx)->chn + 1;
|
||||
|
||||
int linesCount = getExposLinesCount();
|
||||
SIMPLE_MENU(STR_MENUINPUTS, LBM_MODEL_ICONS, menuTabModel, e_InputsAll, linesCount);
|
||||
SIMPLE_MENU(STR_MENUINPUTS, MODEL_ICONS, menuTabModel, e_InputsAll, linesCount);
|
||||
|
||||
switch (event) {
|
||||
case EVT_ENTRY:
|
||||
|
||||
@@ -93,7 +93,7 @@ void onLimitsMenu(const char *result)
|
||||
|
||||
bool menuModelLimits(evt_t event)
|
||||
{
|
||||
MENU(STR_MENULIMITS, LBM_MODEL_ICONS, menuTabModel, e_Limits, NUM_CHNOUT+1,
|
||||
MENU(STR_MENULIMITS, MODEL_ICONS, menuTabModel, e_Limits, NUM_CHNOUT+1,
|
||||
{ NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW,
|
||||
NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW,
|
||||
NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW, NAVIGATION_LINE_BY_LINE|ITEM_LIMITS_MAXROW,
|
||||
|
||||
@@ -77,7 +77,7 @@ bool menuModelLogicalSwitches(evt_t event)
|
||||
{
|
||||
INCDEC_DECLARE_VARS(EE_MODEL);
|
||||
|
||||
MENU(STR_MENULOGICALSWITCHES, LBM_MODEL_ICONS, menuTabModel, e_LogicalSwitches, NUM_LOGICAL_SWITCH, { NAVIGATION_LINE_BY_LINE|LS_FIELD_LAST/*repeated...*/} );
|
||||
MENU(STR_MENULOGICALSWITCHES, MODEL_ICONS, menuTabModel, e_LogicalSwitches, NUM_LOGICAL_SWITCH, { NAVIGATION_LINE_BY_LINE|LS_FIELD_LAST/*repeated...*/} );
|
||||
|
||||
int k = 0;
|
||||
int sub = menuVerticalPosition;
|
||||
|
||||
@@ -174,7 +174,7 @@ bool menuModelMixOne(evt_t event)
|
||||
{
|
||||
MixData * md2 = mixAddress(s_currIdx) ;
|
||||
|
||||
SUBMENU_WITH_OPTIONS(STR_MIXER, LBM_MIXER_ICON, MIX_FIELD_COUNT, OPTION_MENU_NO_SCROLLBAR, { 0, 0, 0, 0, 0, CASE_CURVES(1) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0 /*, ...*/ });
|
||||
SUBMENU_WITH_OPTIONS(STR_MIXER, ICON_MODEL_MIXER, MIX_FIELD_COUNT, OPTION_MENU_NO_SCROLLBAR, { 0, 0, 0, 0, 0, CASE_CURVES(1) CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0 /*, ...*/ });
|
||||
putsChn(50, 3+FH, md2->destCh+1, MENU_TITLE_COLOR);
|
||||
|
||||
// The separation line between 2 columns
|
||||
@@ -201,7 +201,7 @@ bool menuModelMixOne(evt_t event)
|
||||
break;
|
||||
case MIX_FIELD_SOURCE:
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, y, NO_INDENT(STR_SOURCE));
|
||||
putsMixerSource(MIXES_2ND_COLUMN, y, md2->srcRaw, STREXPANDED|attr);
|
||||
putsMixerSource(MIXES_2ND_COLUMN, y, md2->srcRaw, attr);
|
||||
if (attr) CHECK_INCDEC_MODELSOURCE(event, md2->srcRaw, 1, MIXSRC_LAST);
|
||||
break;
|
||||
case MIX_FIELD_WEIGHT:
|
||||
@@ -341,7 +341,7 @@ bool menuModelMixAll(evt_t event)
|
||||
uint8_t chn = mixAddress(s_currIdx)->destCh + 1;
|
||||
|
||||
int linesCount = getMixesLinesCount();
|
||||
SIMPLE_MENU(STR_MIXER, LBM_MODEL_ICONS, menuTabModel, e_MixAll, linesCount);
|
||||
SIMPLE_MENU(STR_MIXER, MODEL_ICONS, menuTabModel, e_MixAll, linesCount);
|
||||
|
||||
switch (event) {
|
||||
case EVT_ENTRY:
|
||||
|
||||
@@ -218,7 +218,7 @@ bool menuModelSelect(evt_t event)
|
||||
}
|
||||
|
||||
// Header
|
||||
theme->drawTopbarBackground(LBM_LIBRARY_ICON);
|
||||
theme->drawTopbarBackground(ICON_LIBRARY);
|
||||
|
||||
// Body
|
||||
lcdDrawSolidFilledRect(0, MENU_HEADER_HEIGHT, CATEGORIES_WIDTH, LCD_H-MENU_HEADER_HEIGHT-MENU_FOOTER_HEIGHT, TITLE_BGCOLOR);
|
||||
|
||||
@@ -105,7 +105,7 @@ void editTimerMode(int timerIdx, coord_t y, LcdFlags attr, evt_t event)
|
||||
}
|
||||
drawStringWithIndex(MENUS_MARGIN_LEFT, y, STR_TIMER, timerIdx+1);
|
||||
putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, (menuHorizontalPosition<=0 ? attr : 0));
|
||||
putsTimer(MODEL_SETUP_2ND_COLUMN+50, y, timer->start, (menuHorizontalPosition==1 ? attr|TIMEHOUR : TIMEHOUR));
|
||||
putsTimer(MODEL_SETUP_2ND_COLUMN+50, y, timer->start, (menuHorizontalPosition!=0 ? attr|TIMEHOUR : TIMEHOUR));
|
||||
if (attr && s_editMode>0) {
|
||||
switch (menuHorizontalPosition) {
|
||||
case 0:
|
||||
@@ -186,7 +186,7 @@ bool menuModelSetup(evt_t event)
|
||||
g_model.moduleData[INTERNAL_MODULE].ppm.pulsePol = XJT_EXTERNAL_ANTENNA;
|
||||
}
|
||||
|
||||
MENU(STR_MENUSETUP, LBM_MODEL_ICONS, menuTabModel, e_ModelSetup, ITEM_MODEL_SETUP_MAX,
|
||||
MENU(STR_MENUSETUP, MODEL_ICONS, menuTabModel, e_ModelSetup, ITEM_MODEL_SETUP_MAX,
|
||||
{ 0, 0, TIMERS_ROWS, 0, 1, 0, 0,
|
||||
LABEL(Throttle), 0, 0, 0,
|
||||
LABEL(PreflightCheck), 0, 0, SW_WARN_ITEMS(), POT_WARN_ITEMS(), NAVIGATION_LINE_BY_LINE|(NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS-1), 0,
|
||||
@@ -203,14 +203,10 @@ bool menuModelSetup(evt_t event)
|
||||
IF_EXTERNAL_MODULE_XJT(FAILSAFE_ROWS(EXTERNAL_MODULE)),
|
||||
LABEL(Trainer), 0, TRAINER_CHANNELS_ROWS(), IF_TRAINER_ON(2) });
|
||||
|
||||
#if (defined(DSM2) || defined(PXX))
|
||||
if (menuEvent) {
|
||||
moduleFlag[0] = 0;
|
||||
#if NUM_MODULES > 1
|
||||
moduleFlag[1] = 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
int sub = menuVerticalPosition;
|
||||
|
||||
@@ -757,7 +753,7 @@ bool menuModelFailsafe(evt_t event)
|
||||
}
|
||||
}
|
||||
|
||||
SIMPLE_SUBMENU_WITH_OPTIONS("FAILSAFE", LBM_STATS_ANALOGS_ICON, NUM_CHANNELS(g_moduleIdx), OPTION_MENU_NO_SCROLLBAR);
|
||||
SIMPLE_SUBMENU_WITH_OPTIONS("FAILSAFE", ICON_STATS_ANALOGS, NUM_CHANNELS(g_moduleIdx), OPTION_MENU_NO_SCROLLBAR);
|
||||
drawStringWithIndex(50, 3+FH, "Module", g_moduleIdx+1, MENU_TITLE_COLOR);
|
||||
|
||||
#define COL_W (LCD_W/2)
|
||||
|
||||
@@ -127,7 +127,7 @@ bool menuModelSensor(evt_t event)
|
||||
{
|
||||
TelemetrySensor * sensor = &g_model.telemetrySensors[s_currIdx];
|
||||
|
||||
SUBMENU("SENSOR", LBM_TELEMETRY_ICON, SENSOR_FIELD_MAX, { 0, 0, sensor->type == TELEM_TYPE_CALCULATED ? (uint8_t)0 : (uint8_t)1, SENSOR_UNIT_ROWS, SENSOR_PREC_ROWS, SENSOR_PARAM1_ROWS, SENSOR_PARAM2_ROWS, SENSOR_PARAM3_ROWS, SENSOR_PARAM4_ROWS, 0, 0, 0, 0, 0 });
|
||||
SUBMENU("SENSOR", ICON_MODEL_TELEMETRY, SENSOR_FIELD_MAX, { 0, 0, sensor->type == TELEM_TYPE_CALCULATED ? (uint8_t)0 : (uint8_t)1, SENSOR_UNIT_ROWS, SENSOR_PREC_ROWS, SENSOR_PARAM1_ROWS, SENSOR_PARAM2_ROWS, SENSOR_PARAM3_ROWS, SENSOR_PARAM4_ROWS, 0, 0, 0, 0, 0 });
|
||||
lcdDrawNumber(lcdNextPos, 3, s_currIdx+1, MENU_TITLE_COLOR|LEFT);
|
||||
putsTelemetryChannelValue(50, 3+FH, s_currIdx, getValue(MIXSRC_FIRST_TELEM+3*s_currIdx), MENU_TITLE_COLOR|LEFT);
|
||||
|
||||
@@ -407,7 +407,7 @@ bool menuModelTelemetry(evt_t event)
|
||||
}
|
||||
}
|
||||
|
||||
MENU(STR_MENUTELEMETRY, LBM_MODEL_ICONS, menuTabModel, e_Telemetry, ITEM_TELEMETRY_MAX, { TELEMETRY_TYPE_ROWS RSSI_ROWS SENSORS_ROWS VARIO_ROWS });
|
||||
MENU(STR_MENUTELEMETRY, MODEL_ICONS, menuTabModel, e_Telemetry, ITEM_TELEMETRY_MAX, { TELEMETRY_TYPE_ROWS RSSI_ROWS SENSORS_ROWS VARIO_ROWS });
|
||||
|
||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||
coord_t y = MENU_CONTENT_TOP + i*FH;
|
||||
|
||||
+89
-10
@@ -60,11 +60,50 @@ extern evt_t menuEvent;
|
||||
void chainMenu(MenuHandlerFunc newMenu);
|
||||
/// goto given Menu, store current menu in menuStack
|
||||
void pushMenu(MenuHandlerFunc newMenu);
|
||||
/// return to last menu in menustack
|
||||
/// return to last menu in menuStack
|
||||
void popMenu();
|
||||
|
||||
enum MenuIcons {
|
||||
ICON_OPENTX,
|
||||
ICON_RADIO,
|
||||
ICON_RADIO_SETUP,
|
||||
ICON_RADIO_SD_BROWSER,
|
||||
ICON_RADIO_GLOBAL_FUNCTIONS,
|
||||
ICON_RADIO_TRAINER,
|
||||
ICON_RADIO_HARDWARE,
|
||||
ICON_RADIO_CALIBRATION,
|
||||
ICON_RADIO_VERSION,
|
||||
ICON_MODEL,
|
||||
ICON_MODEL_SETUP,
|
||||
ICON_MODEL_HELI,
|
||||
ICON_MODEL_FLIGHT_MODES,
|
||||
ICON_MODEL_INPUTS,
|
||||
ICON_MODEL_MIXER,
|
||||
ICON_MODEL_OUTPUTS,
|
||||
ICON_MODEL_CURVES,
|
||||
ICON_MODEL_GVARS,
|
||||
ICON_MODEL_LOGICAL_SWITCHES,
|
||||
ICON_MODEL_SPECIAL_FUNCTIONS,
|
||||
ICON_MODEL_LUA_SCRIPTS,
|
||||
ICON_MODEL_TELEMETRY,
|
||||
ICON_LIBRARY,
|
||||
ICON_THEME,
|
||||
ICON_THEME_SETUP,
|
||||
ICON_THEME_VIEW1,
|
||||
ICON_THEME_VIEW2,
|
||||
ICON_THEME_VIEW3,
|
||||
ICON_THEME_VIEW4,
|
||||
ICON_THEME_VIEW5,
|
||||
ICON_THEME_ADD_VIEW,
|
||||
ICON_STATS,
|
||||
ICON_STATS_THROTTLE_GRAPH,
|
||||
ICON_STATS_TIMERS,
|
||||
ICON_STATS_ANALOGS,
|
||||
ICON_STATS_DEBUG,
|
||||
MENUS_ICONS_COUNT
|
||||
};
|
||||
|
||||
enum EnumTabModel {
|
||||
// e_ModelSelect,
|
||||
e_ModelSetup,
|
||||
CASE_HELI(e_Heli)
|
||||
CASE_FLIGHT_MODES(e_FlightModesAll)
|
||||
@@ -81,6 +120,44 @@ enum EnumTabModel {
|
||||
CASE_FRSKY(e_Telemetry)
|
||||
};
|
||||
|
||||
const uint8_t RADIO_ICONS[] = {
|
||||
ICON_RADIO,
|
||||
ICON_RADIO_SETUP,
|
||||
ICON_RADIO_SD_BROWSER,
|
||||
ICON_RADIO_GLOBAL_FUNCTIONS,
|
||||
ICON_RADIO_TRAINER,
|
||||
ICON_RADIO_HARDWARE,
|
||||
ICON_RADIO_VERSION
|
||||
};
|
||||
|
||||
const uint8_t MODEL_ICONS[] = {
|
||||
ICON_MODEL,
|
||||
ICON_MODEL_SETUP,
|
||||
CASE_HELI(ICON_MODEL_HELI)
|
||||
CASE_FLIGHT_MODES(ICON_MODEL_FLIGHT_MODES)
|
||||
ICON_MODEL_INPUTS,
|
||||
ICON_MODEL_MIXER,
|
||||
ICON_MODEL_OUTPUTS,
|
||||
CASE_CURVES(ICON_MODEL_CURVES)
|
||||
CASE_GVARS(ICON_MODEL_GVARS)
|
||||
ICON_MODEL_LOGICAL_SWITCHES,
|
||||
ICON_MODEL_SPECIAL_FUNCTIONS,
|
||||
#if defined(LUA_MODEL_SCRIPTS)
|
||||
ICON_MODEL_LUA_SCRIPTS,
|
||||
#endif
|
||||
ICON_MODEL_TELEMETRY
|
||||
};
|
||||
|
||||
const uint8_t STATS_ICONS[] = {
|
||||
ICON_STATS,
|
||||
ICON_STATS_THROTTLE_GRAPH,
|
||||
ICON_STATS_TIMERS,
|
||||
ICON_STATS_ANALOGS,
|
||||
#if defined(DEBUG_TRACE_BUFFER)
|
||||
ICON_STATS_DEBUG
|
||||
#endif
|
||||
};
|
||||
|
||||
bool menuModelSetup(evt_t event);
|
||||
bool menuModelHeli(evt_t event);
|
||||
bool menuModelFlightModesAll(evt_t event);
|
||||
@@ -287,12 +364,12 @@ bool check_submenu_simple(check_event_t event, uint8_t maxrow);
|
||||
MENU_TAB(__VA_ARGS__); \
|
||||
if (event == EVT_ENTRY || event == EVT_ENTRY_UP) TRACE("Menu %s displayed ...", title); \
|
||||
if (!check(event, menu, tab, tabCount, mstate_tab, DIM(mstate_tab)-1, lines_count)) return false; \
|
||||
drawMenuTemplate(title, icons);
|
||||
drawMenuTemplate(title, 0, icons, OPTION_MENU_TITLE_BAR);
|
||||
|
||||
#define CUSTOM_MENU_WITH_OPTIONS(title, icons, tab, tabCount, menu, lines_count) \
|
||||
if (event == EVT_ENTRY || event == EVT_ENTRY_UP) TRACE("Menu %s displayed ...", title); \
|
||||
if (!check(event, menu, tab, tabCount, mstate_tab, DIM(mstate_tab)-1, lines_count)) return false; \
|
||||
drawMenuTemplate(title, icons);
|
||||
drawMenuTemplate(title, 0, icons, OPTION_MENU_TITLE_BAR);
|
||||
|
||||
#define MENU(title, icons, tab, menu, lines_count, ...) \
|
||||
MENU_WITH_OPTIONS(title, icons, tab, DIM(tab), menu, lines_count, __VA_ARGS__)
|
||||
@@ -300,7 +377,7 @@ bool check_submenu_simple(check_event_t event, uint8_t maxrow);
|
||||
#define SIMPLE_MENU_WITH_OPTIONS(title, icons, tab, tabCount, menu, lines_count) \
|
||||
if (event == EVT_ENTRY || event == EVT_ENTRY_UP) TRACE("Menu %s displayed ...", title); \
|
||||
if (!check_simple(event, menu, tab, tabCount, lines_count)) return false; \
|
||||
drawMenuTemplate(title, icons);
|
||||
drawMenuTemplate(title, 0, icons, OPTION_MENU_TITLE_BAR);
|
||||
|
||||
#define SIMPLE_MENU(title, icons, tab, menu, lines_count) \
|
||||
SIMPLE_MENU_WITH_OPTIONS(title, icons, tab, DIM(tab), menu, lines_count)
|
||||
@@ -308,24 +385,24 @@ bool check_submenu_simple(check_event_t event, uint8_t maxrow);
|
||||
#define SUBMENU(title, icon, lines_count, ...) \
|
||||
MENU_TAB(__VA_ARGS__); \
|
||||
if (!check(event, 0, NULL, 0, mstate_tab, DIM(mstate_tab)-1, lines_count)) return false; \
|
||||
drawScreenTemplate(title, icon);
|
||||
drawMenuTemplate(title, icon);
|
||||
|
||||
#define SUBMENU_WITH_OPTIONS(title, icon, lines_count, options, ...) \
|
||||
MENU_TAB(__VA_ARGS__); \
|
||||
if (!check(event, 0, NULL, 0, mstate_tab, DIM(mstate_tab)-1, lines_count)) return false; \
|
||||
drawScreenTemplate(title, icon, options);
|
||||
drawMenuTemplate(title, icon, NULL, options);
|
||||
|
||||
#define CUSTOM_SUBMENU_WITH_OPTIONS(title, icon, lines_count, options) \
|
||||
if (!check(event, 0, NULL, 0, mstate_tab, DIM(mstate_tab)-1, lines_count)) return false; \
|
||||
drawScreenTemplate(title, icon, options);
|
||||
drawMenuTemplate(title, icon, NULL, options);
|
||||
|
||||
#define SIMPLE_SUBMENU(title, icon, lines_count) \
|
||||
if (!check_submenu_simple(event, lines_count)) return false; \
|
||||
drawScreenTemplate(title, icon)
|
||||
drawMenuTemplate(title, icon, NULL)
|
||||
|
||||
#define SIMPLE_SUBMENU_WITH_OPTIONS(title, icon, lines_count, options) \
|
||||
if (!check_submenu_simple(event, lines_count)) return false; \
|
||||
drawScreenTemplate(title, icon, options)
|
||||
drawMenuTemplate(title, icon, NULL, options)
|
||||
|
||||
typedef int select_menu_value_t;
|
||||
|
||||
@@ -451,6 +528,8 @@ void pushModelNotes();
|
||||
typedef int (*FnFuncP) (int x);
|
||||
void drawFunction(FnFuncP fn, int x, int y, int width);
|
||||
|
||||
void onSourceLongEnterPress(const char *result);
|
||||
|
||||
uint8_t switchToMix(uint8_t source);
|
||||
|
||||
#endif // _MENUS_H_
|
||||
|
||||
@@ -323,7 +323,8 @@ int checkIncDec(evt_t event, int val, int i_min, int i_max, unsigned int i_flags
|
||||
}
|
||||
|
||||
#define CURSOR_NOT_ALLOWED_IN_ROW(row) ((int8_t)MAXCOL(row) < 0)
|
||||
#define MAXCOL_RAW(row) ((row) >= 0 && horTab ? pgm_read_byte(horTab+min<int>(row, (int)horTabMax)) : (const uint8_t)0)
|
||||
#define HORTAB(row) (int8_t(row) > (int8_t)horTabMax ? horTab[horTabMax] : horTab[row])
|
||||
#define MAXCOL_RAW(row) (horTab ? HORTAB(row) : (const uint8_t)0)
|
||||
#define MAXCOL(row) (MAXCOL_RAW(row) >= HIDDEN_ROW ? MAXCOL_RAW(row) : (const uint8_t)(MAXCOL_RAW(row) & (~NAVIGATION_LINE_BY_LINE)))
|
||||
#define COLATTR(row) (MAXCOL_RAW(row) == (uint8_t)-1 ? (const uint8_t)0 : (const uint8_t)(MAXCOL_RAW(row) & NAVIGATION_LINE_BY_LINE))
|
||||
#define INC(val, min, max) if (val<max) {val++;} else if (max>min) {val=min;}
|
||||
@@ -542,7 +543,7 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u
|
||||
if (horTab) {
|
||||
linesCount = 0;
|
||||
for (int i=0; i<rowcount; i++) {
|
||||
if (i>horTabMax || horTab[i] != HIDDEN_ROW) {
|
||||
if (HORTAB(i) != HIDDEN_ROW) {
|
||||
linesCount++;
|
||||
}
|
||||
}
|
||||
@@ -553,7 +554,7 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u
|
||||
while (1) {
|
||||
int firstLine = 0;
|
||||
for (int numLines=0; firstLine<rowcount && numLines<menuVerticalOffset; firstLine++) {
|
||||
if (firstLine>=horTabMax || horTab[firstLine] != HIDDEN_ROW) {
|
||||
if (HORTAB(firstLine) != HIDDEN_ROW) {
|
||||
numLines++;
|
||||
}
|
||||
}
|
||||
@@ -563,17 +564,17 @@ bool check(check_event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, u
|
||||
else {
|
||||
int lastLine = firstLine;
|
||||
for (int numLines=0; lastLine<rowcount && numLines<linesDisplayed; lastLine++) {
|
||||
if (lastLine >= horTabMax || horTab[lastLine] != HIDDEN_ROW) {
|
||||
if (HORTAB(lastLine) != HIDDEN_ROW) {
|
||||
numLines++;
|
||||
}
|
||||
}
|
||||
if (menuVerticalPosition >= lastLine || horTab[firstLine] == ORPHAN_ROW) {
|
||||
if (menuVerticalPosition >= lastLine || HORTAB(firstLine) == ORPHAN_ROW) {
|
||||
menuVerticalOffset++;
|
||||
}
|
||||
else {
|
||||
linesCount = menuVerticalOffset + linesDisplayed;
|
||||
for (int i=lastLine; i<rowcount; i++) {
|
||||
if (i > horTabMax || horTab[i] != HIDDEN_ROW) {
|
||||
if (HORTAB(i) != HIDDEN_ROW) {
|
||||
linesCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,8 +151,8 @@ const char * displayPopupMenu(evt_t event)
|
||||
|
||||
int y = (LCD_H - (display_count*(FH+1))) / 2;
|
||||
|
||||
lcdDrawSolidFilledRect(MENU_X, y, MENU_W, display_count * (FH+1), TEXT_BGCOLOR);
|
||||
lcdDrawSolidRect(MENU_X, y, MENU_W, display_count * (FH+1) + 1, 1, ALARM_COLOR);
|
||||
lcdDrawSolidFilledRect(MENU_X, y, MENU_W, display_count * (FH+1) + 1, TEXT_BGCOLOR);
|
||||
lcdDrawSolidRect(MENU_X, y, MENU_W, display_count * (FH+1) + 2, 1, ALARM_COLOR);
|
||||
|
||||
for (uint8_t i=0; i<display_count; i++) {
|
||||
if (i == s_menu_item) {
|
||||
|
||||
@@ -20,14 +20,15 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
const uint8_t * LBM_SCREENS_SETUP_ICONS[] = {
|
||||
LBM_MAINVIEWS_ICON,
|
||||
LBM_MAINVIEWS_TOPBAR_ICON,
|
||||
LBM_MAINVIEWS_ICONS[0],
|
||||
LBM_MAINVIEWS_ICONS[1],
|
||||
LBM_MAINVIEWS_ICONS[2],
|
||||
LBM_MAINVIEWS_ICONS[3],
|
||||
LBM_MAINVIEWS_ICONS[4]
|
||||
uint8_t THEME_ICONS[] = {
|
||||
ICON_THEME,
|
||||
ICON_THEME_SETUP,
|
||||
ICON_THEME_VIEW1,
|
||||
ICON_THEME_VIEW2,
|
||||
ICON_THEME_VIEW3,
|
||||
ICON_THEME_VIEW4,
|
||||
ICON_THEME_VIEW5,
|
||||
ICON_THEME_ADD_VIEW,
|
||||
};
|
||||
|
||||
Layout * currentScreen;
|
||||
@@ -178,7 +179,7 @@ bool menuSettings(const char * title, const T * object, uint32_t i_flags, evt_t
|
||||
mstate_tab[i] = getZoneOptionColumns(&options[i]);
|
||||
}
|
||||
|
||||
CUSTOM_SUBMENU_WITH_OPTIONS(title, LBM_MAINVIEWS_ICON, linesCount, OPTION_MENU_TITLE_BAR);
|
||||
CUSTOM_SUBMENU_WITH_OPTIONS(title, ICON_THEME, linesCount, OPTION_MENU_TITLE_BAR);
|
||||
|
||||
for (int i=0; i<NUM_BODY_LINES+1; i++) {
|
||||
coord_t y = MENU_CONTENT_TOP + i * FH;
|
||||
@@ -423,7 +424,7 @@ bool menuScreensTheme(evt_t event)
|
||||
mstate_tab[2+i] = getZoneOptionColumns(&options[i]);
|
||||
}
|
||||
mstate_tab[2+optionsCount] = 0; // The button for the Topbar setup
|
||||
CUSTOM_MENU_WITH_OPTIONS("User interface", LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, 0, linesCount);
|
||||
CUSTOM_MENU_WITH_OPTIONS("User interface", THEME_ICONS, menuTabScreensSetup, menuPageCount, 0, linesCount);
|
||||
|
||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||
coord_t y = MENU_CONTENT_TOP + i * FH;
|
||||
@@ -438,6 +439,7 @@ bool menuScreensTheme(evt_t event)
|
||||
new_theme->init();
|
||||
loadTheme(new_theme);
|
||||
strncpy(g_eeGeneral.themeName, new_theme->getName(), sizeof(g_eeGeneral.themeName));
|
||||
killEvents(KEY_ENTER);
|
||||
storageDirty(EE_GENERAL);
|
||||
}
|
||||
break;
|
||||
@@ -505,7 +507,7 @@ bool menuScreenSetup(int index, evt_t event)
|
||||
}
|
||||
mstate_tab[3+optionsCount] = 0; // The remove button
|
||||
|
||||
CUSTOM_MENU_WITH_OPTIONS(title, LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, index+1, linesCount);
|
||||
CUSTOM_MENU_WITH_OPTIONS(title, THEME_ICONS, menuTabScreensSetup, menuPageCount, index+1, linesCount);
|
||||
|
||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||
coord_t y = MENU_CONTENT_TOP + i * FH;
|
||||
@@ -589,10 +591,10 @@ int updateMainviewsMenu()
|
||||
{
|
||||
for (int index=1; index<MAX_CUSTOM_SCREENS; index++) {
|
||||
if (customScreens[index]) {
|
||||
LBM_SCREENS_SETUP_ICONS[2+index] = LBM_MAINVIEWS_ICONS[index];
|
||||
THEME_ICONS[2+index] = ICON_THEME_VIEW1+index;
|
||||
}
|
||||
else {
|
||||
LBM_SCREENS_SETUP_ICONS[2+index] = LBM_MAINVIEWS_ADD_ICON;
|
||||
THEME_ICONS[2+index] = ICON_THEME_ADD_VIEW;
|
||||
return 2+index;
|
||||
}
|
||||
}
|
||||
@@ -613,6 +615,6 @@ bool menuScreenAdd(evt_t event)
|
||||
return false;
|
||||
}
|
||||
|
||||
SIMPLE_MENU_WITH_OPTIONS("Add main view", LBM_SCREENS_SETUP_ICONS, menuTabScreensSetup, menuPageCount, menuPageCount-1, 0);
|
||||
SIMPLE_MENU_WITH_OPTIONS("Add main view", THEME_ICONS, menuTabScreensSetup, menuPageCount, menuPageCount-1, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -76,11 +76,6 @@ void Theme::drawBackground() const
|
||||
lcdDrawSolidFilledRect(0, 0, LCD_W, LCD_H, TEXT_BGCOLOR);
|
||||
}
|
||||
|
||||
void Theme::drawAboutBackground() const
|
||||
{
|
||||
drawBackground();
|
||||
}
|
||||
|
||||
void Theme::drawMessageBox(const char * title, const char * text, const char * action, uint32_t type) const
|
||||
{
|
||||
//if (flags & MESSAGEBOX_TYPE_ALERT) {
|
||||
|
||||
@@ -69,9 +69,9 @@ class Theme
|
||||
|
||||
virtual void drawBackground() const;
|
||||
|
||||
virtual void drawAboutBackground() const;
|
||||
virtual void drawTopbarBackground(uint8_t icon) const = 0;
|
||||
|
||||
virtual void drawTopbarBackground(const uint8_t * icon) const = 0;
|
||||
virtual void drawMenuIcon(uint8_t index, uint8_t position, bool selected) const { }
|
||||
|
||||
virtual void drawMessageBox(const char * title, const char * text, const char * action, uint32_t flags) const;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class DarkblueTheme: public Theme
|
||||
{
|
||||
}
|
||||
|
||||
virtual void load() const
|
||||
void loadColors() const
|
||||
{
|
||||
lcdColorTable[TEXT_COLOR_INDEX] = WHITE;
|
||||
lcdColorTable[TEXT_BGCOLOR_INDEX] = RGB(10, 78, 121);
|
||||
@@ -51,27 +51,96 @@ class DarkblueTheme: public Theme
|
||||
lcdColorTable[TRIM_SHADOW_COLOR_INDEX] = RGB(100, 100, 100);
|
||||
lcdColorTable[MAINVIEW_PANES_COLOR_INDEX] = GREY;
|
||||
lcdColorTable[MAINVIEW_GRAPHICS_COLOR_INDEX] = WHITE;
|
||||
lcdColorTable[HEADER_BGCOLOR_INDEX] = RGB(32, 34, 42);
|
||||
lcdColorTable[HEADER_BGCOLOR_INDEX] = BLACK;
|
||||
lcdColorTable[HEADER_ICON_BGCOLOR_INDEX] = BLACK;
|
||||
lcdColorTable[HEADER_CURRENT_BGCOLOR_INDEX] = RGB(10, 78, 121);
|
||||
lcdColorTable[OVERLAY_COLOR_INDEX] = BLACK;
|
||||
}
|
||||
|
||||
void drawTopbarBackground(const uint8_t * icon) const
|
||||
void loadMenuIcon(uint8_t index, const char * filename) const
|
||||
{
|
||||
BitmapBuffer * mask = BitmapBuffer::loadMask(getThemePath(filename));
|
||||
if (mask) {
|
||||
menuIconNormal[index] = new BitmapBuffer(BMP_RGB565, mask->getWidth(), mask->getHeight());
|
||||
menuIconNormal[index]->clear(HEADER_BGCOLOR);
|
||||
menuIconNormal[index]->drawMask(0, 0, mask, HEADER_CURRENT_BGCOLOR);
|
||||
menuIconSelected[index] = new BitmapBuffer(BMP_RGB565, mask->getWidth(), mask->getHeight());
|
||||
menuIconSelected[index]->clear(HEADER_BGCOLOR);
|
||||
menuIconSelected[index]->drawMask(0, 0, mask, MENU_TITLE_COLOR);
|
||||
}
|
||||
}
|
||||
|
||||
void loadMenusIcons() const
|
||||
{
|
||||
loadMenuIcon(ICON_OPENTX, "mask_opentx.png");
|
||||
loadMenuIcon(ICON_RADIO, "mask_menu_radio.png");
|
||||
loadMenuIcon(ICON_RADIO_SETUP, "mask_radio_setup.png");
|
||||
loadMenuIcon(ICON_RADIO_SD_BROWSER, "mask_radio_sd_browser.png");
|
||||
loadMenuIcon(ICON_RADIO_GLOBAL_FUNCTIONS, "mask_radio_global_functions.png");
|
||||
loadMenuIcon(ICON_RADIO_TRAINER, "mask_radio_trainer.png");
|
||||
loadMenuIcon(ICON_RADIO_HARDWARE, "mask_radio_hardware.png");
|
||||
loadMenuIcon(ICON_RADIO_VERSION, "mask_radio_version.png");
|
||||
loadMenuIcon(ICON_MODEL, "mask_menu_model.png");
|
||||
loadMenuIcon(ICON_MODEL_SETUP, "mask_model_setup.png");
|
||||
loadMenuIcon(ICON_MODEL_HELI, "mask_model_heli.png");
|
||||
loadMenuIcon(ICON_MODEL_FLIGHT_MODES, "mask_model_flight_modes.png");
|
||||
loadMenuIcon(ICON_MODEL_INPUTS, "mask_model_inputs.png");
|
||||
loadMenuIcon(ICON_MODEL_MIXER, "mask_model_mixer.png");
|
||||
loadMenuIcon(ICON_MODEL_OUTPUTS, "mask_model_outputs.png");
|
||||
loadMenuIcon(ICON_MODEL_CURVES, "mask_model_curves.png");
|
||||
loadMenuIcon(ICON_MODEL_GVARS, "mask_model_gvars.png");
|
||||
loadMenuIcon(ICON_MODEL_LOGICAL_SWITCHES, "mask_model_logical_switches.png");
|
||||
loadMenuIcon(ICON_MODEL_SPECIAL_FUNCTIONS, "mask_model_special_functions.png");
|
||||
loadMenuIcon(ICON_MODEL_LUA_SCRIPTS, "mask_model_lua_scripts.png");
|
||||
loadMenuIcon(ICON_MODEL_TELEMETRY, "mask_model_telemetry.png");
|
||||
loadMenuIcon(ICON_STATS, "mask_menu_stats.png");
|
||||
loadMenuIcon(ICON_STATS_THROTTLE_GRAPH, "mask_stats_throttle_graph.png");
|
||||
loadMenuIcon(ICON_STATS_TIMERS, "mask_stats_timers.png");
|
||||
loadMenuIcon(ICON_STATS_ANALOGS, "mask_stats_analogs.png");
|
||||
loadMenuIcon(ICON_STATS_DEBUG, "mask_stats_debug.png");
|
||||
loadMenuIcon(ICON_THEME, "mask_menu_theme.png");
|
||||
loadMenuIcon(ICON_THEME_SETUP, "mask_theme_setup.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW1, "mask_theme_view1.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW2, "mask_theme_view2.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW3, "mask_theme_view3.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW4, "mask_theme_view4.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW5, "mask_theme_view5.png");
|
||||
loadMenuIcon(ICON_THEME_ADD_VIEW, "mask_theme_add_view.png");
|
||||
}
|
||||
|
||||
virtual void load() const
|
||||
{
|
||||
loadColors();
|
||||
loadMenusIcons();
|
||||
}
|
||||
|
||||
void drawTopbarBackground(uint8_t icon) const
|
||||
{
|
||||
lcdDrawSolidFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, HEADER_BGCOLOR);
|
||||
lcdDrawSolidFilledRect(0, 0, 41, MENU_HEADER_HEIGHT, HEADER_ICON_BGCOLOR);
|
||||
|
||||
if (icon) {
|
||||
lcdDrawBitmapPattern(5, 7, icon, MENU_TITLE_COLOR);
|
||||
}
|
||||
else {
|
||||
if (icon == ICON_OPENTX) {
|
||||
static BitmapBuffer * thumb = BitmapBuffer::load(getFilePath("topmenu_opentx.bmp"));
|
||||
lcd->drawBitmap(5, 7, thumb);
|
||||
}
|
||||
else {
|
||||
lcd->drawBitmap(5, 7, menuIconSelected[icon]);
|
||||
}
|
||||
|
||||
drawTopbarDatetime();
|
||||
}
|
||||
|
||||
virtual void drawMenuIcon(uint8_t index, uint8_t position, bool selected) const
|
||||
{
|
||||
lcd->drawBitmap(50+position*MENU_ICONS_SPACING, 7, selected ? menuIconSelected[index] : menuIconNormal[index]);
|
||||
}
|
||||
|
||||
protected:
|
||||
static BitmapBuffer * menuIconNormal[MENUS_ICONS_COUNT];
|
||||
static BitmapBuffer * menuIconSelected[MENUS_ICONS_COUNT];
|
||||
};
|
||||
|
||||
BitmapBuffer * DarkblueTheme::menuIconNormal[MENUS_ICONS_COUNT] = { NULL };
|
||||
BitmapBuffer * DarkblueTheme::menuIconSelected[MENUS_ICONS_COUNT] = { NULL };
|
||||
|
||||
const DarkblueTheme darkblueTheme;
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
const uint8_t LBM_TOPMENU_MASK_OPENTX[] = {
|
||||
#include "mask_topmenu_opentx.lbm"
|
||||
};
|
||||
|
||||
const ZoneOption OPTIONS_THEME_DEFAULT[] = {
|
||||
{ "Background color", ZoneOption::Color, OPTION_DEFAULT_VALUE_UNSIGNED(WHITE) },
|
||||
{ "Main color", ZoneOption::Color, OPTION_DEFAULT_VALUE_UNSIGNED(RED) },
|
||||
@@ -68,12 +64,79 @@ class DefaultTheme: public Theme
|
||||
lcdColorTable[OVERLAY_COLOR_INDEX] = BLACK;
|
||||
}
|
||||
|
||||
void loadMenuIcon(uint8_t index, const char * filename) const
|
||||
{
|
||||
BitmapBuffer * mask = BitmapBuffer::loadMask(getThemePath(filename));
|
||||
if (mask) {
|
||||
menuIconNormal[index] = new BitmapBuffer(BMP_RGB565, mask->getWidth(), mask->getHeight());
|
||||
menuIconNormal[index]->clear(HEADER_BGCOLOR);
|
||||
menuIconNormal[index]->drawMask(0, 0, mask, MENU_TITLE_COLOR);
|
||||
menuIconSelected[index] = new BitmapBuffer(BMP_RGB565, mask->getWidth(), mask->getHeight());
|
||||
menuIconSelected[index]->clear(HEADER_CURRENT_BGCOLOR);
|
||||
menuIconSelected[index]->drawMask(0, 0, mask, MENU_TITLE_COLOR);
|
||||
}
|
||||
}
|
||||
|
||||
void loadMenusIcons() const
|
||||
{
|
||||
loadMenuIcon(ICON_OPENTX, "mask_opentx.png");
|
||||
loadMenuIcon(ICON_RADIO, "mask_menu_radio.png");
|
||||
loadMenuIcon(ICON_RADIO_SETUP, "mask_radio_setup.png");
|
||||
loadMenuIcon(ICON_RADIO_SD_BROWSER, "mask_radio_sd_browser.png");
|
||||
loadMenuIcon(ICON_RADIO_GLOBAL_FUNCTIONS, "mask_radio_global_functions.png");
|
||||
loadMenuIcon(ICON_RADIO_TRAINER, "mask_radio_trainer.png");
|
||||
loadMenuIcon(ICON_RADIO_HARDWARE, "mask_radio_hardware.png");
|
||||
loadMenuIcon(ICON_RADIO_VERSION, "mask_radio_version.png");
|
||||
loadMenuIcon(ICON_MODEL, "mask_menu_model.png");
|
||||
loadMenuIcon(ICON_MODEL_SETUP, "mask_model_setup.png");
|
||||
loadMenuIcon(ICON_MODEL_HELI, "mask_model_heli.png");
|
||||
loadMenuIcon(ICON_MODEL_FLIGHT_MODES, "mask_model_flight_modes.png");
|
||||
loadMenuIcon(ICON_MODEL_INPUTS, "mask_model_inputs.png");
|
||||
loadMenuIcon(ICON_MODEL_MIXER, "mask_model_mixer.png");
|
||||
loadMenuIcon(ICON_MODEL_OUTPUTS, "mask_model_outputs.png");
|
||||
loadMenuIcon(ICON_MODEL_CURVES, "mask_model_curves.png");
|
||||
loadMenuIcon(ICON_MODEL_GVARS, "mask_model_gvars.png");
|
||||
loadMenuIcon(ICON_MODEL_LOGICAL_SWITCHES, "mask_model_logical_switches.png");
|
||||
loadMenuIcon(ICON_MODEL_SPECIAL_FUNCTIONS, "mask_model_special_functions.png");
|
||||
loadMenuIcon(ICON_MODEL_LUA_SCRIPTS, "mask_model_lua_scripts.png");
|
||||
loadMenuIcon(ICON_MODEL_TELEMETRY, "mask_model_telemetry.png");
|
||||
loadMenuIcon(ICON_STATS, "mask_menu_stats.png");
|
||||
loadMenuIcon(ICON_STATS_THROTTLE_GRAPH, "mask_stats_throttle_graph.png");
|
||||
loadMenuIcon(ICON_STATS_TIMERS, "mask_stats_timers.png");
|
||||
loadMenuIcon(ICON_STATS_ANALOGS, "mask_stats_analogs.png");
|
||||
loadMenuIcon(ICON_STATS_DEBUG, "mask_stats_debug.png");
|
||||
loadMenuIcon(ICON_THEME, "mask_menu_theme.png");
|
||||
loadMenuIcon(ICON_THEME_SETUP, "mask_theme_setup.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW1, "mask_theme_view1.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW2, "mask_theme_view2.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW3, "mask_theme_view3.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW4, "mask_theme_view4.png");
|
||||
loadMenuIcon(ICON_THEME_VIEW5, "mask_theme_view5.png");
|
||||
loadMenuIcon(ICON_THEME_ADD_VIEW, "mask_theme_add_view.png");
|
||||
|
||||
BitmapBuffer * background = BitmapBuffer::loadMask(getThemePath("mask_currentmenu_bg.png"));
|
||||
BitmapBuffer * shadow = BitmapBuffer::loadMask(getThemePath("mask_currentmenu_shadow.png"));
|
||||
BitmapBuffer * dot = BitmapBuffer::loadMask(getThemePath("mask_currentmenu_dot.png"));
|
||||
|
||||
if (!currentMenuBackground) currentMenuBackground = new BitmapBuffer(BMP_RGB565, 36, 53);
|
||||
currentMenuBackground->drawSolidFilledRect(0, 0, currentMenuBackground->getWidth(), MENU_HEADER_HEIGHT, HEADER_BGCOLOR);
|
||||
currentMenuBackground->drawSolidFilledRect(0, MENU_HEADER_HEIGHT, currentMenuBackground->getWidth(), MENU_TITLE_TOP - MENU_HEADER_HEIGHT, TEXT_BGCOLOR);
|
||||
currentMenuBackground->drawSolidFilledRect(0, MENU_TITLE_TOP, currentMenuBackground->getWidth(), currentMenuBackground->getHeight() - MENU_TITLE_TOP, TITLE_BGCOLOR);
|
||||
currentMenuBackground->drawMask(0, 0, background, HEADER_CURRENT_BGCOLOR);
|
||||
currentMenuBackground->drawMask(0, 0, shadow, TRIM_SHADOW_COLOR);
|
||||
currentMenuBackground->drawMask(10, 39, dot, MENU_TITLE_COLOR);
|
||||
|
||||
delete background;
|
||||
delete shadow;
|
||||
delete dot;
|
||||
}
|
||||
|
||||
virtual void load() const
|
||||
{
|
||||
loadColors();
|
||||
loadMenusIcons();
|
||||
Theme::load();
|
||||
if (!backgroundBitmap) backgroundBitmap = BitmapBuffer::load(getThemePath("mainbg.bmp"));
|
||||
if (!aboutBackgroundBitmap) aboutBackgroundBitmap = BitmapBuffer::load(getThemePath("aboutbg.bmp"));
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -103,33 +166,41 @@ class DefaultTheme: public Theme
|
||||
}
|
||||
}
|
||||
|
||||
virtual void drawAboutBackground() const
|
||||
{
|
||||
lcd->drawBitmap(0, 0, aboutBackgroundBitmap);
|
||||
}
|
||||
|
||||
virtual void drawTopbarBackground(const uint8_t * icon) const
|
||||
virtual void drawTopbarBackground(uint8_t icon) const
|
||||
{
|
||||
lcdDrawSolidFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, HEADER_BGCOLOR);
|
||||
lcdDrawBitmapPattern(0, 0, LBM_TOPMENU_POLYGON, TITLE_BGCOLOR);
|
||||
|
||||
if (icon) {
|
||||
lcdDrawBitmapPattern(5, 7, icon, MENU_TITLE_COLOR);
|
||||
}
|
||||
else {
|
||||
lcdDrawBitmapPattern(4, 10, LBM_TOPMENU_MASK_OPENTX, MENU_TITLE_COLOR);
|
||||
}
|
||||
if (icon == ICON_OPENTX)
|
||||
lcd->drawBitmap(4, 10, menuIconSelected[ICON_OPENTX]);
|
||||
else
|
||||
lcd->drawBitmap(5, 7, menuIconSelected[icon]);
|
||||
|
||||
drawTopbarDatetime();
|
||||
}
|
||||
|
||||
virtual void drawMenuIcon(uint8_t index, uint8_t position, bool selected) const
|
||||
{
|
||||
if (selected) {
|
||||
lcd->drawBitmap(58+position*MENU_ICONS_SPACING-10, 0, currentMenuBackground);
|
||||
lcd->drawBitmap(50+position*MENU_ICONS_SPACING, 7, menuIconSelected[index], MENU_TITLE_COLOR);
|
||||
}
|
||||
else {
|
||||
lcd->drawBitmap(50+position*MENU_ICONS_SPACING, 7, menuIconNormal[index], MENU_TITLE_COLOR);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
static const BitmapBuffer * backgroundBitmap;
|
||||
static const BitmapBuffer * aboutBackgroundBitmap;
|
||||
static BitmapBuffer * menuIconNormal[MENUS_ICONS_COUNT];
|
||||
static BitmapBuffer * menuIconSelected[MENUS_ICONS_COUNT];
|
||||
static BitmapBuffer * currentMenuBackground;
|
||||
};
|
||||
|
||||
const BitmapBuffer * DefaultTheme::backgroundBitmap = NULL;
|
||||
const BitmapBuffer * DefaultTheme::aboutBackgroundBitmap = NULL;
|
||||
BitmapBuffer * DefaultTheme::menuIconNormal[MENUS_ICONS_COUNT] = { NULL };
|
||||
BitmapBuffer * DefaultTheme::menuIconSelected[MENUS_ICONS_COUNT] = { NULL };
|
||||
BitmapBuffer * DefaultTheme::currentMenuBackground = NULL;
|
||||
|
||||
DefaultTheme defaultTheme;
|
||||
Theme * theme = &defaultTheme;
|
||||
|
||||
@@ -53,7 +53,7 @@ void drawTopbarDatetime()
|
||||
|
||||
void drawTopBar()
|
||||
{
|
||||
theme->drawTopbarBackground(NULL);
|
||||
theme->drawTopbarBackground(0);
|
||||
|
||||
// USB icon
|
||||
if (usbPlugged()) {
|
||||
|
||||
@@ -62,8 +62,8 @@ bool menuAboutView(evt_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
theme->drawAboutBackground();
|
||||
theme->drawTopbarBackground(NULL);
|
||||
theme->drawBackground();
|
||||
theme->drawTopbarBackground(0);
|
||||
|
||||
uint8_t screenDuration = 150;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ bool menuStatsGraph(evt_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
MENU("Statistics", LBM_STATS_ICONS, menuTabStats, e_StatsGraph, 0, { 0 });
|
||||
MENU("Statistics", STATS_ICONS, menuTabStats, e_StatsGraph, 0, { 0 });
|
||||
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP, "Session");
|
||||
putsTimer(MENU_STATS_COLUMN1, MENU_CONTENT_TOP, sessionTimer, TIMEHOUR);
|
||||
@@ -111,7 +111,7 @@ bool menuStatsDebug(evt_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
MENU("Debug", LBM_STATS_ICONS, menuTabStats, e_StatsDebug, 0, { 0 });
|
||||
MENU("Debug", STATS_ICONS, menuTabStats, e_StatsDebug, 0, { 0 });
|
||||
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP, "Free Mem");
|
||||
lcdDrawNumber(MENU_STATS_COLUMN1, MENU_CONTENT_TOP, availableMemory(), LEFT, 0, NULL, "b");
|
||||
@@ -142,7 +142,7 @@ bool menuStatsDebug(evt_t event)
|
||||
|
||||
bool menuStatsAnalogs(evt_t event)
|
||||
{
|
||||
MENU("Analogs", LBM_STATS_ICONS, menuTabStats, e_StatsAnalogs, 0, { 0 });
|
||||
MENU("Analogs", STATS_ICONS, menuTabStats, e_StatsAnalogs, 0, { 0 });
|
||||
|
||||
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
|
||||
coord_t y = MENU_CONTENT_TOP + (i/2)*FH;
|
||||
@@ -178,7 +178,7 @@ bool menuStatsTraces(evt_t event)
|
||||
break;
|
||||
}
|
||||
|
||||
SIMPLE_MENU("", LBM_STATS_ICONS, menuTabStats, e_StatsTraces, TRACE_BUFFER_LEN);
|
||||
SIMPLE_MENU("", STATS_ICONS, menuTabStats, e_StatsTraces, TRACE_BUFFER_LEN);
|
||||
|
||||
uint8_t k = 0;
|
||||
int8_t sub = menuVerticalPosition;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
#define TEXT_FILE_MAXSIZE 2048
|
||||
|
||||
@@ -91,7 +91,7 @@ bool menuTextView(evt_t event)
|
||||
{
|
||||
static int lines_count;
|
||||
|
||||
drawScreenTemplate("TEXT VIEWER", NULL);
|
||||
drawMenuTemplate("TEXT VIEWER", ICON_OPENTX);
|
||||
|
||||
switch (event) {
|
||||
case EVT_ENTRY:
|
||||
|
||||
@@ -129,11 +129,11 @@ void drawShadow(coord_t x, coord_t y, coord_t w, coord_t h)
|
||||
|
||||
uint8_t linesDisplayed;
|
||||
|
||||
void drawScreenTemplate(const char * title, const uint8_t * icon, uint32_t options)
|
||||
void drawMenuTemplate(const char * title, uint8_t icon, const uint8_t * icons, uint32_t options)
|
||||
{
|
||||
coord_t bodyTop, bodyBottom;
|
||||
|
||||
theme->drawTopbarBackground(icon);
|
||||
theme->drawTopbarBackground(icons ? icons[0] : icon);
|
||||
|
||||
// Menu title bar
|
||||
if (options & OPTION_MENU_TITLE_BAR) {
|
||||
@@ -144,6 +144,14 @@ void drawScreenTemplate(const char * title, const uint8_t * icon, uint32_t optio
|
||||
if (title) {
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_TITLE_TOP+2, title, MENU_TITLE_COLOR);
|
||||
}
|
||||
if (icons) {
|
||||
for (int i=0; i<menuPageCount; i++) {
|
||||
if (menuPageIndex != i) {
|
||||
theme->drawMenuIcon(icons[i+1], i, false);
|
||||
}
|
||||
}
|
||||
theme->drawMenuIcon(icons[menuPageIndex+1], menuPageIndex, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
linesDisplayed = NUM_BODY_LINES + 1;
|
||||
@@ -171,19 +179,6 @@ void drawScreenTemplate(const char * title, const uint8_t * icon, uint32_t optio
|
||||
}
|
||||
}
|
||||
|
||||
void drawMenuTemplate(const char * title, const uint8_t * const * icons, uint32_t options)
|
||||
{
|
||||
drawScreenTemplate(title, icons[0], OPTION_MENU_TITLE_BAR);
|
||||
|
||||
lcdDrawBitmapPattern(58+menuPageIndex*MENU_ICONS_SPACING-10, 0, LBM_CURRENT_BG, HEADER_CURRENT_BGCOLOR);
|
||||
lcdDrawBitmapPattern(58+menuPageIndex*MENU_ICONS_SPACING-10, 0, LBM_CURRENT_SHADOW, TRIM_SHADOW_COLOR);
|
||||
lcdDrawBitmapPattern(58+menuPageIndex*MENU_ICONS_SPACING, MENU_TITLE_TOP-9, LBM_CURRENT_DOT, MENU_TITLE_COLOR);
|
||||
|
||||
for (int i=0; i<menuPageCount; i++) {
|
||||
lcdDrawBitmapPattern(50+i*MENU_ICONS_SPACING, 7, icons[i+1], MENU_TITLE_COLOR);
|
||||
}
|
||||
}
|
||||
|
||||
select_menu_value_t selectMenuItem(coord_t x, coord_t y, const pm_char * values, select_menu_value_t value, select_menu_value_t min, select_menu_value_t max, LcdFlags attr, evt_t event)
|
||||
{
|
||||
if (attr) value = checkIncDec(event, value, min, max, (menuVerticalPositions[0] == 0) ? EE_MODEL : EE_GENERAL);
|
||||
|
||||
@@ -71,8 +71,7 @@ int16_t editGVarFieldValue(coord_t x, coord_t y, int16_t value, int16_t min, int
|
||||
#endif
|
||||
|
||||
// Screen templates
|
||||
void drawScreenTemplate(const char * title, const uint8_t * icon, uint32_t options=0);
|
||||
void drawMenuTemplate(const char * title, const uint8_t * const * icons, uint32_t options=0);
|
||||
void drawMenuTemplate(const char * title, uint8_t icon, const uint8_t * icons=NULL, uint32_t options=0);
|
||||
void drawSplash();
|
||||
void drawSleepBitmap();
|
||||
void drawShutdownBitmap(uint32_t index);
|
||||
|
||||
@@ -35,20 +35,19 @@ class ModelBitmapWidget: public Widget
|
||||
delete buffer;
|
||||
}
|
||||
|
||||
#define DRAW_SCALED_BITMAP_FIT_WIDTH 1
|
||||
#define DRAW_SCALED_BITMAP_FIT_HEIGHT 2
|
||||
|
||||
void refreshBuffer()
|
||||
{
|
||||
delete buffer;
|
||||
buffer = new BitmapBuffer(BMP_RGB565, zone.w, zone.h);
|
||||
|
||||
if (buffer) {
|
||||
buffer->drawBitmap(0, 0, lcd, zone.x, zone.y, zone.w, zone.h);
|
||||
GET_FILENAME(filename, BITMAPS_PATH, g_model.header.bitmap, BITMAPS_EXT);
|
||||
BitmapBuffer * bitmap = BitmapBuffer::load(filename);
|
||||
if (zone.h >= 96 && zone.w >= 120) {
|
||||
buffer->drawFilledRect(0, 0, zone.w, zone.h, SOLID, MAINVIEW_PANES_COLOR | OPACITY(5));
|
||||
buffer->drawBitmapPattern(6, 4, LBM_MODEL_ICON, MAINVIEW_GRAPHICS_COLOR);
|
||||
static BitmapBuffer * icon = BitmapBuffer::loadMask(getThemePath("mask_menu_model.png"));
|
||||
buffer->drawMask(6, 4, icon, MAINVIEW_GRAPHICS_COLOR);
|
||||
buffer->drawSizedText(45, 10, g_model.header.name, LEN_MODEL_NAME, ZCHAR | SMLSIZE);
|
||||
buffer->drawSolidFilledRect(39, 27, zone.w - 48, 2, MAINVIEW_GRAPHICS_COLOR);
|
||||
if (bitmap) {
|
||||
|
||||
Reference in New Issue
Block a user