Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Arduinio library » error: invalid use of incomplete type 'class BaseDialog'

Author: Lee_X
17/10/2022 14:41:07
Hi I'm trying to display a simple dialog but I get compile errors on ESP32-S2

I'm following this: https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/rendering-with-tcmenu-lcd-tft-oled/

BaseDialog* dlg = renderer.getDialog();
dlg->setButtons(BTNTYPE_OK, BTNTYPE_CANCEL, 1);
dlg->show("hello", false, onDialogFinished);


gives:
error: invalid use of incomplete type 'class BaseDialog'
dlg->setButtons(BTNTYPE_OK, BTNTYPE_CANCEL, 1);


Has something changed in the last version of tcMenu? What is the correct way to display (and hide!) an alert in version 2.4.0?

Thanks!

Author: Lee_X
17/10/2022 15:22:34
also tried this from the latest esp32 s2 example:

auto dlg = renderer.getDialog();
  if (!dlg->isInUse()) {
    dlg->setButtons(BTNTYPE_NONE, BTNTYPE_CLOSE);
    dlg->showRam("Saved", false);
    dlg->copyIntoBuffer("to flash");
  }


which gives


error: invalid use of incomplete type 'class BaseDialog'
if(!dlg->isInUse()) {
....
note: forward declaration of 'class BaseDialog'
class BaseDialog;


so any idea on how to show a dialog would be great!


Author: davetcc
17/10/2022 15:47:06
After upgrading to library 2.4, did you also upgrade the UI and run the code generator to ensure the plugins were up-to-date?

If you didn't want to do that, you could copy the same display plugin files from one of the examples, it would have the same effect.

Author: davetcc
17/10/2022 15:50:43
Ah, also make sure you


#include <BaseDialog.h>


in the file in question.

Author: Lee_X
17/10/2022 16:25:53
thanks Dave, forgot about that! smilie

Author: davetcc
17/10/2022 16:49:14
I've updated the docs to make it more clear that it is needed.




Register / Login  |  Desktop view  |  Jump to top of page