Hi Dave
I am using the dialog box to prompt before saving settings to EEPROM.
I used this topic for guidance and example:
https://www.thecoderscorner.com/jforum/posts/list/45.page
I have it all working well with the exception of the header text where I am using the variable pgmHeaderText
Firstly my compiler throws an error saying it needs to be const char* headerPgm instead of a String.
If I change to const char* then if set to "TEST" I get odd text in the header like:
3'5&3
The buffer string works fine.
My code is:
void CALLBACK_FUNCTION exitAndSaveSettings(int id) {
// TODO - your menu change code
const char* pgmHeaderText = "TEST";
bool remoteAllowed = true;
BaseDialog* dlg = renderer.getDialog();
dlg->setButtons(BTNTYPE_OK, BTNTYPE_CANCEL, 1);
dlg->show(pgmHeaderText, remoteAllowed, onDialogFinished); // true = shows on remote sessions.
dlg->copyIntoBuffer("Click OK to save");
}
void onDialogFinished(ButtonType btnPressed, void* /*userdata*/) {
if(btnPressed == BTNTYPE_OK) {
// menuMgr.save(IntEeprom);
renderer.takeOverDisplay(exitMenu);
}
}
If I just enter text directly as per this:
dlg->show("TEST", remoteAllowed, onDialogFinished)
I still get the strange text.
Any idea what I am not understanding?