Struct components::elements::WidgetComponent
source · [−]pub struct WidgetComponent {Show 54 fields
pub id: Id,
pub user: Option<HashMap<String, String>>,
pub canvas: Box<Option<CanvasElement>>,
pub closest_to_canvas: Option<Id>,
pub x: f32,
pub y: f32,
pub w: f32,
pub h: f32,
pub w_min: f32,
pub h_min: f32,
pub w_max: f32,
pub h_max: f32,
pub x_local: f32,
pub y_local: f32,
pub clip: Option<Id>,
pub children: Vec<Id>,
pub isfocused: bool,
pub ismarked: bool,
pub iscaptured: bool,
pub ishovered: bool,
pub mouse_input: bool,
pub key_input: bool,
pub renderable: bool,
pub destroyed: bool,
pub visible: bool,
pub children_bounds: ChildBounds,
pub oncreate: Option<ActorChannel<()>>,
pub onrender: Option<ActorChannel<()>>,
pub onbounds: Option<ActorChannel<()>>,
pub ondestroy: Option<ActorChannel<()>>,
pub onvisible: Option<ActorChannel<bool>>,
pub ondepth: Option<ActorChannel<f32>>,
pub onclip: Option<ActorChannel<WidgetClipEvent>>,
pub onchildadd: Option<ActorChannel<Id>>,
pub onchildremove: Option<ActorChannel<Id>>,
pub onmousedown: Option<ActorChannel<MouseEvent>>,
pub onmouseup: Option<ActorChannel<MouseEvent>>,
pub onmousemove: Option<ActorChannel<MouseEvent>>,
pub onmousewheel: Option<ActorChannel<MouseEvent>>,
pub onmouseenter: Option<ActorChannel<MouseEvent>>,
pub onmouseleave: Option<ActorChannel<MouseEvent>>,
pub onkeydown: Option<ActorChannel<KeyEvent>>,
pub onkeyup: Option<ActorChannel<KeyEvent>>,
pub ontextinput: Option<ActorChannel<TextEvent>>,
pub onfocused: Option<ActorChannel<bool>>,
pub onmarked: Option<ActorChannel<bool>>,
pub oncaptured: Option<ActorChannel<bool>>,
pub parent: Option<Id>,
pub depth: f32,
pub depth_offset: f32,
pub vis_state: bool,
pub update_vis_state: bool,
pub updating: bool,
pub ignore_spatial: bool,
}
Expand description
An empty control. Base struct for all controls handles propogation of events, mouse handling, layout and so on
Fields
id: Id
The id of this control
user: Option<HashMap<String, String>>
Generic framework/user specific data to store with the control, which can be strong typed on the receiving end.
canvas: Box<Option<CanvasElement>>
closest_to_canvas: Option<Id>
the top most control below the canvas that holds us
x: f32
The x position of the control bounds, world coordinate
y: f32
The y position of the control bounds, world coordinate
w: f32
The width of the control bounds
h: f32
The height of the control bounds
w_min: f32
The minimum width
h_min: f32
The minimum height
w_max: f32
The maximum width
h_max: f32
The maximum height
x_local: f32
The right edge of the control bounds The bottom edge of the control bounds The x position of the control bounds, relative to its container
y_local: f32
The y position of the control bounds, relative to its container
clip: Option<Id>
The control this one is clipped by
children: Vec<Id>
the list of children added to this control
isfocused: bool
the number of controls below and including this one if the control has focus
ismarked: bool
if the control is marked for potential focus
iscaptured: bool
if the control has modal focus
ishovered: bool
if the control is under the mouse
mouse_input: bool
if the control accepts mouse events
key_input: bool
if the control accepts key events
renderable: bool
if the control emits a render signal
destroyed: bool
if the control has been destroyed and is no longer usable
visible: bool
If the control is visible
children_bounds: ChildBounds
A getter for the bounds information about the children and their children in this control
oncreate: Option<ActorChannel<()>>
An event for when the control is created. Used by the rendering service TODO: its very strange construction, seems it should moved into declerative part
onrender: Option<ActorChannel<()>>
An event for when (if) a control is marked as renderable and is rendered.
onbounds: Option<ActorChannel<()>>
An event for when the bounds of the control change.
ondestroy: Option<ActorChannel<()>>
An event for when the control is being destroyed.
onvisible: Option<ActorChannel<bool>>
An event for when the visibility of the control changes.
ondepth: Option<ActorChannel<f32>>
An event for when the control moves in depth in the canvas.
onclip: Option<ActorChannel<WidgetClipEvent>>
An event for when the clipping rectangle changes for the control.
onchildadd: Option<ActorChannel<Id>>
An event for when a child is added to the control.
onchildremove: Option<ActorChannel<Id>>
An event for when a child is removed from the control.
onmousedown: Option<ActorChannel<MouseEvent>>
An event for when the mouse is clicked on this control (if mouse_input
).
onmouseup: Option<ActorChannel<MouseEvent>>
An event for when the mouse is released on this control (if mouse_input
).
onmousemove: Option<ActorChannel<MouseEvent>>
An event for when the mouse is moved inside this control (if mouse_input
).
onmousewheel: Option<ActorChannel<MouseEvent>>
An event for when the mousewheel is moved while the mouse is inside this control (if mouse_input
).
onmouseenter: Option<ActorChannel<MouseEvent>>
An event for when the mouse enters the control (if mouse_input
).
onmouseleave: Option<ActorChannel<MouseEvent>>
An event for when the mouse leaves the control (if mouse_input
).
onkeydown: Option<ActorChannel<KeyEvent>>
An event for when a key is pressed and the control is focused (if key_input
).
onkeyup: Option<ActorChannel<KeyEvent>>
An event for when a key is released and the control is focused (if key_input
).
ontextinput: Option<ActorChannel<TextEvent>>
An event for when a text/typing event happened and the control is focused (if key_input
).
onfocused: Option<ActorChannel<bool>>
An event for when this control gains or loses focus
onmarked: Option<ActorChannel<bool>>
An event for when this control is marked or unmarked for focus
oncaptured: Option<ActorChannel<bool>>
An event for when this control is made or unmade the modal focus
parent: Option<Id>
depth: f32
depth_offset: f32
The control specific options
vis_state: bool
update_vis_state: bool
updating: bool
ignore_spatial: bool
Implementations
Trait Implementations
sourceimpl Default for WidgetComponent
impl Default for WidgetComponent
sourcefn default() -> WidgetComponent
fn default() -> WidgetComponent
Returns the “default value” for a type. Read more
sourceimpl PartialEq<WidgetComponent> for WidgetComponent
impl PartialEq<WidgetComponent> for WidgetComponent
sourceimpl<'a> PartialEq<WidgetComponent> for &'a WidgetComponent
impl<'a> PartialEq<WidgetComponent> for &'a WidgetComponent
Auto Trait Implementations
impl !RefUnwindSafe for WidgetComponent
impl !Send for WidgetComponent
impl !Sync for WidgetComponent
impl Unpin for WidgetComponent
impl !UnwindSafe for WidgetComponent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.