FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ControlAutomationPeer

    struct · ferroui-controls · v0.5.0

    struct ControlAutomationPeer
    

    An automation peer which represents a Control.

    The peer does not keep its control alive (the control owns the peer); see owner.

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

    Returns a strong reference to this object.

    Source

    get_children_core

    fn get_children_core(self: &Self) -> Option<Vec<Ref<AutomationPeer>>>
    

    Gets the child automation peers of the peer, or None if it has none. The default implementation returns the peers of the visible visual children of the owner.

    Source

    get_visual_parent

    fn get_visual_parent(self: &Self) -> Option<Ref<Visual>>
    

    Gets the visual the peer of which is the parent of this peer (not for use outside the framework).

    Source

    construct

    fn construct(owner: &Control) -> Self
    

    Creates the class data of a peer of owner; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new(owner: &Control) -> Ref<Self>
    

    Initializes a new peer of owner.

    Source

    owner

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

    Gets the owning control.

    A control owns its peer, so the peer holds the control weakly.

    Panics

    Panics if the control no longer exists: a peer must not be used after its control has been released (code that keeps a peer beyond the life of the tree keeps the control with it, or asks try_owner).

    Source

    try_owner

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

    Gets the owning control, or None if it no longer exists.

    Source

    get_or_create

    fn get_or_create(self: &Self, element: &Control) -> Ref<AutomationPeer>
    

    Gets or creates an automation peer for a control: this peer for its owner, the peer of element otherwise.

    Source

    create_peer_for_element

    fn create_peer_for_element(element: &Control) -> Ref<AutomationPeer>
    

    Gets an existing automation peer of a control, or creates a new one if it does not yet exist.

    Despite the name (which comes from the analogous WPF API), this method does not create a new peer if one already exists: instead it returns the existing peer.

    Source

    from_element

    fn from_element(element: &Control) -> Option<Ref<AutomationPeer>>
    

    Gets an existing automation peer of a control, or None if it does not yet exist.

    Source

    invalidate_children

    fn invalidate_children(self: &Self)
    

    Invalidates the peer's children and causes a re-read from get_children_core.

    Source

    invalidate_parent

    fn invalidate_parent(self: &Self)
    

    Invalidates the peer's parent.

    Source

    Trait implementations

    Availability

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