|
FabGL
ESP32 Display Controller and Graphics Library
|
|
inline |
Shows a dialog with a label and a progress bar, updated dynamically by a user function.
| titleText | Optional title of the dialog (nullptr = the dialogs hasn't a title) |
| buttonCancelText | Optional text for CANCEL button (nullptr = hasn't CANCEL button) |
| hasProgressBar | If true a progress bar is shown |
| width | Width in pixels of the dialog |
| execFunc | A lambda function which updates the text and the progress bar calling the parameter object's update() function |
Example:
InputBox ib;
ib.begin();
auto r = ib.progressBox("This is the title", "Abort", true, 200, [&](fabgl::ProgressForm * form) {
for (int i = 0; i <= 100; ++i) {
if (!form->update(i, "Index is %d/100", i))
break;
delay(100);
}
});
if (r == InputResult::Cancel)
ib.message("", "Operation Aborted");
ib.end();
Definition at line 619 of file inputbox.h.