pub trait PropertyArgs: Send + Sync {
// Required methods
fn clone_boxed(&self) -> Box<dyn PropertyArgs>;
fn property(&self) -> PropertyInfo;
fn build_action(&self, wgt: &mut WidgetBuilding);
fn instantiate(&self, child: UiNode) -> UiNode;
// Provided methods
fn var(&self, i: usize) -> &AnyVar { ... }
fn value(&self, i: usize) -> &dyn AnyVarValue { ... }
fn ui_node(&self, i: usize) -> &ArcNode { ... }
fn handler(&self, i: usize) -> &dyn AnyArcHandler { ... }
}Expand description
Represents a property instantiation request.
Required Methods§
Sourcefn clone_boxed(&self) -> Box<dyn PropertyArgs>
fn clone_boxed(&self) -> Box<dyn PropertyArgs>
Clones the arguments.
Sourcefn property(&self) -> PropertyInfo
fn property(&self) -> PropertyInfo
Property info.
Sourcefn build_action(&self, wgt: &mut WidgetBuilding)
fn build_action(&self, wgt: &mut WidgetBuilding)
Apply the build action property from the args.
if the property is not PropertyInfo::build_action does nothing.
Sourcefn instantiate(&self, child: UiNode) -> UiNode
fn instantiate(&self, child: UiNode) -> UiNode
Create a property instance from args clone or taken.
If the property is PropertyInfo::build_action the child is returned unchanged.
Provided Methods§
Sourcefn var(&self, i: usize) -> &AnyVar
fn var(&self, i: usize) -> &AnyVar
Gets a InputKind::Var.
Sourcefn value(&self, i: usize) -> &dyn AnyVarValue
fn value(&self, i: usize) -> &dyn AnyVarValue
Gets a InputKind::Value.
Sourcefn ui_node(&self, i: usize) -> &ArcNode
fn ui_node(&self, i: usize) -> &ArcNode
Gets a InputKind::UiNode.
Sourcefn handler(&self, i: usize) -> &dyn AnyArcHandler
fn handler(&self, i: usize) -> &dyn AnyArcHandler
Gets a InputKind::Handler.
Is an ArcHandler<A>.
Implementations§
Source§impl dyn PropertyArgs + '_
impl dyn PropertyArgs + '_
Sourcepub fn id(&self) -> PropertyId
pub fn id(&self) -> PropertyId
Unique ID.
Sourcepub fn downcast_value<T>(&self, i: usize) -> &Twhere
T: VarValue,
pub fn downcast_value<T>(&self, i: usize) -> &Twhere
T: VarValue,
Gets a strongly typed value.
Panics if the type does not match.
Sourcepub fn downcast_var<T>(&self, i: usize) -> Var<T>where
T: VarValue,
pub fn downcast_var<T>(&self, i: usize) -> Var<T>where
T: VarValue,
Gets a strongly typed var.
Panics if the variable value type does not match.
Sourcepub fn downcast_handler<A>(&self, i: usize) -> &ArcHandler<A>where
A: 'static + Clone,
pub fn downcast_handler<A>(&self, i: usize) -> &ArcHandler<A>where
A: 'static + Clone,
Gets a strongly typed handler.
Panics if the args type does not match.
Sourcepub fn live_debug(&self, i: usize) -> Var<Txt>
pub fn live_debug(&self, i: usize) -> Var<Txt>
Gets the property input as a debug variable.
If the input is a variable the returned variable will update with it, if not it is a static print.
Note that you must call this in the widget context to get the correct value.
Sourcepub fn debug(&self, i: usize) -> Txt
pub fn debug(&self, i: usize) -> Txt
Gets the property input current value as a debug text.
Note that you must call this in the widget context to get the correct value.
Sourcepub fn new_build(
&self,
attributes: PropertyAttributes,
attributes_when_data: PropertyAttributesWhenData,
) -> Box<dyn PropertyArgs>
pub fn new_build( &self, attributes: PropertyAttributes, attributes_when_data: PropertyAttributesWhenData, ) -> Box<dyn PropertyArgs>
Call new with the same instance info and args, but with the build_actions and build_actions_when_data.