xtd 1.0.0
Loading...
Searching...
No Matches
xtd::forms::save_file_box Class Referencefinal
Inheritance diagram for xtd::forms::save_file_box:
xtd::static_object

Definition

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

Header
#include <xtd/forms/save_file_box>
Namespace
xtd::forms
Library
xtd.forms
Appearance
Windows macOS Gnome
Light
Dark
Examples
The following code example demonstrates the use of xtd::forms::save_file_box dialog.
#include <xtd/xtd>
class form1 : public form {
public:
form1() {
text("Save file box example");
client_size({400, 200});
controls().add(button_save_file);
button_save_file.parent(*this)
.location({10, 10})
.size({150, 35})
.text("Save file")
.click += delegate_ {
auto file_name = "MyFile.txt"_s;
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(string::format("File will be saved as:\n{}", file_name));
};
}
private:
button button_save_file;
};
auto main() -> int {
application::run(form1 {});
}
virtual auto size() const noexcept -> xtd::drawing::size
Gets the height and width of the control.
virtual auto text() const noexcept -> const xtd::string &
Gets the text associated with this control.
virtual auto client_size() const noexcept -> const xtd::drawing::size &
Gets the height and width of the client area of the control.
virtual auto controls() noexcept -> control_collection &
Gets the collection of controls contained within the control.
Represents a window or dialog box that makes up an application's user interface.
Definition form.hpp:54
static auto show() -> xtd::forms::dialog_result
Displays a message box.
static auto show(xtd::string &file_name, const xtd::forms::iwin32_window &owner) -> xtd::forms::dialog_result
Displays a save file dialog box in front of a specified window.
#define delegate_
The declaration of a delegate type is similar to a method signature. It has a return value and any nu...
Definition delegate.hpp:1018
xtd::forms::style_sheets::control button
The buttton data allows you to specify the box of a button control.
Definition button.hpp:25

Public Static Methods

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

Member Function Documentation

◆ show() [1/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::forms::iwin32_window & owner ) -> xtd::forms::dialog_result
staticnodiscard

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

Parameters
file_nameAn output xtd::string that will store the selected file name.
ownerAn If xtd::forms::iwin32_window that represents the owner window 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/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::forms::iwin32_window & owner,
const xtd::string & title ) -> xtd::forms::dialog_result
staticnodiscard

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

Parameters
file_nameAn output xtd::string 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::string 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() [3/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::forms::iwin32_window & owner,
const xtd::string & title,
const xtd::forms::save_file_box_options options ) -> xtd::forms::dialog_result
staticnodiscard

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

Parameters
file_nameAn output xtd::string 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::string 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() [4/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::forms::iwin32_window & owner,
const xtd::string & title,
const xtd::string & initial_directory ) -> xtd::forms::dialog_result
staticnodiscard

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

Parameters
file_nameAn output xtd::string 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::string that specifies the caption title of the file dialog box.
initial_directoryAn xtd::string 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() [5/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::forms::iwin32_window & owner,
const xtd::string & title,
const xtd::string & initial_directory,
const xtd::forms::save_file_box_options options ) -> xtd::forms::dialog_result
staticnodiscard

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

Parameters
file_nameAn output xtd::string 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::string that specifies the caption title of the file dialog box.
initial_directoryAn xtd::string 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() [6/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::forms::iwin32_window & owner,
const xtd::string & title,
const xtd::string & initial_directory,
const xtd::string & filter ) -> xtd::forms::dialog_result
staticnodiscard

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

Parameters
file_nameAn output xtd::string 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::string that specifies the caption title of the file dialog box.
initial_directoryAn xtd::string that specifies the initial directory displayed by the file dialog box
filterAn xtd::string 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() [7/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::forms::iwin32_window & owner,
const xtd::string & title,
const xtd::string & initial_directory,
const xtd::string & filter,
const xtd::forms::save_file_box_options options ) -> xtd::forms::dialog_result
staticnodiscard

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

Parameters
file_nameAn output xtd::string 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::string that specifies the caption title of the file dialog box.
initial_directoryAn xtd::string that specifies the initial directory displayed by the file dialog box
filterAn xtd::string 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() [8/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name) -> xtd::forms::dialog_result
staticnodiscard

Displays a save file dialog box.

Parameters
file_nameAn output xtd::string that will store the selected file name.
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/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::string & title ) -> xtd::forms::dialog_result
staticnodiscard

Displays a save file dialog box.

Parameters
file_nameAn output xtd::string that will store the selected file name.
titleAn xtd::string 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() [10/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::string & title,
const xtd::forms::save_file_box_options options ) -> xtd::forms::dialog_result
staticnodiscard

Displays a select file dialog box.

Parameters
file_nameAn output xtd::string that will store the selected file name.
titleAn xtd::string 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() [11/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::string & title,
const xtd::string & initial_directory ) -> xtd::forms::dialog_result
staticnodiscard

Displays a save file dialog box.

Parameters
file_nameAn output xtd::string that will store the selected file name.
titleAn xtd::string that specifies the caption title of the file dialog box.
initial_directoryAn xtd::string 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() [12/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::string & title,
const xtd::string & initial_directory,
const xtd::forms::save_file_box_options options ) -> xtd::forms::dialog_result
staticnodiscard

Displays a save file dialog box.

Parameters
file_nameAn output xtd::string that will store the selected file name.
titleAn xtd::string that specifies the caption title of the file dialog box.
initial_directoryAn xtd::string 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() [13/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::string & title,
const xtd::string & initial_directory,
const xtd::string & filter ) -> xtd::forms::dialog_result
staticnodiscard

Displays a save file dialog box.

Parameters
file_nameAn output xtd::string that will store the selected file name.
titleAn xtd::string that specifies the caption title of the file dialog box.
initial_directoryAn xtd::string that specifies the initial directory displayed by the file dialog box
filterAn xtd::string 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() [14/14]

auto xtd::forms::save_file_box::show ( xtd::string & file_name,
const xtd::string & title,
const xtd::string & initial_directory,
const xtd::string & filter,
const xtd::forms::save_file_box_options options ) -> xtd::forms::dialog_result
staticnodiscard

Displays a save file dialog box.

Parameters
file_nameAn output xtd::string that will store the selected file name.
titleAn xtd::string that specifies the caption title of the file dialog box.
initial_directoryAn xtd::string that specifies the initial directory displayed by the file dialog box
filterAn xtd::string 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: