FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ContextMenu

    struct · ferroui-controls · v0.5.0

    struct ContextMenu
    

    A control context menu.

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

    Returns a strong reference to this object.

    Source

    horizontal_offset_property

    fn horizontal_offset_property() -> &'static StyledProperty<f64>
    

    Defines the HorizontalOffset property.

    Source

    vertical_offset_property

    fn vertical_offset_property() -> &'static StyledProperty<f64>
    

    Defines the VerticalOffset property.

    Source

    placement_anchor_property

    fn placement_anchor_property() -> &'static StyledProperty<PopupAnchor>
    

    Defines the PlacementAnchor property.

    Source

    placement_constraint_adjustment_property

    fn placement_constraint_adjustment_property() -> &'static StyledProperty<PopupPositionerConstraintAdjustment>
    

    Defines the PlacementConstraintAdjustment property.

    Source

    placement_gravity_property

    fn placement_gravity_property() -> &'static StyledProperty<PopupGravity>
    

    Defines the PlacementGravity property.

    Source

    placement_property

    fn placement_property() -> &'static StyledProperty<PlacementMode>
    

    Defines the Placement property.

    Source

    placement_rect_property

    fn placement_rect_property() -> &'static StyledProperty<Option<Rect>>
    

    Defines the PlacementRect property.

    Source

    window_manager_add_shadow_hint_property

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

    Defines the WindowManagerAddShadowHint property.

    Source

    placement_target_property

    fn placement_target_property() -> &'static StyledProperty<Option<ElementRef<Control>>>
    

    Defines the PlacementTarget property.

    The menu does not own its placement target, so the value is an element reference.

    Source

    custom_popup_placement_callback_property

    fn custom_popup_placement_callback_property() -> &'static StyledProperty<Option<CustomPopupPlacementCallbackValue>>
    

    Defines the CustomPopupPlacementCallback property.

    Source

    system_backdrop_property

    fn system_backdrop_property() -> &'static StyledProperty<Option<Ref<crate::media::SystemBackdrop>>>
    

    Defines the SystemBackdrop property: the system backdrop drawn as the background of the menu (the property of a menu flyout presenter, a FerroUI addition on the context menu, which is a menu flyout presenter of its own).

    Source

    construct

    fn construct() -> Self
    

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

    Source

    new

    fn new() -> Ref<Self>
    

    Initializes a new instance of the ContextMenu class.

    Source

    system_backdrop

    fn system_backdrop(self: &Self) -> Option<Ref<crate::media::SystemBackdrop>>
    

    SystemBackdrop: the system backdrop drawn as the background of the menu.

    Source

    set_system_backdrop

    fn set_system_backdrop(self: &Self, value: Option<Ref<crate::media::SystemBackdrop>>)
    

    Source

    horizontal_offset

    fn horizontal_offset(self: &Self) -> f64
    

    The horizontal offset of the menu in relation to its target; see Popup::horizontal_offset.

    Source

    set_horizontal_offset

    fn set_horizontal_offset(self: &Self, value: f64)
    

    Source

    vertical_offset

    fn vertical_offset(self: &Self) -> f64
    

    The vertical offset of the menu in relation to its target; see Popup::vertical_offset.

    Source

    set_vertical_offset

    fn set_vertical_offset(self: &Self, value: f64)
    

    Source

    placement_anchor

    fn placement_anchor(self: &Self) -> PopupAnchor
    

    See Popup::placement_anchor.

    Source

    set_placement_anchor

    fn set_placement_anchor(self: &Self, value: PopupAnchor)
    

    Source

    placement_constraint_adjustment

    fn placement_constraint_adjustment(self: &Self) -> PopupPositionerConstraintAdjustment
    

    See Popup::placement_constraint_adjustment.

    Source

    set_placement_constraint_adjustment

    fn set_placement_constraint_adjustment(self: &Self, value: PopupPositionerConstraintAdjustment)
    

    Source

    placement_gravity

    fn placement_gravity(self: &Self) -> PopupGravity
    

    See Popup::placement_gravity.

    Source

    set_placement_gravity

    fn set_placement_gravity(self: &Self, value: PopupGravity)
    

    Source

    placement

    fn placement(self: &Self) -> PlacementMode
    

    See Popup::placement.

    Source

    set_placement

    fn set_placement(self: &Self, value: PlacementMode)
    

    Source

    window_manager_add_shadow_hint

    fn window_manager_add_shadow_hint(self: &Self) -> bool
    

    See Popup::window_manager_add_shadow_hint.

    Source

    set_window_manager_add_shadow_hint

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

    Source

    placement_rect

    fn placement_rect(self: &Self) -> Option<Rect>
    

    See Popup::placement_rect.

    Source

    set_placement_rect

    fn set_placement_rect(self: &Self, value: Option<Rect>)
    

    Source

    placement_target

    fn placement_target(self: &Self) -> Option<Ref<Control>>
    

    See Popup::placement_target.

    Source

    set_placement_target

    fn set_placement_target(self: &Self, value: impl Into<Nullable<Control>>)
    

    Source

    custom_popup_placement_callback

    fn custom_popup_placement_callback(self: &Self) -> Option<CustomPopupPlacementCallback>
    

    See Popup::custom_popup_placement_callback.

    Source

    set_custom_popup_placement_callback

    fn set_custom_popup_placement_callback(self: &Self, value: Option<CustomPopupPlacementCallback>)
    

    Source

    opening

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

    Occurs when the value of the IsOpen property is changing from false to true. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the menu.

    Source

    closing

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

    Occurs when the value of the IsOpen property is changing from true to false. Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the menu.

    Source

    open_at

    fn open_at(self: &Self, control: Option<&Ref<Control>>)
    

    Opens a context menu on the specified control.

    Panics

    Panics when control is None and the menu is attached to no control, and when control is not one of the controls the menu is attached to.

    Source

    popup_host

    fn popup_host(self: &Self) -> Option<Rc<dyn IPopupHost>>
    

    The host of the popup the menu is shown in, while it is open.

    Source

    popup_host_changed

    fn popup_host_changed(self: &Self, handler: impl Fn(Option<&Rc<dyn IPopupHost>>) -> () + 'static) -> Subscription
    

    Raised when the popup host changes (the popup host provider contract). Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the menu.

    Source

    to_popup_host_provider

    fn to_popup_host_provider(self: &Self) -> Rc<dyn IPopupHostProvider>
    

    The menu as a popup host provider (the diagnostics contract it implements in the reference).

    Source

    Trait implementations

    Availability

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