|
ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
|
Classes | |
| struct | FileFilter |
| Filter shown in a file chooser. More... | |
Enumerations | |
| enum class | FileMode { Open , Save } |
| Kind of file chooser. More... | |
Functions | |
| void | info (const std::string &title, const std::string &message) |
| Show an information message box. Blocks until it is closed. | |
| void | warn (const std::string &title, const std::string &message) |
| Show a warning message box. Blocks until it is closed. | |
| void | error (const std::string &title, const std::string &message) |
| Show an error message box. Blocks until it is closed. | |
| bool | confirm (const std::string &title, const std::string &message) |
| Ask a yes or no question. Blocks until it is answered. | |
| bool | request_file (FileMode mode, const std::string &default_location="", const std::vector< FileFilter > &filters={ }) |
| Open a native file chooser. It does not block, the chosen file arrives later through take_file(). Only one chooser can be open at a time. | |
| bool | is_file_pending () |
| Check if a file chooser is open. | |
| std::optional< std::string > | take_file () |
| Take the file the user chose. Returns it once, then empty until the next chooser. | |
|
strong |
| bool asw::dialog::confirm | ( | const std::string & | title, |
| const std::string & | message ) |
Ask a yes or no question. Blocks until it is answered.
| title | The title of the message box. |
| message | The question to ask. |
Definition at line 55 of file dialog.cpp.
| void asw::dialog::error | ( | const std::string & | title, |
| const std::string & | message ) |
Show an error message box. Blocks until it is closed.
| title | The title of the message box. |
| message | The message to show. |
Definition at line 50 of file dialog.cpp.
| void asw::dialog::info | ( | const std::string & | title, |
| const std::string & | message ) |
Show an information message box. Blocks until it is closed.
| title | The title of the message box. |
| message | The message to show. |
Definition at line 40 of file dialog.cpp.
| bool asw::dialog::is_file_pending | ( | ) |
Check if a file chooser is open.
Definition at line 112 of file dialog.cpp.
| bool asw::dialog::request_file | ( | FileMode | mode, |
| const std::string & | default_location = "", | ||
| const std::vector< FileFilter > & | filters = { } ) |
Open a native file chooser. It does not block, the chosen file arrives later through take_file(). Only one chooser can be open at a time.
| mode | Open an existing file, or choose where to save one. |
| default_location | Folder or file the chooser starts at, empty for the system default. |
| filters | Filters to offer, empty for all files. |
Definition at line 76 of file dialog.cpp.
| std::optional< std::string > asw::dialog::take_file | ( | ) |
Take the file the user chose. Returns it once, then empty until the next chooser.
Definition at line 117 of file dialog.cpp.
| void asw::dialog::warn | ( | const std::string & | title, |
| const std::string & | message ) |
Show a warning message box. Blocks until it is closed.
| title | The title of the message box. |
| message | The message to show. |
Definition at line 45 of file dialog.cpp.