Struct components::elements::DrawerElement
source · [−]pub struct DrawerElement {
pub component: Rc<RefCell<WidgetComponent>>,
pub child: Box<dyn Element>,
pub focused: Option<Id>,
pub marked: Option<Id>,
pub captured: Option<Id>,
pub focus_invalid: bool,
pub scale: f32,
pub onfocusedchange: Signal<Id>,
pub onmarkedchange: Signal<Id>,
pub oncapturedchange: Signal<Id>,
pub onscalechange: Signal<ScaleChangeEvent>,
pub node: Node,
/* private fields */
}
Expand description
A Drawer is a layout-only object and it do not requires a rendering instance. It and handles all incoming events, propagating them to the children. Additional Signals: none
Fields
component: Rc<RefCell<WidgetComponent>>
child: Box<dyn Element>
focused: Option<Id>
The current focused control, None if none
marked: Option<Id>
The current marked control, None if none
captured: Option<Id>
The current modal control, None if none
focus_invalid: bool
Whether or not the current focus needs refreshing.
scale: f32
The canvas scale factor. Note that this value is a hint for rendering the canvas, it does not affect any coordinates directly.
onfocusedchange: Signal<Id>
An event for when the focused state changes
onmarkedchange: Signal<Id>
An event for when the marked state changes
oncapturedchange: Signal<Id>
An event for when the captured state changes
onscalechange: Signal<ScaleChangeEvent>
On scale changed
node: Node
Implementations
sourceimpl DrawerElement
impl DrawerElement
pub fn new(widget: &Drawer) -> Self
pub fn bring_to_front(&self, control: &dyn Element)
sourcepub fn topmost_at_point(&self, x: f32, y: f32) -> Option<&Box<dyn Element>>
pub fn topmost_at_point(&self, x: f32, y: f32) -> Option<&Box<dyn Element>>
Get the top most control under the given point, or None if there is none (or is the canvas itself)
pub fn apply_depth(&self, control: &dyn Element)
pub fn sync_depth(&self)
sourcepub fn scale(&self) -> f32
pub fn scale(&self) -> f32
The canvas scale factor. Note that this value is a hint for rendering the canvas, it does not affect any coordinates directly.
sourcepub fn set_scale(&mut self, value: f32)
pub fn set_scale(&mut self, value: f32)
The canvas scale factor. Note that this value is a hint for rendering the canvas, it does not affect any coordinates directly.
pub fn set_focused(&mut self, control: Option<&dyn Element>)
sourcepub fn set_captured(&mut self, control: Option<&dyn Element>)
pub fn set_captured(&mut self, control: Option<&dyn Element>)
The current modal control, None if none
sourcepub fn set_marked(&mut self, control: Option<&dyn Element>)
pub fn set_marked(&mut self, control: Option<&dyn Element>)
The current marked control, None if none
Trait Implementations
sourceimpl AsRef<RefCell<WidgetComponent>> for DrawerElement
impl AsRef<RefCell<WidgetComponent>> for DrawerElement
sourcefn as_ref(&self) -> &RefCell<WidgetComponent>
fn as_ref(&self) -> &RefCell<WidgetComponent>
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Debug for DrawerElement
impl Debug for DrawerElement
sourceimpl Element for DrawerElement
impl Element for DrawerElement
fn mouseup(&self, e: &mut MouseEvent)
fn mousedown(&self, e: &mut MouseEvent)
fn mousemove(&self, e: &mut MouseEvent)
fn mousewheel(&self, e: &mut MouseEvent)
fn keyup(&self, e: &mut KeyEvent)
fn keydown(&self, e: &mut KeyEvent)
fn textinput(&self, e: &mut TextEvent)
fn update(&self, dt: f32)
fn render(&self)
fn destroy(&self)
fn node(&self) -> Option<Node>
fn relayout(&self, origin: Point2<f32>)
fn children_at_point(
&self,
x: f32,
y: f32,
into: Option<Vec<WidgetComponent>>
) -> Vec<WidgetComponent>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn topmost_child_at_point(&self, x: f32, y: f32) -> Option<&Box<dyn Element>>
fn contains(&self, x: f32, y: f32) -> bool
fn onclipchanged(&self)
fn set_visible_only(&self, visible: bool)
sourcefn set_visible(&self, visible: bool)
fn set_visible(&self, visible: bool)
If the control is visible
fn find_top_parent(
&self,
from: Option<&WidgetComponent>
) -> Option<WidgetComponent>
fn add(&self, child: &dyn Element)
sourcefn remove(&self, child: Id)
fn remove(&self, child: Id)
The child must be sure that his parent reference is correct. The child must remove the parent reference by himself: child.set_parent(None); Read more
fn children_bounds(&self) -> ChildBounds
fn mouseenter(&self, e: &mut MouseEvent)
fn mouseleave(&self, e: &mut MouseEvent)
fn destroy_children(&self)
fn focus(&self)
fn unfocus(&self)
fn capture(&self)
fn uncapture(&self)
fn mark(&self)
fn unmark(&self)
fn refresh_bounds(&self)
fn bounds_changed(&self, dx: f32, dy: f32, dw: f32, dh: f32)
fn set_pos(&self, x: f32, y: f32)
fn set_size(&self, w: f32, h: f32)
fn destroyed(&self) -> bool
fn right(&self) -> f32
fn bottom(&self) -> f32
sourcefn set_x_local(&self, x: f32)
fn set_x_local(&self, x: f32)
The x position of the control bounds, relative to its container
sourcefn set_y_local(&self, y: f32)
fn set_y_local(&self, y: f32)
The y position of the control bounds, relative to its container
fn nodes(&self) -> i32
fn is_focused(&self) -> bool
fn set_focused(&self, focused: bool)
fn is_captured(&self) -> bool
fn set_captured(&self, captured: bool)
fn is_marked(&self) -> bool
fn set_marked(&self, marked: bool)
fn depth_offset(&self) -> f32
fn depth(&self) -> f32
fn set_depth(&self, depth: f32)
fn mouse_input(&self) -> bool
fn key_input(&self) -> bool
fn parent(&self) -> Option<&dyn Element>
fn set_parent(&self, p: Option<Id>)
fn id(&self) -> Id
Auto Trait Implementations
impl !RefUnwindSafe for DrawerElement
impl !Send for DrawerElement
impl !Sync for DrawerElement
impl Unpin for DrawerElement
impl !UnwindSafe for DrawerElement
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
.