FabGL
ESP32 Display Controller and Graphics Library

◆ select() [1/2]

int select ( char const *  titleText,
char const *  messageText,
char const *  itemsText,
char  separator = ';',
char const *  buttonCancelText = "Cancel",
char const *  buttonOKText = "OK" 
)

Shows a dialog with a label and a list box.

Parameters
titleTextOptional title of the dialog (nullptr = the dialogs hasn't a title)
messageTextMessage to show
itemsTextString containing a separated list of items to show into the listbox
separatorOptional items separator. Default is ';'
buttonCancelTextOptional text for CANCEL button (nullptr = hasn't CANCEL button). Default is "Cancel".
buttonOKTextOptional text for OK button (nullptr = hasn't OK button). Default is "OK".
Returns
Index of the selected item or -1 if dialog has been canceled

Example:

InputBox ib;
ib.begin();
int s = ib.select("Download Boot Disk", "Select boot disk to download", "FreeDOS;Minix 2.0;MS-DOS 3.3");
ib.messageFmt("", nullptr, "OK", "You have selected %d", s);
ib.end();

Definition at line 197 of file inputbox.cpp.