ArduinoMenu
ArduinoMenu copied to clipboard
Using macros and custom strings
Hello
I was wondering if it was possible to use my own strings to later edit using the Edit macro. I would essentially like to be able to select a preset and also rename it using the menu. When I try to compile this code it, the compiler tells me "array must be initialized with a brace-enclosed initializer"
Does the SELECT macro not allow arguments pointing to custom strings?
const char* constMEM alphaNum MEMMODE=" 0123456789.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,\\|!\"#$%&/()=?~*^+-{}[]€";
const char* constMEM alphaNumMask[] MEMMODE={alphaNum};
String cust1="Custom 1";
String cust2="Custom 2";
String cust3="Custom 3";
int selPreset=0;
SELECT(selPreset,selPre,"Preset",doNothing,noEvent,wrapStyle
,VALUE(cust1,4,doNothing,noEvent)
,VALUE(cust2,5,doNothing,noEvent)
,VALUE(cust3,6,doNothing,noEvent)
I was wondering something similar for FIELD objects "string" param.
For instance trying to use an extended ASCII character for a menu text:
I get "initializer fails to determine size of 'fieldLabel14'. My guess is because the macro is determining the size of the character array?
char* arrowUp = 30;
MENU(mainMenu, "Settings", doNothing, noEvent, wrapStyle
, FIELD(dwellTop, arrowUp, " s", 5, 30, 1, 1, adjustDwellTop, enterEvent, wrapStyle)
, EXIT("< Sleep")
);
I don't think he checks the issues section regularly. I still haven't received a response but I am going to play around with the Target example. I think it might help us resolve this issue