Skip to content

SystemDialogs

A bunch of system dialogs.

Functions

Name
voidFireErrorMessageDialog(const std::string & title, const std::string & message)<br>Show fatal error message.
boolOpenFilesDialog(std::vector< fs::path > & result, const std::string & title, fs::path root ="", const std::vector< std::string > & filter ={"All Files", "*"}, bool singleSelect =false)<br>Get multiple file names via native file dialog.
boolOpenSingleFileDialog(fs::path & result, const std::string & title, fs::path root ="", const std::vector< std::string > & filter ={"All Files", "*"})<br>Get single file name via native file dialog.
boolSaveSingleFileDialog(std::filesystem::path & filename, const std::string & title, fs::path root ="", const std::vector< std::string > & filter ={"All Files", "*"})<br>Save single file via system native file dialog.

Functions Documentation

function FireErrorMessageDialog

cpp
void FireErrorMessageDialog(
    const std::string & title,
    const std::string & message
)
void FireErrorMessageDialog(
    const std::string & title,
    const std::string & message
)

Show fatal error message.

Dialog will block execution of application.

function OpenFilesDialog

cpp
bool OpenFilesDialog(
    std::vector< fs::path > & result,
    const std::string & title,
    fs::path root ="",
    const std::vector< std::string > & filter ={"All Files", "*"},
    bool singleSelect =false
)
bool OpenFilesDialog(
    std::vector< fs::path > & result,
    const std::string & title,
    fs::path root ="",
    const std::vector< std::string > & filter ={"All Files", "*"},
    bool singleSelect =false
)

Get multiple file names via native file dialog.

Parameters:

  • result Reference to a list which should contain selected file names.
  • title Dialog title.
  • root Specifies default path for dialog to open.
  • filter Specifies which files should be showed in the dialog according
  • singleSelect Whether only a single file can be chosen. to its types. Pass parameter as a key, value vector {Audio Files", ".wav .mp3", "All Files", ""}.

Return: Whether at least one file was selected or not.

Note that the file dialog blocks the execution of application.

function OpenSingleFileDialog

cpp
bool OpenSingleFileDialog(
    fs::path & result,
    const std::string & title,
    fs::path root ="",
    const std::vector< std::string > & filter ={"All Files", "*"}
)
bool OpenSingleFileDialog(
    fs::path & result,
    const std::string & title,
    fs::path root ="",
    const std::vector< std::string > & filter ={"All Files", "*"}
)

Get single file name via native file dialog.

Parameters:

  • result Reference to a string which should contain selected file name.
  • title Dialog title.
  • root Specifies default path for dialog to open.
  • filter Specifies which files should be showed in the dialog according to its types. Pass parameter as a key, value vector {Audio Files", ".wav .mp3", "All Files", ""}.

Return: Whether file was selected or not.

Note that the file dialog blocks the execution of application.

function SaveSingleFileDialog

cpp
bool SaveSingleFileDialog(
    std::filesystem::path & filename,
    const std::string & title,
    fs::path root ="",
    const std::vector< std::string > & filter ={"All Files", "*"}
)
bool SaveSingleFileDialog(
    std::filesystem::path & filename,
    const std::string & title,
    fs::path root ="",
    const std::vector< std::string > & filter ={"All Files", "*"}
)

Save single file via system native file dialog.

Parameters:

  • filename Absolute filename to scene file.

Return: Whether file was selected or not.

Saves a scene to new scene file (it overrides existing file). Note that the file dialog blocks the execution of application.


Updated on 2024-11-06 at 20:16:53 +0000