Memory improvement and Graphic menu back
This commit is contained in:
+16
-25
@@ -484,7 +484,8 @@ void BuildAFScreen() {
|
||||
}
|
||||
|
||||
void ShowOneLine(byte position, byte item, bool selected) {
|
||||
FullLineSprite.fillSprite(BackgroundColor);
|
||||
FullLineSprite.pushImage (-8, -(position + 2), 320, 240, configurationbackground);
|
||||
if (selected) FullLineSprite.pushImage(0, 0, 304, 20, selector);
|
||||
|
||||
switch (item) {
|
||||
case 0:
|
||||
@@ -1400,9 +1401,7 @@ void ShowOneLine(byte position, byte item, bool selected) {
|
||||
void BuildMenu() {
|
||||
advancedRDS = false;
|
||||
|
||||
tft.fillScreen(BackgroundColor);
|
||||
tft.drawRect(0, 0, 320, 240, FrameColor);
|
||||
tft.drawLine(0, 23, 320, 23, FrameColor);
|
||||
tft.pushImage (0, 0, 320, 240, configurationbackground);
|
||||
|
||||
if (!submenu) {
|
||||
tftPrint(0, myLanguage[language][41], 160, 6, PrimaryColor, PrimaryColorSmooth, 16);
|
||||
@@ -1422,8 +1421,6 @@ void BuildMenu() {
|
||||
ShowOneLine(ITEM9, 8, (menuoption == ITEM9 ? true : false));
|
||||
ShowOneLine(ITEM10, 9, (menuoption == ITEM10 ? true : false));
|
||||
|
||||
tft.drawRoundRect(3, menuoption + 3, 315, 21, 5, ActiveColor);
|
||||
|
||||
analogWrite(SMETERPIN, 0);
|
||||
}
|
||||
|
||||
@@ -1562,8 +1559,6 @@ void BuildAdvancedRDS() {
|
||||
}
|
||||
|
||||
void BuildDisplay() {
|
||||
OneBigLineSprite.unloadFont();
|
||||
FullLineSprite.unloadFont();
|
||||
afscreen = false;
|
||||
advancedRDS = false;
|
||||
int bandColor;
|
||||
@@ -1720,7 +1715,7 @@ void BuildDisplay() {
|
||||
|
||||
void MenuUp() {
|
||||
if (!menuopen) {
|
||||
tft.drawRoundRect(3, menuoption + 3, 315, 21, 5, BackgroundColor);
|
||||
ShowOneLine(menuoption, menuitem, false);
|
||||
|
||||
if (hardwaremodel == BASE_ILI9341) {
|
||||
menuoption += ITEM_GAP;
|
||||
@@ -1741,11 +1736,10 @@ void MenuUp() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tft.drawRoundRect(3, menuoption + 3, 315, 21, 5, ActiveColor);
|
||||
|
||||
ShowOneLine(menuoption, menuitem, true);
|
||||
} else {
|
||||
OneBigLineSprite.fillSprite(BackgroundColor);
|
||||
|
||||
OneBigLineSprite.pushImage(-11, -88, 292, 170, popupbackground);
|
||||
OneBigLineSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
|
||||
OneBigLineSprite.setTextDatum(TC_DATUM);
|
||||
|
||||
@@ -2030,7 +2024,7 @@ void MenuUp() {
|
||||
case ITEM1:
|
||||
language ++;
|
||||
if (language == (sizeof (myLanguage) / sizeof (myLanguage[0]))) language = 0;
|
||||
UpdateFonts(1);
|
||||
UpdateFonts(0);
|
||||
OneBigLineSprite.drawString(myLanguage[language][0], 135, 0);
|
||||
OneBigLineSprite.pushSprite(24, 118);
|
||||
break;
|
||||
@@ -2565,7 +2559,7 @@ void MenuUp() {
|
||||
|
||||
void MenuDown() {
|
||||
if (!menuopen) {
|
||||
tft.drawRoundRect(3, menuoption + 3, 315, 21, 5, BackgroundColor);
|
||||
ShowOneLine(menuoption, menuitem, false);
|
||||
|
||||
if (hardwaremodel == BASE_ILI9341) {
|
||||
menuoption -= ITEM_GAP;
|
||||
@@ -2587,7 +2581,7 @@ void MenuDown() {
|
||||
}
|
||||
}
|
||||
|
||||
tft.drawRoundRect(3, menuoption + 3, 315, 21, 5, ActiveColor);
|
||||
ShowOneLine(menuoption, menuitem, true);
|
||||
} else {
|
||||
OneBigLineSprite.fillSprite(BackgroundColor);
|
||||
|
||||
@@ -2877,7 +2871,7 @@ void MenuDown() {
|
||||
case ITEM1:
|
||||
language --;
|
||||
if (language > (sizeof (myLanguage) / sizeof (myLanguage[0]))) language = (sizeof (myLanguage) / sizeof (myLanguage[0])) - 1;
|
||||
UpdateFonts(1);
|
||||
UpdateFonts(0);
|
||||
OneBigLineSprite.drawString(myLanguage[language][0], 135, 0);
|
||||
OneBigLineSprite.pushSprite(24, 118);
|
||||
break;
|
||||
@@ -3417,10 +3411,10 @@ void DoMenu() {
|
||||
if (!menuopen) {
|
||||
if (menupage != INDEX) {
|
||||
menuopen = true;
|
||||
tft.drawRoundRect(10, 30, 300, 170, 5, ActiveColor);
|
||||
tft.fillRoundRect(12, 32, 296, 166, 5, BackgroundColor);
|
||||
tft.pushImage (13, 30, 292, 170, popupbackground);
|
||||
}
|
||||
OneBigLineSprite.fillSprite(BackgroundColor);
|
||||
|
||||
OneBigLineSprite.pushImage(-11, -88, 292, 170, popupbackground);
|
||||
|
||||
OneBigLineSprite.setTextColor(PrimaryColor, PrimaryColorSmooth, false);
|
||||
OneBigLineSprite.setTextDatum(TC_DATUM);
|
||||
@@ -4163,8 +4157,7 @@ void DoMenu() {
|
||||
tftPrint(0, "http://192.168.4.1", 155, 174, PrimaryColor, PrimaryColorSmooth, 16);
|
||||
char key [9];
|
||||
XDRGTK_key.toCharArray(key, 9);
|
||||
UpdateFonts(2);
|
||||
UpdateSprites(1);
|
||||
UpdateFonts(1);
|
||||
WiFiConnectParam XDRGTK_key_text("Set XDRGTK Password: (max 8 characters)");
|
||||
WiFiConnectParam XDRGTK_key_input("XDRGTK_key", "Password", key, 9);
|
||||
wc.addParameter(&XDRGTK_key_text);
|
||||
@@ -4173,8 +4166,7 @@ void DoMenu() {
|
||||
XDRGTK_key = XDRGTK_key_input.getValue();
|
||||
EEPROM.writeString(EE_STRING_XDRGTK_KEY, XDRGTK_key);
|
||||
EEPROM.commit();
|
||||
UpdateSprites(0);
|
||||
UpdateFonts(1);
|
||||
UpdateFonts(0);
|
||||
wifi = true;
|
||||
tryWiFi();
|
||||
delay(2000);
|
||||
@@ -4287,7 +4279,6 @@ void DoMenu() {
|
||||
if (scanstart >= scanstop) scanstart = scanstop - 1;
|
||||
if (scanstop <= scanstart) scanstop = scanstart + 1;
|
||||
|
||||
UpdateFonts(1);
|
||||
BuildMenu();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user