[][src]Trait guion::widget::Widget

pub trait Widget<'w, E>: WBase<'w, E> + 'w where
    E: Env + 'static, 
{ fn id(&self) -> E::WidgetID;
fn render(&self, l: Link<E>, r: &mut RenderLink<E>) -> bool;
fn event(&self, l: Link<E>, e: (EEvent<E>, &Bounds, u64));
fn size(&self, l: Link<E>) -> ESize<E>;
fn childs(&self) -> usize;
fn child<'s>(&'s self, i: usize) -> Result<Resolvable<'s, E>, ()>
    where
        'w: 's
;
fn into_child(self: Box<Self>, i: usize) -> Result<Resolvable<'w, E>, ()>;
fn into_childs(self: Box<Self>) -> Vec<Resolvable<'w, E>>;
fn _trace_bounds(
        &self,
        l: Link<E>,
        i: usize,
        b: &Bounds,
        force: bool
    ) -> Result<Bounds, ()>;
fn focusable(&self) -> bool; fn invalid(&self) -> bool { ... }
fn childs_ref<'s>(&'s self) -> Vec<Resolvable<'s, E>>
    where
        'w: 's
, { ... }
fn child_paths(&self, own_path: E::WidgetPath) -> Vec<E::WidgetPath> { ... }
fn resolve<'s>(&'s self, i: E::WidgetPath) -> Result<Resolvable<'s, E>, ()>
    where
        'w: 's
, { ... }
fn into_resolve(
        self: Box<Self>,
        i: E::WidgetPath
    ) -> Result<Resolvable<'w, E>, ()> { ... }
fn resolve_child(&self, p: &EWPSub<E>) -> Result<usize, ()> { ... }
fn trace_bounds(
        &self,
        l: Link<E>,
        i: E::WidgetPath,
        b: &Bounds,
        force: bool
    ) -> Result<Bounds, ()> { ... }
fn self_in_parent(&self, parent: E::WidgetPath) -> E::WidgetPath { ... }
fn is_subpath(&self, p: &EWPSub<E>) -> bool { ... }
fn _focus_on_mouse_down(&self) -> bool { ... }
fn _tabulate_by_tab(&self) -> bool { ... }
fn style(&self, s: &mut ESVariant<E>) { ... }
fn border(&self, b: &mut Border) { ... }
fn inner<'s>(&'s self) -> Option<&'s dyn Widget<'w, E>> { ... }
fn debug_type_name(&self) { ... } }

Core Trait of guion ™️

Required methods

fn id(&self) -> E::WidgetID

fn render(&self, l: Link<E>, r: &mut RenderLink<E>) -> bool

this method should not be called from external, rather [Link::render][../link/struct.Link.html#method.render]

fn event(&self, l: Link<E>, e: (EEvent<E>, &Bounds, u64))

this method should not be called from external, rather [Link::event][../link/struct.Link.html#method.event]

fn size(&self, l: Link<E>) -> ESize<E>

this method should not be called from external, rather [Link::size][../link/struct.Link.html#method.size]

fn childs(&self) -> usize

fn child<'s>(&'s self, i: usize) -> Result<Resolvable<'s, E>, ()> where
    'w: 's, 

fn into_child(self: Box<Self>, i: usize) -> Result<Resolvable<'w, E>, ()>

fn into_childs(self: Box<Self>) -> Vec<Resolvable<'w, E>>

fn _trace_bounds(
    &self,
    l: Link<E>,
    i: usize,
    b: &Bounds,
    force: bool
) -> Result<Bounds, ()>

fn focusable(&self) -> bool

should the widget be focusable, regularly true for interactive widgets, false for layouts

Loading content...

Provided methods

fn invalid(&self) -> bool

returns if the widget should be rendered

fn childs_ref<'s>(&'s self) -> Vec<Resolvable<'s, E>> where
    'w: 's, 

Deprecated

fn child_paths(&self, own_path: E::WidgetPath) -> Vec<E::WidgetPath>

Deprecated

fn resolve<'s>(&'s self, i: E::WidgetPath) -> Result<Resolvable<'s, E>, ()> where
    'w: 's, 

resolve a deep child item by the given relative path an empty path will resolve to this widget

fn into_resolve(
    self: Box<Self>,
    i: E::WidgetPath
) -> Result<Resolvable<'w, E>, ()>

resolve a deep child item by the given relative path an empty path will resolve to this widget

fn resolve_child(&self, p: &EWPSub<E>) -> Result<usize, ()>

fn trace_bounds(
    &self,
    l: Link<E>,
    i: E::WidgetPath,
    b: &Bounds,
    force: bool
) -> Result<Bounds, ()>

