logo
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: f32depth_offset: f32

The control specific options

vis_state: boolupdate_vis_state: boolupdating: boolignore_spatial: bool

Implementations

Create a WidgetComponent with the given options.

Trait Implementations

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Typed getter

Inspect the context.

Inspect the context.

Inspect the context.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert into color

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Sets value as a parameter of self.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.