[−][src]Struct native_windows_gui::FileDialog
A file dialog control
Methods
impl FileDialog
[src]
pub fn get_selected_item(&self) -> Result<String, Error>
[src]
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
pub fn get_selected_items(&self) -> Result<Vec<String>, Error>
[src]
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
pub fn action(&self) -> FileDialogAction
[src]
Return the action type executed by this dialog
pub fn get_multiselect(&self) -> bool
[src]
Return true
if the dialog accepts multiple values or false
otherwise
pub fn set_multiselect(&mut self, multiselect: bool) -> Result<(), Error>
[src]
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
pub fn set_default_folder<'a>(&self, folder: &'a str) -> Result<(), Error>
[src]
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
pub fn set_filters<'a>(&self, filters: &'a str) -> Result<(), Error>
[src]
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.
pub fn set_title<'a>(&self, title: &'a str)
[src]
Change the dialog title
pub fn clear_client_data(&self)
[src]
Instructs the dialog to clear all persisted state information (such as the last folder visited).
pub fn run(&self) -> bool
[src]
Display the dialog. Return true if the dialog was accepted or false if it was cancelled
Trait Implementations
impl Control for FileDialog
[src]
Auto Trait Implementations
impl !Send for FileDialog
impl !Sync for FileDialog
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,