[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 


This forum will be made read only soon and new users cannot register, please ask all new questions either using GitHub discussions, or in Arduino forum tagging @davetcc.

error: invalid use of incomplete type 'class BaseDialog' RSS feed
Forum Index » tcMenu Arduinio library
Author Message
Lee_X


Joined: Apr 29, 2022
Messages: 27
Offline
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!
Lee_X


Joined: Apr 29, 2022
Messages: 27
Offline
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!

davetcc


Joined: Jan 19, 2019
Messages: 685
Offline
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.
davetcc


Joined: Jan 19, 2019
Messages: 685
Offline
Ah, also make sure you


#include <BaseDialog.h>


in the file in question.
Lee_X


Joined: Apr 29, 2022
Messages: 27
Offline
thanks Dave, forgot about that! smilie
davetcc


Joined: Jan 19, 2019
Messages: 685
Offline
I've updated the docs to make it more clear that it is needed.
 
Forum Index » tcMenu Arduinio library
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.