xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Static Public Member Functions | List of all members
xtd::forms::save_file_box Class Referencefinal

#include <save_file_box.h>

Definition

Represents a common dialog box that displays a file save dialog to the user to select a location for saving a file.

Namespace
xtd::forms
Library
xtd.forms
Examples
The following code example demonstrate the use of xtd::forms::save_file_box dialog.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Save file box example");
client_size({400, 200});
controls().push_back(button_save_file);
button_save_file.parent(*this)
.location({10, 10})
.size({150, 35})
.text("Save file")
.click += [this] {
ustring file_name = "MyFile.txt";
auto res = save_file_box::show(file_name, *this, "Save file as...", environment::get_folder_path(environment::special_folder::my_documents), "*.txt");
if (res == dialog_result::ok)
message_box::show(ustring::format("File will be saved as:\n{}", file_name));
};
}
private:
button button_save_file;
};
int main() {
application::run(form1());
}

Static Public Member Functions

static xtd::forms::dialog_result show (xtd::ustring &file_name, const xtd::forms::iwin32_window &owner, const xtd::ustring &title)
 Displays a save file dialog box in front of a specified window. More...
 
static xtd::forms::dialog_result show (xtd::ustring &file_name, const xtd::forms::iwin32_window &owner, const xtd::ustring &title, const save_file_box_options options)
 Displays a save file dialog box in front of a specified window. More...
 
static xtd::forms::dialog_result show (xtd::ustring &file_name, const xtd::forms::iwin32_window &owner, const xtd::ustring &title, const xtd::ustring &initial_directory)
 Displays a save file dialog box in front of a specified window. More...
 
static xtd::forms::dialog_result show (xtd::ustring &file_name, const xtd::forms::iwin32_window &owner, const xtd::ustring &title, const xtd::ustring &initial_directory, const save_file_box_options options)
 Displays a save file dialog box in front of a specified window. More...
 
static xtd::forms::dialog_result show (xtd::ustring &file_name, const xtd::forms::iwin32_window &owner, const xtd::ustring &title, const xtd::ustring &initial_directory, const xtd::ustring &filter)
 Displays a save file dialog box in front of a specified window. More...
 
static xtd::forms::dialog_result show (xtd::ustring &file_name, const xtd::forms::iwin32_window &owner, const xtd::ustring &title, const xtd::ustring &initial_directory, const xtd::ustring &filter, const save_file_box_options options)
 Displays a save file dialog box in front of a specified window. More...
 
static xtd::forms::dialog_result show (xtd::ustring &file_name, const xtd::ustring &title)
 Displays a save file dialog box. More...
 
static xtd::forms::dialog_result show (xtd::ustring &file_name, const xtd::ustring &title, const save_file_box_options options)
 Displays a select file dialog box. More...
 
static xtd::forms::dialog_result show (xtd::ustring &file_name, const xtd::ustring &title, const xtd::ustring &initial_directory)
 Displays a save file dialog box. More...
 
static xtd::forms::dialog_result show (xtd::ustring &file_name, const xtd::ustring &title, const xtd::ustring &initial_directory, const save_file_box_options options)
 Displays a save file dialog box. More...
 
static xtd::forms::dialog_result show (xtd::ustring &file_name, const xtd::ustring &title, const xtd::ustring &initial_directory, const xtd::ustring &filter)
 Displays a save file dialog box. More...
 
static xtd::forms::dialog_result show (xtd::ustring &file_name, const xtd::ustring &title, const xtd::ustring &initial_directory, const xtd::ustring &filter, const save_file_box_options options)
 Displays a save file dialog box. More...
 

Member Function Documentation

◆ show() [1/12]

static xtd::forms::dialog_result xtd::forms::save_file_box::show ( xtd::ustring file_name,
const xtd::forms::iwin32_window owner,
const xtd::ustring title 
)
inlinestatic

Displays a save file dialog box in front of a specified window.

Parameters
file_nameAn output xtd::ustring that will store the selected file name.
ownerAn If xtd::forms::iwin32_window that represents the owner window of the file dialog box.
titleAn xtd::ustring that specifies the caption title of the file dialog box.
Returns
xtd::forms::dialog_result::ok if the user clicks OK in the dialog box; otherwise, xtd::forms::dialog_result::cancel.
Remarks
If xtd::forms::dialog_result is ok, the output file_name parameter will contain the selected file path, otherwise it will be ignored.

◆ show() [2/12]

static xtd::forms::dialog_result xtd::forms::save_file_box::show ( xtd::ustring file_name,
const xtd::forms::iwin32_window owner,
const xtd::ustring title,
const save_file_box_options  options 
)
inlinestatic

Displays a save file dialog box in front of a specified window.

