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.
Members
TYPEto_refPSEUDO_CLASSEStip_propertyis_open_propertyplacement_propertyhorizontal_offset_propertyvertical_offset_propertycustom_popup_placement_callback_propertyshow_delay_propertybetween_show_delay_propertyshow_on_disabled_propertyservice_enabled_propertyshould_use_overlay_layer_propertytool_tip_propertytool_tip_opening_eventtool_tip_closing_eventconstructnewget_tipset_tipget_is_openset_is_openget_placementset_placementget_horizontal_offsetset_horizontal_offsetget_vertical_offsetset_vertical_offsetget_show_delayset_show_delayget_between_show_delayset_between_show_delayget_show_on_disabledset_show_on_disabledget_service_enabledset_service_enabledget_should_use_overlay_layerset_should_use_overlay_layeradd_tool_tip_opening_handlerremove_tool_tip_opening_handleradd_tool_tip_closing_handlerremove_tool_tip_closing_handlerget_custom_popup_placement_callbackset_custom_popup_placement_callbackadorned_controlclosedpopup_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<ToolTip>
Returns a strong reference to this object.
PSEUDO_CLASSES
const PSEUDO_CLASSES: PseudoClassesAttribute
The pseudoclasses set by the class.
tip_property
fn tip_property() -> &'static AttachedProperty<Option<BoxedValue>>
Defines the ToolTip.Tip attached property.
is_open_property
fn is_open_property() -> &'static AttachedProperty<bool>
Defines the ToolTip.IsOpen attached property.
placement_property
fn placement_property() -> &'static AttachedProperty<PlacementMode>
Defines the ToolTip.Placement property.
horizontal_offset_property
fn horizontal_offset_property() -> &'static AttachedProperty<f64>
Defines the ToolTip.HorizontalOffset property.
vertical_offset_property
fn vertical_offset_property() -> &'static AttachedProperty<f64>
Defines the ToolTip.VerticalOffset property.
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.
show_delay_property
fn show_delay_property() -> &'static AttachedProperty<i32>
Defines the ToolTip.ShowDelay property.
between_show_delay_property
fn between_show_delay_property() -> &'static AttachedProperty<i32>
Defines the ToolTip.BetweenShowDelay property.
show_on_disabled_property
fn show_on_disabled_property() -> &'static AttachedProperty<bool>
Defines the ToolTip.ShowOnDisabled property.
service_enabled_property
fn service_enabled_property() -> &'static AttachedProperty<bool>
Defines the ToolTip.ServiceEnabled property.
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.
tool_tip_property
fn tool_tip_property() -> &'static AttachedProperty<Option<Ref<ToolTip>>>
Stores the current ToolTip instance in the control (internal
upstream).
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.
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.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
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.
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.
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.
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.
get_placement
fn get_placement(element: &Control) -> PlacementMode
Gets the value of the ToolTip.Placement attached property: how the
tooltip of element is positioned.
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.
get_horizontal_offset
fn get_horizontal_offset(element: &Control) -> f64
Gets the value of the ToolTip.HorizontalOffset attached property.
set_horizontal_offset
fn set_horizontal_offset(element: &Control, value: f64)
Sets the value of the ToolTip.HorizontalOffset attached property.
get_vertical_offset
fn get_vertical_offset(element: &Control) -> f64
Gets the value of the ToolTip.VerticalOffset attached property.
set_vertical_offset
fn set_vertical_offset(element: &Control, value: f64)
Sets the value of the ToolTip.VerticalOffset attached property.
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.
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.
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.
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.
get_show_on_disabled
fn get_show_on_disabled(element: &Control) -> bool
Gets whether a control will display a tooltip even if it disabled.
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.
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.
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.
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.
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.
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.
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.
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.
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.
get_custom_popup_placement_callback
fn get_custom_popup_placement_callback(element: &Control) -> Option<CustomPopupPlacementCallback>
Gets the value of the ToolTip.CustomPopupPlacementCallback
attached property.
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.
adorned_control
fn adorned_control(self: &Self) -> Option<Ref<Control>>
The control this tooltip is shown for (internal upstream).
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.
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.
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.
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).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtContentControlImplExtControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<ToolTip>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplVisualImplLayoutableImplInteractiveImplInputElementImplTemplatedControlImplContentControlImplControlImplFerroObjectImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.