SplitButton
struct · ferroui-controls · v0.5.0
struct SplitButton
A button with primary and secondary parts that can each be pressed
separately. The primary part behaves like a Button and the secondary
part opens a flyout.
Members
TYPEto_refinternal_is_checkedon_click_primaryon_click_secondaryon_flyout_openedon_flyout_closedTEMPLATE_PARTSPSEUDO_CLASSESclick_eventcommand_propertycommand_parameter_propertyflyout_propertyhot_key_propertyconstructnewclickcommandset_commandcommand_parameterset_command_parameterflyoutset_flyouthot_keyset_hot_keyupdate_pseudo_classesopen_flyoutclose_flyout
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<SplitButton>
Returns a strong reference to this object.
internal_is_checked
fn internal_is_checked(self: &Self) -> bool
A value indicating whether the button is currently checked.
This member exists only for the derived toggle split button and is unused (false) within the split button. Doing this allows the two controls to share a default style.
on_click_primary
fn on_click_primary(self: &Self, e: Option<&RoutedEventArgs>)
Invokes the Click event when the primary button part is
clicked. e are the event args from the internal click event.
on_click_secondary
fn on_click_secondary(self: &Self, e: Option<&RoutedEventArgs>)
Invoked when the secondary button part is clicked. e are the
event args from the internal click event.
on_flyout_opened
fn on_flyout_opened(self: &Self)
Invoked when the split button's flyout is opened.
on_flyout_closed
fn on_flyout_closed(self: &Self)
Invoked when the split button's flyout is closed.
TEMPLATE_PARTS
const TEMPLATE_PARTS: &'static [TemplatePartAttribute]
The named parts expected in the control template, in addition to those of the base class.
PSEUDO_CLASSES
const PSEUDO_CLASSES: PseudoClassesAttribute
The pseudoclasses set by the class.
click_event
fn click_event() -> &'static RoutedEvent<RoutedEventArgs>
Defines the Click event.
command_property
fn command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
Defines the Command property.
command_parameter_property
fn command_parameter_property() -> &'static StyledProperty<Option<BoxedValue>>
Defines the CommandParameter property.
flyout_property
fn flyout_property() -> &'static StyledProperty<Option<Ref<FlyoutBase>>>
Defines the Flyout property.
hot_key_property
fn hot_key_property() -> &'static StyledProperty<Option<KeyGesture>>
Defines the HotKey property.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Creates a split button.
click
fn click(self: &Self, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
Raised when the user presses the primary part of the split button.
command
fn command(self: &Self) -> Option<Rc<dyn ICommand>>
The command invoked when the primary part is pressed.
set_command
fn set_command(self: &Self, value: Option<Rc<dyn ICommand>>)
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>)
flyout
fn flyout(self: &Self) -> Option<Ref<FlyoutBase>>
The flyout that will be shown when the secondary part is pressed.
set_flyout
fn set_flyout(self: &Self, value: impl Into<Nullable<FlyoutBase>>)
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>)
update_pseudo_classes
fn update_pseudo_classes(self: &Self)
Updates the visual state of the control by applying the latest pseudoclasses.
open_flyout
fn open_flyout(self: &Self)
Opens the secondary button's flyout.
close_flyout
fn close_flyout(self: &Self)
Closes the secondary button's flyout.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtContentControlImplExtControlImplExtSplitButtonImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<SplitButton>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleVisualImplLayoutableImplInteractiveImplContentControlImplControlImplFerroObjectImplStyledElementImplInputElementImplTemplatedControlImplSplitButtonImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.