FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ToolTip

    struct · ferroui-controls · v0.5.0

    struct ToolTip
    

    A control which pops up a hint when a control is hovered.

    You will probably not want to create a ToolTip control directly: if added to the tree it will act as a simple ContentControl styled to look like a tooltip. To add a tooltip to a control, use the Tip attached property (ToolTip::tip_property), assigning the content that you want displayed.

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

    Returns a strong reference to this object.

    Source

    PSEUDO_CLASSES

    const PSEUDO_CLASSES: PseudoClassesAttribute
    

    The pseudoclasses set by the class.

    Source

    tip_property

    fn tip_property() -> &'static AttachedProperty<Option<BoxedValue>>
    

    Defines the ToolTip.Tip attached property.

    Source

    is_open_property

    fn is_open_property() -> &'static AttachedProperty<bool>
    

    Defines the ToolTip.IsOpen attached property.

    Source

    placement_property

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

    Defines the ToolTip.Placement property.

    Source

    horizontal_offset_property

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

    Defines the ToolTip.HorizontalOffset property.

    Source

    vertical_offset_property

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

    Defines the ToolTip.VerticalOffset property.

    Source

    custom_popup_placement_callback_property

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

    Defines the ToolTip.CustomPopupPlacementCallback property; see Popup::custom_popup_placement_callback_property.

    Source

    show_delay_property

    fn show_delay_property() -> &'static AttachedProperty<i32>
    

    Defines the ToolTip.ShowDelay property.

    Source

    between_show_delay_property

    fn between_show_delay_property() -> &'static AttachedProperty<i32>
    

    Defines the ToolTip.BetweenShowDelay property.

    Source

    show_on_disabled_property

    fn show_on_disabled_property() -> &'static AttachedProperty<bool>
    

    Defines the ToolTip.ShowOnDisabled property.

    Source

    service_enabled_property

    fn service_enabled_property() -> &'static AttachedProperty<bool>
    

    Defines the ToolTip.ServiceEnabled property.

    Source

    should_use_overlay_layer_property

    fn should_use_overlay_layer_property() -> &'static AttachedProperty<bool>
    

    Defines the ToolTip.ShouldUseOverlayLayer property; see Popup::should_use_overlay_layer.

    Source

    tool_tip_property

    fn tool_tip_property() -> &'static AttachedProperty<Option<Ref<ToolTip>>>
    

    Stores the current ToolTip instance in the control (internal upstream).

    Source

    tool_tip_opening_event

    fn tool_tip_opening_event() -> &'static RoutedEvent<CancelRoutedEventArgs>
    

    The event raised when a tooltip is going to be shown on an element.

    To prevent a tooltip from appearing in the UI, your handler for ToolTipOpening can mark the event data as cancelled. Otherwise, the tooltip is displayed, using the value of the Tip property as the tooltip content. Another possible scenario is that you could write a handler that resets the value of the Tip property for the element that is the event source, just before the tooltip is displayed. ToolTipOpening will not be raised if the value of Tip is None or otherwise unset. Do not deliberately set Tip to None while a tooltip is open or opening; this will not have the effect of closing the tooltip, and will instead create an undesirable visual artifact in the UI.

    Source

    tool_tip_closing_event

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

    The event raised when a tooltip on an element that was shown should now be hidden.

    Marking the ToolTipClosing event as handled does not cancel closing the tooltip. Once the tooltip is displayed, closing the tooltip is done only in response to user interaction with the UI.

    Source

    construct

    fn construct() -> Self
    

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

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    get_tip

    fn get_tip(element: &Control) -> Option<BoxedValue>
    

    Gets the value of the ToolTip.Tip attached property: the content to be displayed in the tooltip of element.

    Source

    set_tip

    fn set_tip(element: &Control, value: Option<BoxedValue>)
    

    Sets the value of the ToolTip.Tip attached property: the content to be displayed in the tooltip of element.

    Source

    get_is_open

    fn get_is_open(element: &Control) -> bool
    

    Gets the value of the ToolTip.IsOpen attached property: whether the tooltip of element is visible.

    Source

    set_is_open

    fn set_is_open(element: &Control, value: bool)
    

    Sets the value of the ToolTip.IsOpen attached property: whether the tooltip of element is visible.

    Source

    get_placement

    fn get_placement(element: &Control) -> PlacementMode
    

    Gets the value of the ToolTip.Placement attached property: how the tooltip of element is positioned.

    Source

    set_placement

    fn set_placement(element: &Control, value: PlacementMode)
    

    Sets the value of the ToolTip.Placement attached property: how the tooltip of element is positioned.

    Source

    get_horizontal_offset

    fn get_horizontal_offset(element: &Control) -> f64
    

    Gets the value of the ToolTip.HorizontalOffset attached property.

    Source

    set_horizontal_offset

    fn set_horizontal_offset(element: &Control, value: f64)
    

    Sets the value of the ToolTip.HorizontalOffset attached property.

    Source

    get_vertical_offset

    fn get_vertical_offset(element: &Control) -> f64
    

    Gets the value of the ToolTip.VerticalOffset attached property.

    Source

    set_vertical_offset

    fn set_vertical_offset(element: &Control, value: f64)
    

    Sets the value of the ToolTip.VerticalOffset attached property.

    Source

    get_show_delay

    fn get_show_delay(element: &Control) -> i32
    

    Gets the value of the ToolTip.ShowDelay attached property: the time, in milliseconds, before the tooltip of element opens.

    Source

    set_show_delay

    fn set_show_delay(element: &Control, value: i32)
    

    Sets the value of the ToolTip.ShowDelay attached property: the time, in milliseconds, before the tooltip of element opens.

    Source

    get_between_show_delay

    fn get_between_show_delay(element: &Control) -> i32
    

    Gets the number of milliseconds since the last tooltip closed during which the tooltip of element will open immediately, or a negative value indicating that the tooltip will always wait for the show delay before opening.

    Source

    set_between_show_delay

    fn set_between_show_delay(element: &Control, value: i32)
    

    Sets the number of milliseconds since the last tooltip closed during which the tooltip of element will open immediately.

    Setting a negative value disables the immediate opening behaviour. The tooltip of element will then always wait until the show delay elapses before showing.

    Source

    get_show_on_disabled

    fn get_show_on_disabled(element: &Control) -> bool
    

    Gets whether a control will display a tooltip even if it disabled.

    Source

    set_show_on_disabled

    fn set_show_on_disabled(element: &Control, value: bool)
    

    Sets whether a control will display a tooltip even if it disabled.

    Source

    get_service_enabled

    fn get_service_enabled(element: &Control) -> bool
    

    Gets whether showing and hiding of a control's tooltip will be automatically controlled by the tooltip service.

    Source

    set_service_enabled

    fn set_service_enabled(element: &Control, value: bool)
    

    Sets whether showing and hiding of a control's tooltip will be automatically controlled by the tooltip service.

    Source

    get_should_use_overlay_layer

    fn get_should_use_overlay_layer(element: &Control) -> bool
    

    Gets whether the tooltip popup for element is shown in the overlay layer. See Popup::should_use_overlay_layer for details.

    Source

    set_should_use_overlay_layer

    fn set_should_use_overlay_layer(element: &Control, value: bool)
    

    Sets whether the tooltip popup for element is shown in the overlay layer. See Popup::should_use_overlay_layer for details.

    Source

    add_tool_tip_opening_handler

    fn add_tool_tip_opening_handler(element: &Control, handler: impl Fn(&Interactive, &CancelRoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Adds a handler for the ToolTipOpening attached event to element.

    Source

    remove_tool_tip_opening_handler

    fn remove_tool_tip_opening_handler(element: &Control, handler: RoutedEventHandlerToken)
    

    Removes a handler for the ToolTipOpening attached event from element.

    Source

    add_tool_tip_closing_handler

    fn add_tool_tip_closing_handler(element: &Control, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Adds a handler for the ToolTipClosing attached event to element.

    Source

    remove_tool_tip_closing_handler

    fn remove_tool_tip_closing_handler(element: &Control, handler: RoutedEventHandlerToken)
    

    Removes a handler for the ToolTipClosing attached event from element.

    Source

    get_custom_popup_placement_callback

    fn get_custom_popup_placement_callback(element: &Control) -> Option<CustomPopupPlacementCallback>
    

    Gets the value of the ToolTip.CustomPopupPlacementCallback attached property.

    Source

    set_custom_popup_placement_callback

    fn set_custom_popup_placement_callback(element: &Control, value: Option<CustomPopupPlacementCallback>)
    

    Sets the value of the ToolTip.CustomPopupPlacementCallback attached property.

    Source

    adorned_control

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

    The control this tooltip is shown for (internal upstream).

    Source

    closed

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

    Raised when the popup of the tooltip has closed (internal upstream).

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

    Source

    popup_host

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

    The host of the popup the tooltip 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 tooltip.

    Source

    to_popup_host_provider

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

    The tooltip as a popup host provider (the diagnostics contract it implements upstream).

    Source

    Trait implementations

    Availability

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