Lysa UI  0.0
Lysa UI —UI components for the Lysa Engine
OpenFileDialog Class Reference

Detailed Description

A native modal asynchronous dialog opening a file or a directory.

Classes

struct  Filter
 

Public Typedefs

using SelectCallback = std::function< void (const std::string &path)>
 

Static Public Member Functions

static void openFile (const RenderingWindow &parent, const SelectCallback &callback, const std::vector< Filter > &filters={}, const std::string &defaultLocation="")
 
static void openDirectory (const RenderingWindow &parent, const SelectCallback &callback, const std::string &defaultLocation="")
 

Member Typedef Documentation

using SelectCallback = std::function<void(const std::string& path)>

Callback called with the selected file or directory, or with an empty string if the user cancelled the dialog or if the dialog can't be displayed.

Member Function Documentation

static void openDirectory ( const RenderingWindow &  parent,
const SelectCallback callback,
const std::string &  defaultLocation = "" 
)
static

Displays a dialog selecting an existing directory.

Parameters
parentWindow the dialog is modal to.
callbackCalled with the selected directory.
defaultLocationDirectory initially displayed.
static void openFile ( const RenderingWindow &  parent,
const SelectCallback callback,
const std::vector< Filter > &  filters = {},
const std::string &  defaultLocation = "" 
)
static

Displays a dialog selecting an existing file.

Parameters
parentWindow the dialog is modal to.
callbackCalled with the selected file.
filtersTypes of file displayed by the dialog, all the files if empty.
defaultLocationDirectory or file initially displayed.