FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    MenuItem

    struct · ferroui-controls · v0.5.0

    struct MenuItem
    

    A menu item control.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<MenuItem>
    

    Returns a strong reference to this object.

    Source

    on_click

    fn on_click(self: &Self, e: &RoutedEventArgs)
    

    Invoked when an unhandled Click event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

    Source

    on_submenu_opened

    fn on_submenu_opened(self: &Self, e: &RoutedEventArgs)
    

    Invoked when an unhandled SubmenuOpened event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

    Source

    command_property

    fn command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
    

    Defines the Command property.

    Source

    hot_key_property

    fn hot_key_property() -> &'static StyledProperty<Option<KeyGesture>>
    

    Defines the HotKey property.

    Source

    command_parameter_property

    fn command_parameter_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Defines the CommandParameter property.

    Source

    icon_property

    fn icon_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Defines the Icon property.

    Source

    input_gesture_property

    fn input_gesture_property() -> &'static StyledProperty<Option<KeyGesture>>
    

    Defines the InputGesture property.

    Source

    is_sub_menu_open_property

    fn is_sub_menu_open_property() -> &'static StyledProperty<bool>
    

    Defines the IsSubMenuOpen property.

    Source

    stays_open_on_click_property

    fn stays_open_on_click_property() -> &'static StyledProperty<bool>
    

    Defines the StaysOpenOnClick property.

    Source

    toggle_type_property

    fn toggle_type_property() -> &'static StyledProperty<MenuItemToggleType>
    

    Defines the ToggleType property.

    Source

    is_checked_property

    fn is_checked_property() -> &'static StyledProperty<bool>
    

    Defines the IsChecked property.

    Source

    group_name_property

    fn group_name_property() -> &'static StyledProperty<Option<String>>
    

    Defines the GroupName property.

    Source

    TEMPLATE_PARTS

    const TEMPLATE_PARTS: &'static [TemplatePartAttribute]
    

    The named parts expected in the control template.

    Source

    PSEUDO_CLASSES

    const PSEUDO_CLASSES: PseudoClassesAttribute
    

    The pseudoclasses set by the class.

    Source

    click_event

    fn click_event() -> &'static RoutedEvent<RoutedEventArgs>
    

    Defines the Click event.

    Source

    pointer_entered_item_event

    fn pointer_entered_item_event() -> &'static RoutedEvent<RoutedEventArgs>
    

    Defines the PointerEnteredItem event.

    Source

    pointer_exited_item_event

    fn pointer_exited_item_event() -> &'static RoutedEvent<RoutedEventArgs>
    

    Defines the PointerExitedItem event.

    Source

    submenu_opened_event

    fn submenu_opened_event() -> &'static RoutedEvent<RoutedEventArgs>
    

    Defines the SubmenuOpened event.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    click

    fn click(self: &Self, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Occurs when a MenuItem without a submenu is clicked.

    Source

    pointer_entered_item

    fn pointer_entered_item(self: &Self, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Occurs when the pointer enters a menu item.

    A bubbling version of the pointer entered event for menu items.

    Source

    pointer_exited_item

    fn pointer_exited_item(self: &Self, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Raised when the pointer leaves a menu item.

    A bubbling version of the pointer exited event for menu items.

    Source

    submenu_opened

    fn submenu_opened(self: &Self, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Occurs when a MenuItem's submenu is opened.

    Source

    command

    fn command(self: &Self) -> Option<Rc<dyn ICommand>>
    

    Gets or sets the command associated with the menu item.

    Source

    set_command

    fn set_command(self: &Self, value: Option<Rc<dyn ICommand>>)
    

    Source

    hot_key

    fn hot_key(self: &Self) -> Option<KeyGesture>
    

    Gets or sets a key gesture associated with this control.

    Source

    set_hot_key

    fn set_hot_key(self: &Self, value: Option<KeyGesture>)
    

    Source

    command_parameter

    fn command_parameter(self: &Self) -> Option<BoxedValue>
    

    Gets or sets the parameter to pass to the Command property of a MenuItem.

    Source

    set_command_parameter

    fn set_command_parameter(self: &Self, value: Option<BoxedValue>)
    

    Source

    icon

    fn icon(self: &Self) -> Option<BoxedValue>
    

    Gets or sets the icon that appears in a MenuItem.

    Source

    set_icon

    fn set_icon(self: &Self, value: Option<BoxedValue>)
    

    Source

    input_gesture

    fn input_gesture(self: &Self) -> Option<KeyGesture>
    

    Gets or sets the input gesture that will be displayed in the menu item.

    Setting this property does not cause the input gesture to be handled by the menu item, it simply displays the gesture text in the menu.

    Source

    set_input_gesture

    fn set_input_gesture(self: &Self, value: Option<KeyGesture>)
    

    Source

    is_selected

    fn is_selected(self: &Self) -> bool
    

    Gets or sets a value indicating whether the MenuItem is currently selected.

    Source

    set_is_selected

    fn set_is_selected(self: &Self, value: bool)
    

    Source

    is_sub_menu_open

    fn is_sub_menu_open(self: &Self) -> bool
    

    Gets or sets a value that indicates whether the submenu of the MenuItem is open.

    Source

    set_is_sub_menu_open

    fn set_is_sub_menu_open(self: &Self, value: bool)
    

    Source

    stays_open_on_click

    fn stays_open_on_click(self: &Self) -> bool
    

    Gets or sets a value that indicates the submenu that this MenuItem is within should not close when this item is clicked.

    Source

    set_stays_open_on_click

    fn set_stays_open_on_click(self: &Self, value: bool)
    

    Source

    toggle_type

    fn toggle_type(self: &Self) -> MenuItemToggleType
    

    Gets or sets the toggle type of the menu item.

    Source

    set_toggle_type

    fn set_toggle_type(self: &Self, value: MenuItemToggleType)
    

    Source

    is_checked

    fn is_checked(self: &Self) -> bool
    

    Gets or sets if menu item is checked when the toggle type is MenuItemToggleType::CheckBox or MenuItemToggleType::Radio.

    Source

    set_is_checked

    fn set_is_checked(self: &Self, value: bool)
    

    Source

    group_name

    fn group_name(self: &Self) -> Option<String>
    

    Gets or sets the menu item group name when the toggle type is MenuItemToggleType::Radio.

    Source

    set_group_name

    fn set_group_name(self: &Self, value: Option<String>)
    

    Source

    has_sub_menu

    fn has_sub_menu(self: &Self) -> bool
    

    Gets a value that indicates whether the MenuItem has a submenu.

    Source

    is_top_level

    fn is_top_level(self: &Self) -> bool
    

    Gets a value that indicates whether the MenuItem is a top-level main menu item.

    Source

    open

    fn open(self: &Self)
    

    Opens the submenu.

    This has the same effect as setting IsSubMenuOpen to true.

    Source

    close

    fn close(self: &Self)
    

    Closes the submenu.

    This has the same effect as setting IsSubMenuOpen to false.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.