fn self_in_parent(&self, parent: E::WidgetPath) -> E::WidgetPath

fn is_subpath(&self, p: &EWPSub<E>) -> bool

fn _focus_on_mouse_down(&self) -> bool

fn _tabulate_by_tab(&self) -> bool

fn style(&self, s: &mut ESVariant<E>)

attach widget's style

fn border(&self, b: &mut Border)

fn inner<'s>(&'s self) -> Option<&'s dyn Widget<'w, E>>

fn debug_type_name(&self)

Loading content...

Methods

impl<'w, E> dyn Widget<'w, E> where
    E: Env
[src]

pub fn is_type<T>(&self) -> bool where
    T: Statize, 
[src]

pub fn _downcast_ref<'s, 'd, T>(&'s self) -> Option<&'s T> where
    T: Statize + 'd,
    'w: 's,
    'w: 'd,
    'd: 's, 
[src]

pub fn downcast_ref<'s, 'd, T>(&'s self) -> Option<&'s T> where
    T: Statize + 'd,
    'w: 's,
    'w: 'd,
    'd: 's, 
[src]

downcast the current widget to a specific implementation

pub fn _traitcast_ref<'s, 'd, T: ?Sized>(&'s self) -> Option<&'s T> where
    T: Statize + 'd,
    'w: 's,
    'w: 'd,
    'd: 's, 
[src]

pub fn traitcast_ref<'s, 'd, T: ?Sized>(&'s self) -> Option<&'s T> where
    T: Statize + 'd,
    'w: 's,
    'w: 'd,
    'd: 's, 
[src]

this will definetly cause UB and delet ur computer

Trait Implementations

impl<'l, 's, 'y, E> ShortRefWidgetRef<'l, 's, 'y, E> for &'y dyn Widget<'l, E> where
    'l: 's,
    's: 'y,
    'l: 'y,
    E: Env
[src]

impl<'s, 'l, E> Widget<'s, E> for &'s dyn Widget<'l, E> where
    E: Env,
    'l: 's, 
[src]

Implementations on Foreign Types

impl<'w, E> Widget<'w, E> for Box<dyn Widget<'w, E>> where
    E: Env
[src]

impl<'w, E> Widget<'w, E> for Box<dyn WidgetMut<'w, E>> where
    E: Env
[src]

Loading content...

Implementors

impl<'s, 'l, E> Widget<'s, E> for &'s dyn Widget<'l, E> where
    E: Env,
    'l: 's, 
[src]

impl<'s, 'l, E> Widget<'s, E> for &'s mut dyn WidgetMut<'l, E> where
    E: Env,
    'l: 's, 
[src]

impl<'w, E> Widget<'w, E> for Null<E> where
    E: Env,
    ERenderer<E>: RenderStdWidgets<E>,
    ESVariant<E>: StyleVariantSupport<StdVerb>, 
[src]

impl<'w, E> Widget<'w, E> for ProgressBar<E> where
    E: Env,
    ERenderer<E>: RenderStdWidgets<E>,
    ESVariant<E>: StyleVariantSupport<StdVerb>, 
[src]

impl<'w, E, S> Widget<'w, E> for Button<'w, E, S> where
    E: Env,
    ERenderer<E>: RenderStdWidgets<E>,
    EEvent<E>: StdVarSup<E>,
    ESVariant<E>: StyleVariantSupport<StdVerb>,
    E::Context: AsHandlerStateful<E>,
    S: Caption<'w> + Statize,
    S::Statur: Sized
[src]

impl<'w, E, S> Widget<'w, E> for Label<'w, E, S> where
    E: Env,
    ERenderer<E>: RenderStdWidgets<E>,
    EEvent<E>: StdVarSup<E>,
    ESVariant<E>: StyleVariantSupport<StdVerb>,
    S: Caption<'w> + Statize,
    S::Statur: Sized
[src]

impl<'w, E, State, Text> Widget<'w, E> for CheckBox<'w, E, State, Text> where
    E: Env,
    ERenderer<E>: RenderStdWidgets<E>,
    EEvent<E>: StdVarSup<E>,
    ESVariant<E>: StyleVariantSupport<StdVerb>,
    E::Context: AsHandlerStateful<E>,
    State: AtomState<bool> + Statize + 'w,
    State::Statur: Sized,
    Text: Caption<'w> + Statize + 'w,
    Text::Statur: Sized
[src]

impl<'w, T, E> Widget<'w, E> for Pane<'w, T, E> where
    T: WidgetArray<'w, E> + Statize,
    T::Statur: Statize + Sized,
    E: Env
[src]

Loading content...