FabGL
ESP32 Display Controller and Graphics Library

◆ textInput()

InputResult textInput ( char const *  titleText,
char const *  labelText,
char *  inOutString,
int  maxLength,
char const *  buttonCancelText = "Cancel",
char const *  buttonOKText = "OK",
bool  passwordMode = false 
)

Shows a dialog with a label and a text edit box.

Parameters
titleTextOptional title of the dialog (nullptr = the dialogs hasn't a title)
labelTextLabel text
inOutStringThis is the input and output edit box string
maxLengthMaximum length of the edit box string (not including ending zero)
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".
passwordModeOptional password mode. If True all characters are shown using "*". Default is false.
Returns
Dialog box result (Cancel or Enter)

Example:

char wifiName[32];
char wifiPsw[32];
InputBox ib;
ib.begin();
if (ib.message("Network Configuration", "Configure WIFI network?", "No", "Yes") == InputResult::Enter) {
  ib.textInput("Network Configuration", "WiFi Name", wifiName, 31);
  ib.textInput("Network Configuration", "WiFi Password", wifiPsw, 31, "Cancel", "OK", true);
}
ib.end();

Definition at line 146 of file inputbox.cpp.