Skip to main content

Flyout

Struct Flyout 

Source
pub struct Flyout { /* private fields */ }
Expand description

A flyout that displays arbitrary content.

Implementations§

Source§

impl Flyout

Source

pub const TYPE: &'static TypeInfo = <Flyout as ::ferroui_base::StaticType>::TYPE

The runtime type of this class.

Source

pub fn to_ref(&self) -> Ref<Flyout>

Returns a strong reference to this object.

Source§

impl Flyout

Source

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

Defines the Content property.

Source

pub fn content_template_property() -> &'static StyledProperty<Option<Rc<dyn IDataTemplate>>>

Defines the ContentTemplate property.

Source

pub fn flyout_presenter_theme_property() -> &'static StyledProperty<Option<Ref<ControlTheme>>>

Defines the FlyoutPresenterTheme property.

Source§

impl Flyout

Source

pub fn construct() -> Self

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

Source

pub fn new() -> Ref<Self>

Creates a flyout.

Source

pub fn flyout_presenter_classes(&self) -> Classes

The classes collection to apply to the flyout presenter this flyout is hosting.

Source

pub fn flyout_presenter_theme(&self) -> Option<Ref<ControlTheme>>

The control theme that is applied to the container element generated for the flyout presenter.

Source

pub fn set_flyout_presenter_theme( &self, value: impl Into<Nullable<ControlTheme>>, )

Source

pub fn content(&self) -> Option<BoxedValue>

The content to display in this flyout.

Source

pub fn set_content(&self, value: Option<BoxedValue>)

Source

pub fn content_template(&self) -> Option<Rc<dyn IDataTemplate>>

The data template used to display the content of the flyout.

Source

pub fn set_content_template(&self, value: Option<Rc<dyn IDataTemplate>>)

Methods from Deref<Target = PopupFlyoutBase>§

Source

pub fn to_ref(&self) -> Ref<PopupFlyoutBase>

Returns a strong reference to this object.

Source

pub fn hide_core(&self, can_cancel: bool) -> bool

Hides the flyout; can_cancel tells whether the Closing event is raised and may cancel. Returns true if the action was handled.

Source

pub fn show_at_core( &self, placement_target: &Control, show_at_pointer: bool, ) -> bool

Shows the flyout at the given control, at the pointer location when show_at_pointer. Returns true if the action was handled.

Source

pub fn on_opening(&self, args: &CancelEventArgs)

Raises the Opening event.

Source

pub fn on_closing(&self, args: &CancelEventArgs)

Raises the Closing event.

Source

pub fn create_presenter(&self) -> Ref<Control>

Used to create the content the flyout displays.

Source

pub fn popup(&self) -> Ref<Popup>

The popup the flyout is shown in, created on first use. For derived classes.

Source

pub fn placement(&self) -> PlacementMode

The desired placement of the flyout in relation to its target.

Source

pub fn set_placement(&self, value: PlacementMode)

Source

pub fn placement_gravity(&self) -> PopupGravity

Defines in what direction the flyout should open when the placement is PlacementMode::AnchorAndGravity.

Source

pub fn set_placement_gravity(&self, value: PopupGravity)

Source

pub fn placement_anchor(&self) -> PopupAnchor

The anchor point on the placement rect when the placement is PlacementMode::AnchorAndGravity.

Source

pub fn set_placement_anchor(&self, value: PopupAnchor)

Source

pub fn horizontal_offset(&self) -> f64

The horizontal offset of the flyout in relation to its target.

Source

pub fn set_horizontal_offset(&self, value: f64)

Source

pub fn vertical_offset(&self) -> f64

The vertical offset of the flyout in relation to its target.

Source

pub fn set_vertical_offset(&self, value: f64)

Source

pub fn custom_popup_placement_callback( &self, ) -> Option<CustomPopupPlacementCallback>

The callback that positions the flyout when the placement is PlacementMode::Custom.

Source

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

Source

pub fn show_mode(&self) -> FlyoutShowMode

The desired show mode.

Source

pub fn set_show_mode(&self, value: FlyoutShowMode)

Source

