From cc14213fb7f4b867272c9c4d6b7720681a81f697 Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Thu, 30 Jan 2025 16:11:00 +0100 Subject: [PATCH] Make textlines 1, 3, 4, 6, 7, 66, 282, 284 \n compatible --- TEF6686_ESP32.ino | 18 +++++++++--------- src/gui.cpp | 7 ++++++- src/gui.h | 1 + 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index cc32143..e09d370 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -730,7 +730,7 @@ void setup() { EEPROM.writeByte(EE_BYTE_ROTARYMODE, rotarymode); EEPROM.commit(); analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255)); - tftPrint(0, myLanguage[language][1], 155, 70, ActiveColor, ActiveColorSmooth, 28); + Infoboxprint(myLanguage[language][1]); tftPrint(0, myLanguage[language][2], 155, 130, ActiveColor, ActiveColorSmooth, 28); while (digitalRead(BWBUTTON) == LOW) delay(50); } @@ -754,7 +754,7 @@ void setup() { EEPROM.writeByte(EE_BYTE_DISPLAYFLIP, displayflip); EEPROM.commit(); analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255)); - tftPrint(0, myLanguage[language][3], 155, 70, ActiveColor, ActiveColorSmooth, 28); + Infoboxprint(myLanguage[language][3]); tftPrint(0, myLanguage[language][2], 155, 130, ActiveColor, ActiveColorSmooth, 28); while (digitalRead(MODEBUTTON) == LOW) delay(50); } @@ -762,7 +762,7 @@ void setup() { if (digitalRead(BWBUTTON) == HIGH && digitalRead(ROTARY_BUTTON) == HIGH && digitalRead(MODEBUTTON) == HIGH && digitalRead(BANDBUTTON) == LOW) { analogWrite(SMETERPIN, 511); analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255)); - tftPrint(0, myLanguage[language][4], 155, 70, ActiveColor, ActiveColorSmooth, 28); + Infoboxprint(myLanguage[language][4]); tftPrint(0, myLanguage[language][5], 155, 130, ActiveColor, ActiveColorSmooth, 28); while (digitalRead(BANDBUTTON) == LOW) delay(50); analogWrite(SMETERPIN, 0); @@ -772,10 +772,10 @@ void setup() { analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255)); if (optenc == 0) { optenc = 1; - tftPrint(0, myLanguage[language][6], 155, 70, ActiveColor, ActiveColorSmooth, 28); + Infoboxprint(myLanguage[language][6]); } else { optenc = 0; - tftPrint(0, myLanguage[language][7], 155, 70, ActiveColor, ActiveColorSmooth, 28); + Infoboxprint(myLanguage[language][7]); } EEPROM.writeByte(EE_BYTE_OPTENC, optenc); EEPROM.commit(); @@ -786,7 +786,7 @@ void setup() { if (digitalRead(BWBUTTON) == LOW && digitalRead(ROTARY_BUTTON) == LOW && digitalRead(MODEBUTTON) == HIGH && digitalRead(BANDBUTTON) == HIGH) { analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255)); DefaultSettings(); - tftPrint(0, myLanguage[language][66], 155, 70, ActiveColor, ActiveColorSmooth, 28); + Infoboxprint(myLanguage[language][66]); tftPrint(0, myLanguage[language][2], 155, 130, ActiveColor, ActiveColorSmooth, 28); while (digitalRead(ROTARY_BUTTON) == LOW && digitalRead(BWBUTTON) == LOW) delay(50); ESP.restart(); @@ -794,8 +794,8 @@ void setup() { if (digitalRead(BWBUTTON) == LOW && digitalRead(ROTARY_BUTTON) == HIGH && digitalRead(MODEBUTTON) == LOW && digitalRead(BANDBUTTON) == HIGH) { analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255)); - tftPrint(0, myLanguage[language][282], 155, 70, ActiveColor, ActiveColorSmooth, 28); - tftPrint(0, myLanguage[language][283], 155, 130, ActiveColor, ActiveColorSmooth, 28); + Infoboxprint(myLanguage[language][282]); + tftPrint(0, myLanguage[language][283], 155, 100, ActiveColor, ActiveColorSmooth, 28); tft.calibrateTouch(TouchCalData, PrimaryColor, BackgroundColor, 30); EEPROM.writeUInt(EE_UINT16_CALTOUCH1, TouchCalData[0]); EEPROM.writeUInt(EE_UINT16_CALTOUCH2, TouchCalData[1]); @@ -807,7 +807,7 @@ void setup() { if (digitalRead(BWBUTTON) == LOW && digitalRead(ROTARY_BUTTON) == HIGH && digitalRead(MODEBUTTON) == HIGH && digitalRead(BANDBUTTON) == LOW) { analogWrite(CONTRASTPIN, map(ContrastSet, 0, 100, 15, 255)); - tftPrint(0, myLanguage[language][284], 155, 70, ActiveColor, ActiveColorSmooth, 28); + Infoboxprint(myLanguage[language][284]); tftPrint(0, myLanguage[language][2], 155, 130, ActiveColor, ActiveColorSmooth, 28); invertdisplay = !invertdisplay; tft.invertDisplay(!invertdisplay); diff --git a/src/gui.cpp b/src/gui.cpp index 45caf85..6cba216 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -5545,7 +5545,10 @@ void Infoboxprint(const char* input) { if (menu) { tftPrint(0, line1, 155, 48, ActiveColor, ActiveColorSmooth, 28); tftPrint(0, line2, 155, 78, ActiveColor, ActiveColorSmooth, 28); - } else { + } else if (setupmode) { + tftPrint(0, line1, 155, 40, ActiveColor, ActiveColorSmooth, 28); + tftPrint(0, line2, 155, 70, ActiveColor, ActiveColorSmooth, 28); + } else { FrequencySprite.drawString(line1, 100, 5); FrequencySprite.drawString(line2, 100, 25); } @@ -5554,6 +5557,8 @@ void Infoboxprint(const char* input) { } else { if (menu) { tftPrint(0, input, 155, 78, ActiveColor, ActiveColorSmooth, 28); + } else if (setupmode) { + tftPrint(0, input, 155, 70, ActiveColor, ActiveColorSmooth, 28); } else { FrequencySprite.drawString(input, 100, 15); } diff --git a/src/gui.h b/src/gui.h index 155580f..602552b 100644 --- a/src/gui.h +++ b/src/gui.h @@ -47,6 +47,7 @@ extern bool scandxmode; extern bool scanholdonsignal; extern bool scanmem; extern bool scanmute; +extern bool setupmode; extern bool showclock; extern bool showlongps; extern bool softmuteam;