Struct native_windows_gui::FileDialog
[−]
[src]
pub struct FileDialog { /* fields omitted */ }
A file dialog control
Methods
impl FileDialog
[src]
fn get_selected_item(&self) -> Result<String, Error>
Return the item selected in the dialog by the user.
Failures:
• Error::System
if the dialog was not called
• Error::System
if there was a system error while reading the selected item
• Error::UserError
if the dialog has the multiselect
flag
fn get_selected_items(&self) -> Result<Vec<String>, Error>
Return the selected items in the dialog by the user.
Failures:
• Error::System
if the dialog was not called
• Error::System
if there was a system error while reading the selected items
• Error::UserError
if the dialog has Save
for action
fn action(&self) -> FileDialogAction
Return the action type executed by this dialog
fn get_multiselect(&self) -> bool
Return true
if the dialog accepts multiple values or false
otherwise
fn set_multiselect(&mut self, multiselect: bool) -> Result<(), Error>
Set the multiselect flag of the dialog.
Failures:
• Error::System
if there was a system error while setting the new flag value
• Error::UserError
if the dialog has Save
for action
fn set_default_folder<'a>(&self, folder: &'a str) -> Result<(), Error>
Set the first opened folder when the dialog is shown. This value is overriden by the user after the dialog ran.
Call clear_client_data
to fix that.
Failures:
• Error::UserError
: if the default folder do not identify a folder
• Error::System
: if the folder do not exists
fn set_filters<'a>(&self, filters: &'a str) -> Result<(), Error>
Filter the files that the user can select (In a Open
dialog) in the dialog or which extension to add to the saved file (in a Save
dialog).
This can only be set ONCE (the initialization counts) and won't work if the dialog is OpenDirectory
.
The filters
value must be a '|' separated string having this format: "Test(.txt;.rs)|Any(.)"
Where the fist part is the "human name" and the second part is a filter for the system.
fn set_title<'a>(&self, title: &'a str)
Change the dialog title
fn clear_client_data(&self)
Instructs the dialog to clear all persisted state information (such as the last folder visited).
fn run(&self) -> bool
Display the dialog. Return true if the dialog was accepted or false if it was cancelled
Trait Implementations
impl Control for FileDialog
[src]
fn handle(&self) -> AnyHandle
Should return the underlying handle to the object
fn control_type(&self) -> ControlType
Should return the type of the control. For custom controls, the return value should be Undefined
(the default).
fn free(&mut self)
If specified, should free any ressource allocated in the template build
function. This includes functions like DestroyWindow
.