Struct zng_wgt_dialog::DIALOG
source · pub struct DIALOG;
Expand description
Dialog service.
The non-custom dialog methods can be configured to open as native dialogs instead of the custom overlay dialogs.
§Panics
All dialog methods panic is not called inside a window.
Implementations§
source§impl DIALOG
impl DIALOG
sourcepub fn info(
&self,
title: impl IntoVar<Txt>,
msg: impl IntoVar<Txt>,
) -> ResponseVar<()>
pub fn info( &self, title: impl IntoVar<Txt>, msg: impl IntoVar<Txt>, ) -> ResponseVar<()>
Show an info dialog with “Ok” button.
sourcepub fn warn(
&self,
title: impl IntoVar<Txt>,
msg: impl IntoVar<Txt>,
) -> ResponseVar<()>
pub fn warn( &self, title: impl IntoVar<Txt>, msg: impl IntoVar<Txt>, ) -> ResponseVar<()>
Show a warning dialog with “Ok” button.
sourcepub fn error(
&self,
title: impl IntoVar<Txt>,
msg: impl IntoVar<Txt>,
) -> ResponseVar<()>
pub fn error( &self, title: impl IntoVar<Txt>, msg: impl IntoVar<Txt>, ) -> ResponseVar<()>
Show an error dialog with “Ok” button.
sourcepub fn ask(
&self,
title: impl IntoVar<Txt>,
question: impl IntoVar<Txt>,
) -> ResponseVar<bool>
pub fn ask( &self, title: impl IntoVar<Txt>, question: impl IntoVar<Txt>, ) -> ResponseVar<bool>
Shows a question dialog with “No” and “Yes” buttons. Returns true
for “Yes”.
sourcepub fn confirm(
&self,
title: impl IntoVar<Txt>,
question: impl IntoVar<Txt>,
) -> ResponseVar<bool>
pub fn confirm( &self, title: impl IntoVar<Txt>, question: impl IntoVar<Txt>, ) -> ResponseVar<bool>
Shows a question dialog with “Cancel” and “Ok” buttons. Returns true
for “Ok”.
sourcepub fn open_file(
&self,
title: impl IntoVar<Txt>,
starting_dir: impl Into<PathBuf>,
starting_name: impl IntoVar<Txt>,
filters: impl Into<FileDialogFilters>,
) -> ResponseVar<FileDialogResponse>
pub fn open_file( &self, title: impl IntoVar<Txt>, starting_dir: impl Into<PathBuf>, starting_name: impl IntoVar<Txt>, filters: impl Into<FileDialogFilters>, ) -> ResponseVar<FileDialogResponse>
Shows a native file picker dialog configured to select one existing file.
sourcepub fn open_files(
&self,
title: impl IntoVar<Txt>,
starting_dir: impl Into<PathBuf>,
starting_name: impl IntoVar<Txt>,
filters: impl Into<FileDialogFilters>,
) -> ResponseVar<FileDialogResponse>
pub fn open_files( &self, title: impl IntoVar<Txt>, starting_dir: impl Into<PathBuf>, starting_name: impl IntoVar<Txt>, filters: impl Into<FileDialogFilters>, ) -> ResponseVar<FileDialogResponse>
Shows a native file picker dialog configured to select one or more existing files.
sourcepub fn save_file(
&self,
title: impl IntoVar<Txt>,
starting_dir: impl Into<PathBuf>,
starting_name: impl IntoVar<Txt>,
filters: impl Into<FileDialogFilters>,
) -> ResponseVar<FileDialogResponse>
pub fn save_file( &self, title: impl IntoVar<Txt>, starting_dir: impl Into<PathBuf>, starting_name: impl IntoVar<Txt>, filters: impl Into<FileDialogFilters>, ) -> ResponseVar<FileDialogResponse>
Shows a native file picker dialog configured to select one file path that does not exist yet.
sourcepub fn select_folder(
&self,
title: impl IntoVar<Txt>,
starting_dir: impl Into<PathBuf>,
starting_name: impl IntoVar<Txt>,
) -> ResponseVar<FileDialogResponse>
pub fn select_folder( &self, title: impl IntoVar<Txt>, starting_dir: impl Into<PathBuf>, starting_name: impl IntoVar<Txt>, ) -> ResponseVar<FileDialogResponse>
Shows a native file picker dialog configured to select one existing directory.
sourcepub fn select_folders(
&self,
title: impl IntoVar<Txt>,
starting_dir: impl Into<PathBuf>,
starting_name: impl IntoVar<Txt>,
) -> ResponseVar<FileDialogResponse>
pub fn select_folders( &self, title: impl IntoVar<Txt>, starting_dir: impl Into<PathBuf>, starting_name: impl IntoVar<Txt>, ) -> ResponseVar<FileDialogResponse>
Shows a native file picker dialog configured to select one or more existing directories.
source§impl DIALOG
impl DIALOG
sourcepub fn native_dialogs(&self) -> ArcVar<DialogKind>
pub fn native_dialogs(&self) -> ArcVar<DialogKind>
Variable that defines what native dialogs are used when the dialog methods are called in window contexts.
The native_dialogs
context property can also be used to override the config just for some widgets.
Note that some dialogs only have the native implementation as of this release.
source§impl DIALOG
impl DIALOG
sourcepub fn respond_default(&self)
pub fn respond_default(&self)
Try to close the contextual dialog without directly setting a response.
If the dialog has no default_response
the
on_dialog_close_canceled
event notifies instead of closing.
Auto Trait Implementations§
impl Freeze for DIALOG
impl RefUnwindSafe for DIALOG
impl Send for DIALOG
impl Sync for DIALOG
impl Unpin for DIALOG
impl UnwindSafe for DIALOG
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more