Refactoring
This commit is contained in:
@@ -39,21 +39,38 @@ extern const pm_uchar sticks[] PROGMEM;
|
||||
#define X0 (LCD_W-WCHART-2)
|
||||
#define Y0 (LCD_H/2)
|
||||
|
||||
#if LCD_W >= 212
|
||||
#define MIXES_2ND_COLUMN (18*FW)
|
||||
#else
|
||||
#define MIXES_2ND_COLUMN (12*FW)
|
||||
#endif
|
||||
#define MIXES_2ND_COLUMN (12*FW)
|
||||
|
||||
void drawSplash();
|
||||
void drawScreenIndex(uint8_t index, uint8_t count, uint8_t attr);
|
||||
void drawStick(coord_t centrex, int16_t xval, int16_t yval);
|
||||
void drawProgressBar(const char * label)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
void updateProgressBar(int num, int den)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
void drawSleepBitmap()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
#if !defined(CPUM64)
|
||||
void drawVerticalScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t count, uint8_t visible);
|
||||
#endif
|
||||
|
||||
|
||||
#define SET_SCROLLBAR_X(x)
|
||||
#define LOAD_MODEL_BITMAP()
|
||||
|
||||
#define IS_MAIN_VIEW_DISPLAYED() menuHandlers[0] == menuMainView
|
||||
#if defined(FRSKY)
|
||||
#define IS_TELEMETRY_VIEW_DISPLAYED() menuHandlers[0] == menuTelemetryFrsky
|
||||
#else
|
||||
#define IS_TELEMETRY_VIEW_DISPLAYED() false
|
||||
#endif
|
||||
#define IS_OTHER_VIEW_DISPLAYED() false
|
||||
|
||||
#endif // _GUI_H_
|
||||
@@ -268,4 +268,6 @@ uint8_t lcdRefresh_ST7920(uint8_t full);
|
||||
#define BLINK_ON_PHASE (g_blinkTmr10ms & (1<<6))
|
||||
#endif
|
||||
|
||||
const char * writeScreenshot();
|
||||
|
||||
#endif // _LCD_H_
|
||||
|
||||
@@ -445,7 +445,7 @@ extern uint8_t s_curveChan;
|
||||
#define WARNING_LINE_X 16
|
||||
#define WARNING_LINE_Y 3*FH
|
||||
|
||||
void displayBox();
|
||||
void drawMessageBox();
|
||||
void displayPopup(const pm_char * pstr);
|
||||
void displayWarning(uint8_t event);
|
||||
|
||||
@@ -496,7 +496,7 @@ void displayWarning(uint8_t event);
|
||||
extern uint16_t popupMenuNoItems;
|
||||
extern uint8_t popupMenuFlags;
|
||||
extern uint16_t popupMenuOffset;
|
||||
const char * displayPopupMenu(uint8_t event);
|
||||
const char * runPopupMenu(uint8_t event);
|
||||
extern void (*popupMenuHandler)(const char *result);
|
||||
#else
|
||||
#define popupMenuNoItems 0
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
const pm_char * warningText = NULL;
|
||||
const pm_char * warningInfoText;
|
||||
@@ -33,7 +33,7 @@ int16_t warningInputValueMin;
|
||||
int16_t warningInputValueMax;
|
||||
#endif
|
||||
|
||||
void displayBox()
|
||||
void drawMessageBox()
|
||||
{
|
||||
lcdDrawFilledRect(10, 16, LCD_W-20, 40, SOLID, ERASE);
|
||||
lcdDrawRect(10, 16, LCD_W-20, 40);
|
||||
@@ -48,7 +48,7 @@ void displayBox()
|
||||
void displayPopup(const pm_char * pstr)
|
||||
{
|
||||
warningText = pstr;
|
||||
displayBox();
|
||||
drawMessageBox();
|
||||
warningText = NULL;
|
||||
lcdRefresh();
|
||||
}
|
||||
@@ -89,7 +89,7 @@ void message(const pm_char *title, const pm_char *t, const char *last MESSAGE_SO
|
||||
void displayWarning(uint8_t event)
|
||||
{
|
||||
warningResult = false;
|
||||
displayBox();
|
||||
drawMessageBox();
|
||||
if (warningInfoText) {
|
||||
lcdDrawSizedText(WARNING_LINE_X, WARNING_LINE_Y+FH, warningInfoText, warningInfoLength, WARNING_INFO_FLAGS);
|
||||
}
|
||||
@@ -133,7 +133,7 @@ uint16_t popupMenuNoItems = 0;
|
||||
uint8_t popupMenuFlags = 0;
|
||||
uint16_t popupMenuOffset = 0;
|
||||
void (*popupMenuHandler)(const char *result);
|
||||
const char * displayPopupMenu(uint8_t event)
|
||||
const char * runPopupMenu(uint8_t event)
|
||||
{
|
||||
const char * result = NULL;
|
||||
|
||||
|
||||
@@ -554,7 +554,7 @@ void menuMainView(uint8_t event)
|
||||
if (gvarDisplayTimer > 0) {
|
||||
gvarDisplayTimer--;
|
||||
warningText = STR_GLOBAL_VAR;
|
||||
displayBox();
|
||||
drawMessageBox();
|
||||
lcdDrawSizedText(16, 5*FH, g_model.gvars[gvarLastChanged].name, LEN_GVAR_NAME, ZCHAR);
|
||||
lcdDrawText(16+7*FW, 5*FH, PSTR("[\010]"), BOLD);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user