[−][src]Struct orbtk_api::widget_base::WidgetContainer
The WidgetContainer
wraps the entity of a widget and provides access to its properties, its children properties and its parent properties.
Implementations
impl<'a> WidgetContainer<'a>
[src]
pub fn new(
root: Entity,
ecm: &'a mut EntityComponentManager<Tree, StringComponentStore>,
theme: &'a Theme,
event_queue: Option<&'a Rc<RefCell<EventQueue>>>
) -> Self
[src]
root: Entity,
ecm: &'a mut EntityComponentManager<Tree, StringComponentStore>,
theme: &'a Theme,
event_queue: Option<&'a Rc<RefCell<EventQueue>>>
) -> Self
Creates a new widget container for the given entity
.
pub fn entity(&self) -> Entity
[src]
Gets the entity of the widget.
pub fn clear_dirty(&mut self)
[src]
Remove the dirty flag from the current widget.
pub fn get<P>(&self, key: &str) -> &P where
P: Clone + Component,
[src]
P: Clone + Component,
pub fn get_mut<P>(&mut self, key: &str) -> &mut P where
P: Clone + Component,
[src]
P: Clone + Component,
Gets a mutable reference of the property of type P
.
Panics
Panics if the widget does not contain the property.
pub fn clone_or_default<P>(&self, key: &str) -> P where
P: Clone + Component + Default,
[src]
P: Clone + Component + Default,
Clones the property. If the property does not exists for the widget the default of the property value will be returned,
pub fn clone<P>(&self, key: &str) -> P where
P: Clone + Component,
[src]
P: Clone + Component,
pub fn try_clone<P>(&self, key: &str) -> Option<P> where
P: Clone + Component,
[src]
P: Clone + Component,
Clones the property of type P
from the given widget entity. If the entity does
not exists or it doesn't have a component of type P
None
will be returned.
pub fn set<P>(&mut self, key: &str, value: P) where
P: Component + Clone + PartialEq,
[src]
P: Component + Clone + PartialEq,
Sets the property of type P
. Sets the dirty
flag of the widget to true
.
Panics
Panics if the widget does not contains the property.
pub fn set_non_dirty<P>(&mut self, key: &str, value: P) where
P: Component + Clone,
[src]
P: Component + Clone,
Sets the property of type P
without setting the widget dirty.
Panics
Panics if the widget does not contains the property.
pub fn has<P>(&self, key: &str) -> bool where
P: Clone + Component,
[src]
P: Clone + Component,
Returns true
if the widget has a property of type P
otherwise false
.
pub fn try_get<P: Component>(&self, key: &str) -> Option<&P>
[src]
Returns a reference of a property of type P
from the given widget entity. If the entity does
not exists or it doesn't have a component of type P
None
will be returned.
pub fn try_get_mut<P: Component>(&mut self, key: &str) -> Option<&mut P>
[src]
Returns a mutable reference of a property of type P
from the given widget entity. If the entity does
not exists or it doesn't have a component of type P
None
will be returned.
pub fn eq<P: Component + PartialEq>(&self, key: &str, other: &P) -> bool
[src]
Checks if the given value is equal to the given property.
pub fn update(&mut self, force: bool)
[src]
Update all properties from theme for the current widget.
pub fn update_dirty(&mut self, force: bool)
[src]
Update all properties from theme for the current widget and mark the widget as dirty.
pub fn update_widget(
&mut self,
entity: Entity,
force: bool,
should_mark_as_dirty: bool
)
[src]
&mut self,
entity: Entity,
force: bool,
should_mark_as_dirty: bool
)
Update all properties from theme for the given widget.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for WidgetContainer<'a>
impl<'a> !Send for WidgetContainer<'a>
impl<'a> !Sync for WidgetContainer<'a>
impl<'a> Unpin for WidgetContainer<'a>
impl<'a> !UnwindSafe for WidgetContainer<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<E> Component for E where
E: Any,
[src]
E: Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,