pub fn overlay_dismiss_event_pass_through(&self) -> bool

Whether the event that closes the flyout is passed through to the parent window.

Clicks outside the popup cause the popup to close. When this is false, these clicks will be handled by the popup and not be registered by the parent window. When true, the events will be passed through to the parent window.

Source

pub fn set_overlay_dismiss_event_pass_through(&self, value: bool)

Source

pub fn overlay_input_pass_through_element(&self) -> Option<Ref<InputElement>>

An element that should receive pointer input events even when underneath the flyout’s overlay.

Source

pub fn set_overlay_input_pass_through_element( &self, value: impl Into<Nullable<InputElement>>, )

Source

pub fn placement_constraint_adjustment( &self, ) -> PopupPositionerConstraintAdjustment

Describes how the flyout position will be adjusted if the unadjusted position would result in the flyout being partly constrained.

Source

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

Source

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

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

Source

pub fn closing( &self, handler: impl Fn(&CancelEventArgs) + 'static, ) -> Rc<dyn IDisposable>

Raised before the flyout closes; the close can be cancelled. Disposing the returned handle unsubscribes.

Source

pub fn opening( &self, handler: impl Fn(&CancelEventArgs) + 'static, ) -> Rc<dyn IDisposable>

Raised before the flyout opens; the opening can be cancelled. Disposing the returned handle unsubscribes.

Source

pub fn show_at_with(&self, placement_target: &Control, show_at_pointer: bool)

Shows the flyout for the given control at the current pointer location when show_at_pointer, as in a context flyout.

Methods from Deref<Target = FlyoutBase>§

Source

pub fn to_ref(&self) -> Ref<FlyoutBase>

Returns a strong reference to this object.

Source

pub fn show_at(&self, placement_target: &Control)

Shows the flyout at the given control.

Source

pub fn hide(&self)

Hides the flyout.

Source

pub fn on_opened(&self)

Raises the Opened event.

Source

pub fn on_closed(&self)

Raises the Closed event.

Source

pub fn opened(&self, handler: impl Fn() + 'static) -> Rc<dyn IDisposable>

Raised when the flyout is opened. Disposing the returned handle unsubscribes.

Source

pub fn closed(&self, handler: impl Fn() + 'static) -> Rc<dyn IDisposable>

Raised when the flyout is closed. Disposing the returned handle unsubscribes.

Source

pub fn is_open(&self) -> bool

Whether this flyout is currently open.

Setting this property to true will show the flyout at the last known placement target. If no target has been set via show_at, setting this to true will have no effect.

Source

pub fn set_is_open(&self, value: bool)

Source

pub fn target(&self) -> Option<Ref<Control>>

The target used for showing the flyout.

Source

pub fn set_target(&self, value: impl Into<Nullable<Control>>)

Sets the target used for showing the flyout. For derived classes.

Methods from Deref<Target = FerroObject>§

Source

pub fn dispatcher(&self) -> &Arc<Dispatcher> ⓘ

Returns the Dispatcher that this object is associated with: the dispatcher of the thread that owns the object.

Source

pub fn check_access(&self) -> bool

Returns whether the calling thread is the thread that owns this object.

Source

pub fn verify_access(&self)

Checks that the calling thread is the thread that owns this object.

§Panics

Panics when it is not.

Source

pub fn to_ref(&self) -> Ref<FerroObject>

A strong reference to this object.

Source

pub fn to_weak(&self) -> WeakRef<FerroObject>

A weak reference to this object.

Source

pub fn get_type(&self) -> &'static TypeInfo

The runtime type of the object.

Source

pub fn is<T>(&self) -> bool
where T: ObjectType,

Whether the object is of class T or a class derived from it.

Source

pub fn downcast_ref<T>(&self) -> Option<&T>
where T: ObjectType,

Returns the object viewed as class T if it is one.

Source

pub fn on_property_changed(&self, change: &FerroPropertyChangedEventArgs<'_>)

Invokes the on_property_changed virtual member.

Source

pub fn inheritance_parent(&self) -> Option<Ref<FerroObject>>

The parent object that inherited property values are inherited from.

Source

pub fn set_inheritance_parent(&self, value: impl Into<Nullable<FerroObject>>)

Sets the parent object that inherited property values are inherited from.

Source

pub fn clear_value<T>(&self, property: &'static StyledProperty<T>)
where T: PropertyValue,

Clears a property’s local value.

Source

pub fn get_value<T>(&self, property: &'static StyledProperty<T>) -> T
where T: PropertyValue,

Gets a property value.

Source

pub fn get_base_value<T>( &self, property: &'static StyledProperty<T>, ) -> Option<T>
where T: PropertyValue,

Gets a property’s base value: the value excluding animated values. Returns None if the value comes from inheritance or the default.

Source

pub fn is_animating(&self, property: &FerroProperty) -> bool

Checks whether a property is animating.

Source

pub fn is_set(&self, property: &FerroProperty) -> bool

Checks whether a styled property has a value assigned to it or a binding targeting it.

Source

pub fn set_value<T>(&self, property: &'static StyledProperty<T>, value: T)
where T: PropertyValue,

Sets a property value with local value priority.

Source

pub fn set_value_with_priority<T>( &self, property: &'static StyledProperty<T>, value: T, priority: BindingPriority, ) -> Option<Rc<dyn IDisposable>>
where T: PropertyValue,

Sets a property value with the given priority. For priorities other than local value, disposing the returned handle removes the value.

Source

pub fn set_current_value<T>( &self, property: &'static StyledProperty<T>, value: T, )
where T: PropertyValue,

Sets the value of a property without changing its value source.

This is used by a component that programmatically sets the value of one of its own properties without disabling an application’s declared use of the property: the effective value changes, but existing bindings and styles continue to work. The new value has the property’s current priority.

Source

pub fn bind_binding( &self, property: &'static FerroProperty, binding: &dyn BindingBase, ) -> Rc<dyn BindingExpressionBase>

Binds a property to a binding. Returns the binding expression which represents the binding instance on this object.

Source

pub fn bind_binding_with_anchor( &self, property: &'static FerroProperty, binding: &dyn BindingBase, anchor: Option<&Ref<FerroObject>>, ) -> Rc<dyn BindingExpressionBase>

Binds a property to a binding.

Some bindings need context to locate their source: a data context, named elements or resources. If this object is not an element, or is not yet attached to the tree, anchor provides that context.

Source

pub fn indexer(&self, binding: &IndexerDescriptor) -> IndexerBinding

Gets a binding to a property of this object: the indexer taking an IndexerDescriptor (source[!Property] is source.indexer(&Property.bind())).

Source

pub fn bind_indexer( &self, binding: &IndexerDescriptor, value: &dyn BindingBase, ) -> Rc<dyn BindingExpressionBase>

Binds the property of an IndexerDescriptor to a binding: the setter of the indexer (target[!Property] = binding is target.bind_indexer(&Property.bind(), &binding)).

Source

pub fn bind<T>( &self, property: &'static StyledProperty<T>, source: Rc<dyn IObservable<T>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>
where T: PropertyValue,

Binds a property to an observable.

Source

pub fn bind_value<T>( &self, property: &'static StyledProperty<T>, source: Rc<dyn IObservable<BindingValue<T>>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>
where T: PropertyValue,

Binds a property to an observable of binding values.

Source

pub fn bind_untyped<T>( &self, property: &'static StyledProperty<T>, source: Rc<dyn IObservable<Rc<dyn AnyValue>>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>
where T: PropertyValue,

Binds a property to an observable of untyped values.

Source

pub fn coerce_value(&self, property: &'static FerroProperty)

Coerces the specified property.

Source

pub fn get_direct_value<T>(&self, property: &'static DirectPropertyBase<T>) -> T
where T: PropertyValue,

Gets a direct property value.

Source

pub fn set_direct_value<T>( &self, property: &'static DirectPropertyBase<T>, value: T, )
where T: PropertyValue,

Sets a direct property value.

Source

pub fn clear_direct_value<T>(&self, property: &'static DirectPropertyBase<T>)
where T: PropertyValue,

Resets a direct property to its unset value.

Source

pub fn bind_direct<T>( &self, property: &'static DirectPropertyBase<T>, source: Rc<dyn IObservable<T>>, ) -> Rc<dyn IDisposable>
where T: PropertyValue,

Binds a direct property to an observable.

Source

pub fn bind_direct_value<T>( &self, property: &'static DirectPropertyBase<T>, source: Rc<dyn IObservable<BindingValue<T>>>, ) -> Rc<dyn IDisposable>
where T: PropertyValue,

Binds a direct property to an observable of binding values.

Source

pub fn bind_direct_untyped<T>( &self, property: &'static DirectPropertyBase<T>, source: Rc<dyn IObservable<Rc<dyn AnyValue>>>, ) -> Rc<dyn IDisposable>
where T: PropertyValue,

Binds a direct property to an observable of untyped values.

Source

pub fn set_and_raise<T>( &self, property: &'static DirectPropertyBase<T>, field: &RefCell<T>, value: T, ) -> bool
where T: PropertyValue,

Sets the backing field of a direct property, raising a change notification if the value changed. Returns true if it changed.

Source

pub fn set_and_raise_cell<T>( &self, property: &'static DirectPropertyBase<T>, field: &Cell<T>, value: T, ) -> bool
where T: PropertyValue + Copy,

set_and_raise for Copy values stored in a Cell.

Source

pub fn get_value_untyped( &self, property: &'static FerroProperty, ) -> Rc<dyn AnyValue>

Gets a property value as an untyped value.

Source

pub fn set_value_untyped( &self, property: &'static FerroProperty, value: &(dyn Any + 'static), priority: BindingPriority, ) -> Option<Rc<dyn IDisposable>>

Sets a property from an untyped value, which must hold exactly the property’s value type or the unset marker.

Source

pub fn set_current_value_untyped( &self, property: &'static FerroProperty, value: &(dyn Any + 'static), )

set_current_value with an untyped value.

Source

pub fn clear_value_untyped(&self, property: &'static FerroProperty)

Clears a property’s local value.

Source

pub fn bind_property_untyped( &self, property: &'static FerroProperty, source: Rc<dyn IObservable<Rc<dyn AnyValue>>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>

Binds a property to an observable of untyped values.

Source

pub fn property_changed( &self, handler: impl Fn(&FerroPropertyChangedEventArgs<'_>) + 'static, ) -> Rc<dyn IDisposable>

Subscribes to property changes on this object. Disposing the returned handle unsubscribes.

Source

pub fn add_property_changed_handler( &self, handler: Rc<dyn Fn(&FerroPropertyChangedEventArgs<'_>)>, ) -> u64

Subscribes handler to property changes on this object and returns the token that remove_property_changed_handler takes: property_changed for a subscriber that keeps the object and the token itself, so that no handle is made.

Source

pub fn remove_property_changed_handler(&self, token: u64) -> bool

Ends a subscription of add_property_changed_handler.

Source

pub fn property_changed_subscriber_count(&self) -> usize

The number of subscribers to property changes on this object (a diagnostics member, used by tests to verify that subscriptions are released).

Source

pub fn raise_property_changed<T>( &self, property: &'static FerroProperty, old_value: Option<&T>, new_value: &T, priority: BindingPriority, is_effective_value: bool, )
where T: PropertyValue,

Raises a property changed notification.

Source

pub fn raise_direct_property_changed<T>( &self, property: &'static DirectPropertyBase<T>, old_value: &T, new_value: &T, )
where T: PropertyValue,

Raises a property changed notification for a direct property.

Trait Implementations§

Source§

impl Deref for Flyout

Source§

type Target = PopupFlyoutBase

The resulting type after dereferencing.
Source§

fn deref(&self) -> &PopupFlyoutBase

Dereferences the value.
Source§

impl FerroObjectImpl for Flyout

Source§

fn constructed(this: &Self)

Called once, right after the object has been allocated. This is where constructor logic that needs a reference to the object runs. Overrides must call parent_constructed first.
Source§

fn on_property_changed_core( this: &Self, change: &FerroPropertyChangedEventArgs<'_>, )

Called for every property change on the object, including changes of non-effective (base) values. Overriding this is rarely needed; override on_property_changed instead.
Source§

fn on_property_changed(this: &Self, change: &FerroPropertyChangedEventArgs<'_>)

Called when the effective value of a property changes on the object.
Source§

fn update_data_validation( this: &Self, property: &'static FerroProperty, state: BindingValueType, error: Option<&BindingError>, )

Called to update the validation state for properties for which data validation is enabled.
Source§

impl FlyoutBaseImpl for Flyout

Source§

fn show_at(this: &Self, placement_target: &Control)

Shows the flyout at the given control.
Source§

fn hide(this: &Self)

Hides the flyout.
Source§

fn on_opened(this: &Self)

Raises the Opened event.
Source§

fn on_closed(this: &Self)

Raises the Closed event.
Source§

impl ObjectType for Flyout

Source§

type Parent = PopupFlyoutBase

The base class. The root class is its own parent.
Source§

type VTable = <PopupFlyoutBase as ObjectType>::VTable

The virtual table of the class.
Source§

fn vtable() -> &'static Self::VTable

The virtual table used by instances whose most-derived class is Self.
Source§

fn register_class()

The static initialisation of the class. The first call on a thread, after doing the same for the base class: Read more
Source§

impl PopupFlyoutBaseImpl for Flyout

Source§

fn create_presenter(this: &Self) -> Ref<Control>

Used to create the content the flyout displays.
Source§

fn on_opening(this: &Self, args: &CancelEventArgs)

Raises the Opening event.
Source§

fn hide_core(this: &Self, can_cancel: bool) -> bool

Hides the flyout; can_cancel tells whether the Closing event is raised and may cancel. Returns true if the action was handled.
Source§

fn show_at_core( this: &Self, placement_target: &Control, show_at_pointer: bool, ) -> bool

Shows the flyout at the given control, at the pointer location when show_at_pointer. Returns true if the action was handled.
Source§

fn on_closing(this: &Self, args: &CancelEventArgs)

Raises the Closing event.
Source§

impl StaticType for Flyout

Source§

const TYPE: &'static TypeInfo

The runtime type.
Source§

impl<T> Subclassable<T> for Flyout

Source§

impl Upcast<Flyout> for Flyout

Source§

fn upcast(&self) -> &Flyout

Source§

impl<T: ?Sized> Upcast<T> for Flyout

Source§

fn upcast(&self) -> &T

Auto Trait Implementations§

§

impl !Freeze for Flyout

§

impl !RefUnwindSafe for Flyout

§

impl !Send for Flyout

§

impl !Sync for Flyout

§

impl !UnwindSafe for Flyout

§

impl Unpin for Flyout

§

impl UnsafeUnpin for Flyout

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> FerroObjectImplExt for T
where T: FerroObjectImpl,

Source§

impl<T> FlyoutBaseImplExt for T
where T: FlyoutBaseImpl,

Source§

fn parent_show_at(this: &Self, placement_target: &Control)

Calls the base class implementation of the member.
Source§

fn parent_hide(this: &Self)

Calls the base class implementation of the member.
Source§

fn parent_on_opened(this: &Self)

Calls the base class implementation of the member.
Source§

fn parent_on_closed(this: &Self)

Calls the base class implementation of the member.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PopupFlyoutBaseImplExt for T

Source§

fn parent_hide_core(this: &Self, can_cancel: bool) -> bool

Calls the base class implementation of the member.
Source§

fn parent_show_at_core( this: &Self, placement_target: &Control, show_at_pointer: bool, ) -> bool

Calls the base class implementation of the member.
Source§

fn parent_on_opening(this: &Self, args: &CancelEventArgs)

Calls the base class implementation of the member.
Source§

fn parent_on_closing(this: &Self, args: &CancelEventArgs)

Calls the base class implementation of the member.
Source§

fn parent_create_presenter(this: &Self) -> Ref<Control>

Calls the base class implementation of the member.
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.