You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be a call to return the number of items in the menu.
A call is also useful that will return the name of an item using the index.
I am keeping a list of files in the menu and these functions make it easier to work with so I don't need to keep a separate array of filenames.
I have added them to my copy of the code, but you might consider adding them to the main code.
Otherwise I'm finding M5ez quite useful. Thanks for the good work.
The text was updated successfully, but these errors were encountered:
Actually, a better suggestion to keep your code more general and just allow subclassing would be to make the following change.
protected:
int16_t _selected;
struct MenuItem_t {
String nameAndCaption;
const char* image;
fs::FS* fs;
String path;
void (*simpleFunction)();
bool (advancedFunction)(ezMenu callingMenu);
void (drawFunction)(ezMenu callingMenu, int16_t x, int16_t y, int16_t w, int16_t h);
};
std::vector<MenuItem_t> _items;
void _fixOffset();
Making those variables protected instead of private allows me to derive a class with the features I need and still use your base code without any modifications. Then I can get any updates without having to keep my own modified version of your code.
There should be a call to return the number of items in the menu.
A call is also useful that will return the name of an item using the index.
I am keeping a list of files in the menu and these functions make it easier to work with so I don't need to keep a separate array of filenames.
I have added them to my copy of the code, but you might consider adding them to the main code.
Otherwise I'm finding M5ez quite useful. Thanks for the good work.
The text was updated successfully, but these errors were encountered: