company logo

ControlContext :: manyFilePath - Call multiple files dialog

The function provides a file open dialog that allows the selection of multiple files. The text passed in sTitle will be displayed in the title bar of the dialog.

In order to initialize the file name area, a path (sFilePath) might be passed to the function. The string passed in sFileMask allows restricting the files to be displayed by a file mask.

The function returns a list of file names in the string list passed in rFileNames. When no file has been selected or when the dialog has been canceled, an empty string list will be returned.

The function returns false, when the dialog has been canceled and true otherwise.

... fragment (ControlContext &context) {  

  StringList         files;

  manyFilePath("Select Expression File",

                "c:/Sample/osi",

                "*.osi");

  filePath = context->filePath("Select Expression File",

                               "c:/Sample/osi",

                               "*.osi",

                               false);

  if ( filePath != "" )

// .... run expression

}

Return value:  Accept option ( bool  )

The option is true, when a dialog or message box has been terminated with OK or Yes and false, when it has been canceled.

Implementation details

bool ControlContext  :: manyFilePath ( odaba::StringList &rFileNames, odaba::String &sTitle, odaba::String &sFilePath, odaba::String &sFileMask )
  • rFileNames - File name list
  • sTitle - Title for window or control
  • sFilePath - Complete file path

    The complete path includes file name and directory. It might, however, be defined as absolute path starting with the root device or folder or a relative path.

    In order to pass no file path, an empty string ( String() ) may be passed.

  • sFileMask - File Mask

    // following lists are equivalent:

    "All C++ files (*.cpp *.cc *.C *.cxx *.c++)"

    "*.cpp *.cc *.C *.cxx *.c++"