Parameters
file_nameAn output xtd::ustring that will store the selected file name.
ownerAn If xtd::forms::iwin32_window that represents the owner window of the file dialog box.
titleAn xtd::ustring that specifies the caption title of the file dialog box.
optionsA bitwise combination of enum xtd::forms::save_file_box_options to specify additional options to the file dialog box
Returns
xtd::forms::dialog_result::ok if the user clicks OK in the dialog box; otherwise, xtd::forms::dialog_result::cancel.
Remarks
If xtd::forms::dialog_result is ok, the output file_name parameter will contain the selected file path, otherwise it will be ignored.

◆ show() [3/12]

static xtd::forms::dialog_result xtd::forms::save_file_box::show ( xtd::ustring file_name,
const xtd::forms::iwin32_window owner,
const xtd::ustring title,
const xtd::ustring initial_directory 
)
inlinestatic

Displays a save file dialog box in front of a specified window.

Parameters
file_nameAn output xtd::ustring that will store the selected file name.
ownerAn If xtd::forms::iwin32_window that represents the owner window of the file dialog box.
titleAn xtd::ustring that specifies the caption title of the file dialog box.
initial_directoryAn xtd::ustring that specifies the initial directory displayed by the file dialog box
Returns
xtd::forms::dialog_result::ok if the user clicks OK in the dialog box; otherwise, xtd::forms::dialog_result::cancel.
Remarks
If xtd::forms::dialog_result is ok, the output file_name parameter will contain the selected file path, otherwise it will be ignored.

◆ show() [4/12]

static xtd::forms::dialog_result xtd::forms::save_file_box::show ( xtd::ustring file_name,
const xtd::forms::iwin32_window owner,
const xtd::ustring title,
const xtd::ustring initial_directory,
const save_file_box_options  options 
)
inlinestatic

Displays a save file dialog box in front of a specified window.

Parameters
file_nameAn output xtd::ustring that will store the selected file name.
ownerAn If xtd::forms::iwin32_window that represents the owner window of the file dialog box.
titleAn xtd::ustring that specifies the caption title of the file dialog box.
initial_directoryAn xtd::ustring that specifies the initial directory displayed by the file dialog box
optionsA bitwise combination of enum xtd::forms::save_file_box_options to specify additional options to the file dialog box
Returns
xtd::forms::dialog_result::ok if the user clicks OK in the dialog box; otherwise, xtd::forms::dialog_result::cancel.
Remarks
If xtd::forms::dialog_result is ok, the output file_name parameter will contain the selected file path, otherwise it will be ignored.

◆ show() [5/12]

static xtd::forms::dialog_result xtd::forms::save_file_box::show ( xtd::ustring file_name,
const xtd::forms::iwin32_window owner,
const xtd::ustring title,
const xtd::ustring initial_directory,
const xtd::ustring filter 
)
inlinestatic

Displays a save file dialog box in front of a specified window.

Parameters
file_nameAn output xtd::ustring that will store the selected file name.
ownerAn If xtd::forms::iwin32_window that represents the owner window of the file dialog box.
titleAn xtd::ustring that specifies the caption title of the file dialog box.
initial_directoryAn xtd::ustring that specifies the initial directory displayed by the file dialog box
filterAn xtd::ustring that specifies the file name filter string, which determines the choices that appear in the "Save as file type" or "Files of type" box in the dialog box, separated by vertical bar | for example:
(*.txt)|*.txt|All files (*.*)|*.* 
Returns
xtd::forms::dialog_result::ok if the user clicks OK in the dialog box; otherwise, xtd::forms::dialog_result::cancel.
Remarks
If xtd::forms::dialog_result is ok, the output file_name parameter will contain the selected file path, otherwise it will be ignored.

◆ show() [6/12]

static xtd::forms::dialog_result xtd::forms::save_file_box::show ( xtd::ustring file_name,
const xtd::forms::iwin32_window owner,
const xtd::ustring title,
const xtd::ustring initial_directory,
const xtd::ustring filter,
const save_file_box_options  options 
)
inlinestatic

Displays a save file dialog box in front of a specified window.

Parameters
file_nameAn output xtd::ustring that will store the selected file name.
ownerAn If xtd::forms::iwin32_window that represents the owner window of the file dialog box.
titleAn xtd::ustring that specifies the caption title of the file dialog box.
initial_directoryAn xtd::ustring that specifies the initial directory displayed by the file dialog box
filterAn xtd::ustring that specifies the file name filter string, which determines the choices that appear in the "Save as file type" or "Files of type" box in the dialog box, separated by vertical bar | for example:
(*.txt)|*.txt|All files (*.*)|*.* 
optionsA bitwise combination of enum xtd::forms::save_file_box_options to specify additional options to the file dialog box
Returns
xtd::forms::dialog_result::ok if the user clicks OK in the dialog box; otherwise, xtd::forms::dialog_result::cancel.
Remarks
If xtd::forms::dialog_result is ok, the output file_name parameter will contain the selected file path, otherwise it will be ignored.

◆ show() [7/12]

static xtd::forms::dialog_result xtd::forms::save_file_box::show ( xtd::ustring file_name,
const xtd::ustring title 
)
inlinestatic

Displays a save file dialog box.

