|
FabGL
ESP32 Display Controller and Graphics Library
|
| InputResult select | ( | char const * | titleText, |
| char const * | messageText, | ||
| StringList * | items, | ||
| char const * | buttonCancelText = "Cancel", |
||
| char const * | buttonOKText = "OK" |
||
| ) |
Shows a dialog with a label and a list box.
| titleText | Optional title of the dialog (nullptr = the dialogs hasn't a title) |
| messageText | Message to show |
| items | StringList object containing the items to show into the listbox. This parameter contains items selected before and after the dialog |
| buttonCancelText | Optional text for CANCEL button (nullptr = hasn't CANCEL button). Default is "Cancel". |
| buttonOKText | Optional text for OK button (nullptr = hasn't OK button). Default is "OK". |
Example:
InputBox ib;
ib.begin();
StringList list;
list.append("Option 0");
list.append("Option 1");
list.append("Option 2");
list.append("Option 3");
list.select(1, true); // initially item 1 (Option 1) is selected
if (ib.select("Select values", "Please select one or more items", &list) == InputResult::Enter) {
for (int i = 0; i < list.count(); ++i)
if (list.selected(i))
ib.messageFmt("", nullptr, "OK", "You have selected %d", i);
}
ib.end();
Definition at line 216 of file inputbox.cpp.