Button
struct · ferroui-controls · v0.5.0
struct Button
A standard button control.
Members
TYPEto_refon_clickopen_flyoutclose_flyouton_flyout_openedon_flyout_closedPSEUDO_CLASSESclick_mode_propertycommand_propertyhot_key_propertycommand_parameter_propertyis_default_propertyis_cancel_propertyclick_eventis_pressed_propertyflyout_propertyconstructnewclickclick_modeset_click_modecommandset_commandhot_keyset_hot_keycommand_parameterset_command_parameteris_defaultset_is_defaultis_cancelset_is_cancelis_pressedflyoutset_flyout
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<Button>
Returns a strong reference to this object.
on_click
fn on_click(self: &Self)
Invokes the Click event.
open_flyout
fn open_flyout(self: &Self)
Opens the button's flyout.
close_flyout
fn close_flyout(self: &Self)
Closes the button's flyout.
on_flyout_opened
fn on_flyout_opened(self: &Self)
Invoked when the button's flyout is opened.
on_flyout_closed
fn on_flyout_closed(self: &Self)
Invoked when the button's flyout is closed.
PSEUDO_CLASSES
const PSEUDO_CLASSES: PseudoClassesAttribute
The pseudoclasses set by the class.
click_mode_property
fn click_mode_property() -> &'static StyledProperty<ClickMode>
Defines the ClickMode property.
command_property
fn command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
Defines the Command property.
hot_key_property
fn hot_key_property() -> &'static StyledProperty<Option<KeyGesture>>
Defines the HotKey property.
command_parameter_property
fn command_parameter_property() -> &'static StyledProperty<Option<BoxedValue>>
Defines the CommandParameter property.
is_default_property
fn is_default_property() -> &'static StyledProperty<bool>
Defines the IsDefault property.
is_cancel_property
fn is_cancel_property() -> &'static StyledProperty<bool>
Defines the IsCancel property.
click_event
fn click_event() -> &'static RoutedEvent<RoutedEventArgs>
Defines the Click event.
is_pressed_property
fn is_pressed_property() -> &'static DirectProperty<Button, bool>
Defines the IsPressed property.
flyout_property
fn flyout_property() -> &'static StyledProperty<Option<Ref<FlyoutBase>>>
Defines the Flyout property.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Creates a button.
click
fn click(self: &Self, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
Raised when the user clicks the button.
click_mode
fn click_mode(self: &Self) -> ClickMode
A value indicating how the button should react to clicks.
set_click_mode
fn set_click_mode(self: &Self, value: ClickMode)
command
fn command(self: &Self) -> Option<Rc<dyn ICommand>>
A command to be invoked when the button is clicked.
set_command
fn set_command(self: &Self, value: Option<Rc<dyn ICommand>>)
hot_key
fn hot_key(self: &Self) -> Option<KeyGesture>
A key gesture associated with this control.
set_hot_key
fn set_hot_key(self: &Self, value: Option<KeyGesture>)
command_parameter
fn command_parameter(self: &Self) -> Option<BoxedValue>
A parameter to be passed to the Command.
set_command_parameter
fn set_command_parameter(self: &Self, value: Option<BoxedValue>)
is_default
fn is_default(self: &Self) -> bool
A value indicating whether the button is the default button for the root it is attached to.
set_is_default
fn set_is_default(self: &Self, value: bool)
is_cancel
fn is_cancel(self: &Self) -> bool
A value indicating whether the button is the Cancel button for the root it is attached to.
set_is_cancel
fn set_is_cancel(self: &Self, value: bool)
is_pressed
fn is_pressed(self: &Self) -> bool
A value indicating whether the button is currently pressed.
flyout
fn flyout(self: &Self) -> Option<Ref<FlyoutBase>>
The flyout that should be shown with this button.
set_flyout
fn set_flyout(self: &Self, value: impl Into<Nullable<FlyoutBase>>)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtContentControlImplExtControlImplExtButtonImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<Button>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleLayoutableImplInteractiveImplContentControlImplControlImplFerroObjectImplStyledElementImplVisualImplInputElementImplTemplatedControlImplButtonImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.