Parameters
file_nameAn output xtd::ustring that will store the selected file name.
titleAn xtd::ustring that specifies the caption title of the file dialog box.
Returns
xtd::forms::dialog_result::ok if the user clicks OK in the dialog box; otherwise, xtd::forms::dialog_result::cancel.
Remarks
If xtd::forms::dialog_result is ok, the output file_name parameter will contain the selected file path, otherwise it will be ignored.

◆ show() [8/12]

static xtd::forms::dialog_result xtd::forms::save_file_box::show ( xtd::ustring file_name,
const xtd::ustring title,
const save_file_box_options  options 
)
inlinestatic

Displays a select file dialog box.

Parameters
file_nameAn output xtd::ustring that will store the selected file name.
titleAn xtd::ustring that specifies the caption title of the file dialog box.
optionsA bitwise combination of enum xtd::forms::save_file_box_options to specify additional options to the file dialog box
Returns
xtd::forms::dialog_result::ok if the user clicks OK in the dialog box; otherwise, xtd::forms::dialog_result::cancel.
Remarks
If xtd::forms::dialog_result is ok, the output file_name parameter will contain the selected file path, otherwise it will be ignored.

◆ show() [9/12]

static xtd::forms::dialog_result xtd::forms::save_file_box::show ( xtd::ustring file_name,
const xtd::ustring title,
const xtd::ustring initial_directory 
)
inlinestatic

Displays a save file dialog box.

Parameters
file_nameAn output xtd::ustring that will store the selected file name.
titleAn xtd::ustring that specifies the caption title of the file dialog box.
initial_directoryAn xtd::ustring that specifies the initial directory displayed by the file dialog box
Returns
xtd::forms::dialog_result::ok if the user clicks OK in the dialog box; otherwise, xtd::forms::dialog_result::cancel.
Remarks
If xtd::forms::dialog_result is ok, the output file_name parameter will contain the selected file path, otherwise it will be ignored.

◆ show() [10/12]

static xtd::forms::dialog_result xtd::forms::save_file_box::show ( xtd::ustring file_name,
const xtd::ustring title,
const xtd::ustring initial_directory,
const save_file_box_options  options 
)
inlinestatic

Displays a save file dialog box.

Parameters
file_nameAn output xtd::ustring that will store the selected file name.
titleAn xtd::ustring that specifies the caption title of the file dialog box.
initial_directoryAn xtd::ustring that specifies the initial directory displayed by the file dialog box
optionsA bitwise combination of enum xtd::forms::save_file_box_options to specify additional options to the file dialog box
Returns
xtd::forms::dialog_result::ok if the user clicks OK in the dialog box; otherwise, xtd::forms::dialog_result::cancel.
Remarks
If xtd::forms::dialog_result is ok, the output file_name parameter will contain the selected file path, otherwise it will be ignored.

◆ show() [11/12]

static xtd::forms::dialog_result xtd::forms::save_file_box::show ( xtd::ustring file_name,
const xtd::ustring title,
const xtd::ustring initial_directory,
const xtd::ustring filter 
)
inlinestatic

Displays a save file dialog box.

Parameters
file_nameAn output xtd::ustring that will store the selected file name.
titleAn xtd::ustring that specifies the caption title of the file dialog box.
initial_directoryAn xtd::ustring that specifies the initial directory displayed by the file dialog box
filterAn xtd::ustring that specifies the file name filter string, which determines the choices that appear in the "Save as file type" or "Files of type" box in the dialog box, separated by vertical bar | for example:
(*.txt)|*.txt|All files (*.*)|*.* 
Returns
xtd::forms::dialog_result::ok if the user clicks OK in the dialog box; otherwise, xtd::forms::dialog_result::cancel.
Remarks
If xtd::forms::dialog_result is ok, the output file_name parameter will contain the selected file path, otherwise it will be ignored.

◆ show() [12/12]

static xtd::forms::dialog_result xtd::forms::save_file_box::show ( xtd::ustring file_name,
const xtd::ustring title,
const xtd::ustring initial_directory,
const xtd::ustring filter,
const save_file_box_options  options 
)
inlinestatic

Displays a save file dialog box.

Parameters
file_nameAn output xtd::ustring that will store the selected file name.
titleAn xtd::ustring that specifies the caption title of the file dialog box.
initial_directoryAn xtd::ustring that specifies the initial directory displayed by the file dialog box
filterAn xtd::ustring that specifies the file name filter string, which determines the choices that appear in the "Save as file type" or "Files of type" box in the dialog box, separated by vertical bar | for example:
(*.txt)|*.txt|All files (*.*)|*.* 
optionsA bitwise combination of enum xtd::forms::save_file_box_options to specify additional options to the file dialog box
Returns
xtd::forms::dialog_result::ok if the user clicks OK in the dialog box; otherwise, xtd::forms::dialog_result::cancel.
Remarks
If xtd::forms::dialog_result is ok, the output file_name parameter will contain the selected file path, otherwise it will be ignored.

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