Skip to main content

ControlAttribute

Enum ControlAttribute 

Source
pub enum ControlAttribute {
Show 14 variants BoundingBox(Bounds), ZIndex(u32), Padding((u32, u32), (u32, u32)), Text(Property), FontAttr(Font), StateAttr(State), PopupAttr(Popup), AppearanceAttr(Appearance), ScrollAttr(Scroll), Id(String), SubComponents(Vec<Control>), Controller(String), Action(ActionTrigger, String), Canvas(Resource<BindingCanvas>),
}
Expand description

Attribute attached to a control

Variants§

§

BoundingBox(Bounds)

The bounding box for this control

§

ZIndex(u32)

§

Padding((u32, u32), (u32, u32))

§

Text(Property)

The text for this control

§

FontAttr(Font)

Specifies the font properties of this control

§

StateAttr(State)

Specifies the state of this control

§

PopupAttr(Popup)

Specifies the popup state of this control (meaningless if this is not a popup control)

§

AppearanceAttr(Appearance)

Specifies the appearance of this control

§

ScrollAttr(Scroll)

Specifies how the contents of this control will scroll

§

Id(String)

The unique ID for this control

§

SubComponents(Vec<Control>)

Subcomponents of this control

§

Controller(String)

Specifies the controller that manages the subcomponents of this control

§

Action(ActionTrigger, String)

When the specified action occurs for this item, send the event denoted by the string to the controller

§

Canvas(Resource<BindingCanvas>)

Specifies the canvas to use for this control (assuming it’s a canvas control)

Implementations§

Source§

impl ControlAttribute

Source

pub fn bounding_box<'a>(&'a self) -> Option<&'a Bounds>

The bounding box represented by this attribute

Source

pub fn z_index(&self) -> Option<u32>

The Z-Index represented by this attribute

Source

pub fn padding(&self) -> Option<((u32, u32), (u32, u32))>

The padding represented by this attribute

Source

pub fn text<'a>(&'a self) -> Option<&'a Property>

The text represented by this attribute

Source

pub fn font<'a>(&'a self) -> Option<&'a Font>

The font atrributes represented by this attribute

Source

pub fn id<'a>(&'a self) -> Option<&'a String>

The ID represented by this attribute

Source

pub fn subcomponents<'a>(&'a self) -> Option<&'a Vec<Control>>

The subcomponent represented by this attribute

Source

pub fn controller<'a>(&'a self) -> Option<&'a str>

The controller represented by this attribute

Source

pub fn action<'a>(&'a self) -> Option<(&'a ActionTrigger, &'a String)>

The action represented by this attribute

Source

pub fn state<'a>(&'a self) -> Option<&'a State>

The control state represented by this attribute

Source

pub fn popup<'a>(&'a self) -> Option<&'a Popup>

The popup attribute represented by this attribute

Source

pub fn canvas<'a>(&'a self) -> Option<&'a Resource<BindingCanvas>>

The canvas resource for this control, if there is one

Source

pub fn appearance<'a>(&'a self) -> Option<&'a Appearance>

The appearance assigned by this attribute, if there is one

Source

pub fn scroll<'a>(&'a self) -> Option<&'a Scroll>

The appearance assigned by this attribute, if there is one

Source

pub fn is_different_flat(&self, compare_to: &ControlAttribute) -> bool

Returns true if this attribute is different from another one (non-recursively, so this won’t check subcomoponents)

Trait Implementations§

Source§

impl Clone for ControlAttribute

Source§

fn clone(&self) -> ControlAttribute

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ControlAttribute

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Modifier<Control> for ControlAttribute

Source§

fn modify(self, control: &mut Control)

Modify F with self.
Source§

impl PartialEq for ControlAttribute

Source§

fn eq(&self, other: &ControlAttribute) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ControlAttribute

Source§

impl ToJsonValue for ControlAttribute

Source§

fn to_json(&self) -> Value

Creates a JSON representation of this item

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<A> ControlModifier for A
where A: Modifier<Control>,

Source§

fn modify(self, control: &mut Control)

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.