gempyre  1.7.1
Gempyre::Dialog Class Reference

Dialogs for file access. More...

#include <gempyre_client.h>

Public Types

using Filter = std::vector< std::tuple< std::string, std::vector< std::string > >>
 Filter is for Dialog File name filters. More...
 

Static Public Member Functions

static std::optional< std::string > open_file_dialog (std::string_view caption="", std::string_view root="", const Filter &filters={})
 Pick a file. More...
 
static std::optional< std::vector< std::string > > open_files_dialog (std::string_view caption="", std::string_view root="", const Filter &filters={})
 Pick files. More...
 
static std::optional< std::string > open_dir_dialog (std::string_view caption="", std::string_view root="")
 Pick a dir. More...
 
static std::optional< std::string > save_file_dialog (std::string_view caption="", std::string_view root="", const Filter &filters={})
 Pick a a file or crate a new one. More...
 

Detailed Description

Dialogs for file access.

Member Typedef Documentation

◆ Filter

using Gempyre::Dialog::Filter = std::vector<std::tuple<std::string, std::vector<std::string> >>

Filter is for Dialog File name filters.

List of tuples having filter name + list of extensions. e.g. like [("text", [".txt", ".text"])]

Member Function Documentation

◆ open_dir_dialog()

static std::optional<std::string> Gempyre::Dialog::open_dir_dialog ( std::string_view  caption = "",
std::string_view  root = "" 
)
static

Pick a dir.

Parameters
captionoptional dialog name.
rootoptional root folder.
Returns
directory name selected.

◆ open_file_dialog()

static std::optional<std::string> Gempyre::Dialog::open_file_dialog ( std::string_view  caption = "",
std::string_view  root = "",
const Filter filters = {} 
)
static

Pick a file.

Parameters
captionoptional dialog name.
rootoptional root folder.
filtersoptional filters what to show.
Returns
file name selected.

◆ open_files_dialog()

static std::optional<std::vector<std::string> > Gempyre::Dialog::open_files_dialog ( std::string_view  caption = "",
std::string_view  root = "",
const Filter filters = {} 
)
static

Pick files.

Parameters
captionoptional dialog name.
rootoptional root folder.
filtersoptional filters what to show.
Returns
vector of file names.

◆ save_file_dialog()

static std::optional<std::string> Gempyre::Dialog::save_file_dialog ( std::string_view  caption = "",
std::string_view  root = "",
const Filter filters = {} 
)
static

Pick a a file or crate a new one.

Parameters
captionoptional dialog name.
rootoptional rool folder.
filtersoptional filters what to show.
Returns
file name selected.

The documentation for this class was generated from the following file: