FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    NativeMenuItem

    struct · ferroui-controls · v0.5.0

    struct NativeMenuItem
    

    An item of a NativeMenu.

    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<NativeMenuItem>
    

    Returns a strong reference to this object.

    Source

    menu_property

    fn menu_property() -> &'static StyledProperty<Option<Ref<NativeMenu>>>
    

    Defines the Menu property.

    Source

    icon_property

    fn icon_property() -> &'static StyledProperty<Option<Rc<dyn IBitmap>>>
    

    Defines the Icon property.

    Source

    header_property

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

    Defines the Header property.

    Source

    tool_tip_property

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

    Defines the ToolTip property.

    Source

    gesture_property

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

    Defines the Gesture property.

    Source

    is_checked_property

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

    Defines the IsChecked property.

    Source

    toggle_type_property

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

    Defines the ToggleType property.

    Source

    command_property

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

    Defines the Command property.

    Source

    command_parameter_property

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

    Defines the CommandParameter property.

    Source

    is_enabled_property

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

    Defines the IsEnabled property.

    Source

    is_visible_property

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

    Defines the IsVisible property.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    with_header

    fn with_header(header: &str) -> Ref<Self>
    

    Creates an item with the given header.

    Source

    menu

    fn menu(self: &Self) -> Option<Ref<NativeMenu>>
    

    The submenu of the item.

    Source

    set_menu

    fn set_menu(self: &Self, value: Option<Ref<NativeMenu>>)
    

    Source

    icon

    fn icon(self: &Self) -> Option<Rc<dyn IBitmap>>
    

    The icon that appears in the item.

    Source

    set_icon

    fn set_icon(self: &Self, value: Option<Rc<dyn IBitmap>>)
    

    Source

    header

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

    The header of the item.

    Source

    set_header

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

    Source

    tool_tip

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

    Gets the tooltip associated with the menu item. This may not be supported by the native menu provider, but will be passed on to the non-native fallback menu item if used.

    Source

    set_tool_tip

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

    Source

    gesture

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

    The input gesture that will be displayed in the item.

    Source

    set_gesture

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

    Source

    is_checked

    fn is_checked(self: &Self) -> bool
    

    Whether the item is checked.

    Source

    set_is_checked

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

    Source

    toggle_type

    fn toggle_type(self: &Self) -> MenuItemToggleType
    

    How the item reacts to clicks.

    Source

    set_toggle_type

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

    Source

    is_enabled

    fn is_enabled(self: &Self) -> bool
    

    Whether the item is enabled.

    Source

    set_is_enabled

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

    Source

    is_visible

    fn is_visible(self: &Self) -> bool
    

    Gets a value indicating whether this menu item is visible.

    Source

    set_is_visible

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

    Source

    has_click_handlers

    fn has_click_handlers(self: &Self) -> bool
    

    Whether the click event has handlers.

    Source

    command

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

    The command to invoke when the item is clicked.

    Source

    set_command

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

    Source

    command_parameter

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

    The parameter to pass to the command.

    Source

    set_command_parameter

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

    Source

    click

    fn click(self: &Self, handler: impl Fn(&NativeMenuItem) -> () + 'static) -> Subscription
    

    Occurs when a NativeMenuItem is clicked.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the item.

    Source

    to_exporter_events_bridge

    fn to_exporter_events_bridge(self: &Self) -> Rc<dyn INativeMenuItemExporterEventsImplBridge>
    

    The item viewed as the contract through which the platform exporter of the menu raises the events of the item.

    Source

    Trait implementations

    Availability

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