ContextMenu
struct · ferroui-controls · v0.5.0
struct ContextMenu
A control context menu.
Members
TYPEto_refhorizontal_offset_propertyvertical_offset_propertyplacement_anchor_propertyplacement_constraint_adjustment_propertyplacement_gravity_propertyplacement_propertyplacement_rect_propertywindow_manager_add_shadow_hint_propertyplacement_target_propertycustom_popup_placement_callback_propertysystem_backdrop_propertyconstructnewsystem_backdropset_system_backdrophorizontal_offsetset_horizontal_offsetvertical_offsetset_vertical_offsetplacement_anchorset_placement_anchorplacement_constraint_adjustmentset_placement_constraint_adjustmentplacement_gravityset_placement_gravityplacementset_placementwindow_manager_add_shadow_hintset_window_manager_add_shadow_hintplacement_rectset_placement_rectplacement_targetset_placement_targetcustom_popup_placement_callbackset_custom_popup_placement_callbackopeningclosingopen_atpopup_hostpopup_host_changedto_popup_host_provider
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ContextMenu>
Returns a strong reference to this object.
horizontal_offset_property
fn horizontal_offset_property() -> &'static StyledProperty<f64>
Defines the HorizontalOffset property.
vertical_offset_property
fn vertical_offset_property() -> &'static StyledProperty<f64>
Defines the VerticalOffset property.
placement_anchor_property
fn placement_anchor_property() -> &'static StyledProperty<PopupAnchor>
Defines the PlacementAnchor property.
placement_constraint_adjustment_property
fn placement_constraint_adjustment_property() -> &'static StyledProperty<PopupPositionerConstraintAdjustment>
Defines the PlacementConstraintAdjustment property.
placement_gravity_property
fn placement_gravity_property() -> &'static StyledProperty<PopupGravity>
Defines the PlacementGravity property.
placement_property
fn placement_property() -> &'static StyledProperty<PlacementMode>
Defines the Placement property.
placement_rect_property
fn placement_rect_property() -> &'static StyledProperty<Option<Rect>>
Defines the PlacementRect property.
window_manager_add_shadow_hint_property
fn window_manager_add_shadow_hint_property() -> &'static StyledProperty<bool>
Defines the WindowManagerAddShadowHint property.
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.
custom_popup_placement_callback_property
fn custom_popup_placement_callback_property() -> &'static StyledProperty<Option<CustomPopupPlacementCallbackValue>>
Defines the CustomPopupPlacementCallback property.
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).
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Initializes a new instance of the ContextMenu class.
system_backdrop
fn system_backdrop(self: &Self) -> Option<Ref<crate::media::SystemBackdrop>>
SystemBackdrop: the system backdrop drawn as the background of the menu.
set_system_backdrop
fn set_system_backdrop(self: &Self, value: Option<Ref<crate::media::SystemBackdrop>>)
horizontal_offset
fn horizontal_offset(self: &Self) -> f64
The horizontal offset of the menu in relation to its target; see
Popup::horizontal_offset.
set_horizontal_offset
fn set_horizontal_offset(self: &Self, value: f64)
vertical_offset
fn vertical_offset(self: &Self) -> f64
The vertical offset of the menu in relation to its target; see
Popup::vertical_offset.
set_vertical_offset
fn set_vertical_offset(self: &Self, value: f64)
placement_anchor
fn placement_anchor(self: &Self) -> PopupAnchor
See Popup::placement_anchor.
set_placement_anchor
fn set_placement_anchor(self: &Self, value: PopupAnchor)
placement_constraint_adjustment
fn placement_constraint_adjustment(self: &Self) -> PopupPositionerConstraintAdjustment
See Popup::placement_constraint_adjustment.
set_placement_constraint_adjustment
fn set_placement_constraint_adjustment(self: &Self, value: PopupPositionerConstraintAdjustment)
placement_gravity
fn placement_gravity(self: &Self) -> PopupGravity
See Popup::placement_gravity.
set_placement_gravity
fn set_placement_gravity(self: &Self, value: PopupGravity)
placement
fn placement(self: &Self) -> PlacementMode
See Popup::placement.
set_placement
fn set_placement(self: &Self, value: PlacementMode)
window_manager_add_shadow_hint
fn window_manager_add_shadow_hint(self: &Self) -> bool
See Popup::window_manager_add_shadow_hint.
set_window_manager_add_shadow_hint
fn set_window_manager_add_shadow_hint(self: &Self, value: bool)
placement_rect
fn placement_rect(self: &Self) -> Option<Rect>
See Popup::placement_rect.
set_placement_rect
fn set_placement_rect(self: &Self, value: Option<Rect>)
placement_target
fn placement_target(self: &Self) -> Option<Ref<Control>>
See Popup::placement_target.
set_placement_target
fn set_placement_target(self: &Self, value: impl Into<Nullable<Control>>)
custom_popup_placement_callback
fn custom_popup_placement_callback(self: &Self) -> Option<CustomPopupPlacementCallback>
See Popup::custom_popup_placement_callback.
set_custom_popup_placement_callback
fn set_custom_popup_placement_callback(self: &Self, value: Option<CustomPopupPlacementCallback>)
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.
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.
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.
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.
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.
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).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtSelectingItemsControlImplExtControlImplExtMenuBaseImplExtItemsControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<ContextMenu>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplLayoutableImplInteractiveImplInputElementImplControlImplTemplatedControlImplItemsControlImplSelectingItemsControlImplFerroObjectImplVisualImplMenuBaseImplISetterValue
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.