Canvas
struct · ferroui-controls · v0.5.0
struct Canvas
A panel that displays child controls at arbitrary locations.
Unlike other Panel implementations, the canvas doesn't lay out its
children in any particular layout. Instead, the positioning of each child
control is defined by the Canvas.Left, Canvas.Top, Canvas.Right and
Canvas.Bottom attached properties.
Members
TYPEto_refarrange_childleft_propertytop_propertyright_propertybottom_propertyconstructnewget_leftset_leftget_topset_topget_rightset_rightget_bottomset_bottom
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<Canvas>
Returns a strong reference to this object.
arrange_child
fn arrange_child(self: &Self, child: &Ref<Control>, final_size: Size)
Arranges a single child within the size allocated to the canvas.
left_property
fn left_property() -> &'static AttachedProperty<f64>
Defines the Left attached property.
top_property
fn top_property() -> &'static AttachedProperty<f64>
Defines the Top attached property.
right_property
fn right_property() -> &'static AttachedProperty<f64>
Defines the Right attached property.
bottom_property
fn bottom_property() -> &'static AttachedProperty<f64>
Defines the Bottom attached property.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
get_left
fn get_left(element: &FerroObject) -> f64
Gets the value of the Left attached property for a control.
set_left
fn set_left(element: &FerroObject, value: f64)
Sets the value of the Left attached property for a control.
get_top
fn get_top(element: &FerroObject) -> f64
Gets the value of the Top attached property for a control.
set_top
fn set_top(element: &FerroObject, value: f64)
Sets the value of the Top attached property for a control.
get_right
fn get_right(element: &FerroObject) -> f64
Gets the value of the Right attached property for a control.
set_right
fn set_right(element: &FerroObject, value: f64)
Sets the value of the Right attached property for a control.
get_bottom
fn get_bottom(element: &FerroObject) -> f64
Gets the value of the Bottom attached property for a control.
set_bottom
fn set_bottom(element: &FerroObject, value: f64)
Sets the value of the Bottom attached property for a control.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeCanvasImplExtControlImplExtPanelImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<Canvas>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplVisualImplInteractiveImplInputElementImplControlImplPanelImplFerroObjectImplLayoutableImplCanvasImplINavigableContainer
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.