FabGL
ESP32 Display Controller and Graphics Library

◆ fileSelector()

InputResult fileSelector ( char const *  titleText,
char const *  messageText,
char *  inOutDirectory,
int  maxDirectoryLength,
char *  inOutFilename,
int  maxFilenameLength,
char const *  buttonCancelText = "Cancel",
char const *  buttonOKText = "OK" 
)

Selects a file and directory starting from the specified path.

Parameters
titleTextOptional title of the dialog (nullptr = the dialogs hasn't a title)
messageTextMessage to show
inOutDirectoryStarting directory as input, selected directory as output
maxDirectoryLengthMaximum length of directory buffer (not including ending zero)
inOutFilenameInitial filename as input, selected filename as output
maxFilenameLengthMaximum length of filename buffer (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".
Returns
Dialog box result (Cancel or Enter)

Example:

InputBox ib;
ib.begin();
if (FileBrowser::mountSDCard(false, "/SD")) {
  char filename[16] = "";
  char directory[32] = "/SD"
  if (ib.fileSelector("File Select", "Filename: ", directory, sizeof(directory) - 1, filename, sizeof(filename) - 1) == InputResult::Enter)
    ib.messageFmt("", nullptr, "OK", "Folder = %s, File = %s", directory, filename);
}
ib.end();

Definition at line 295 of file inputbox.cpp.