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

pub trait Widget<E>: WBase<E> where
    E: Env + 'static, 
{ fn id(&self) -> E::WidgetID;
fn _render(&self, l: Link<'_, E>, r: &mut RenderLink<'_, E>);
fn _event_direct(&self, l: Link<'_, E>, e: &EventCompound<E>) -> EventResp;
fn _size(&self, l: Link<'_, E>, e: &EStyle<E>) -> ESize<E>;
fn childs(&self) -> usize;
fn child<'s>(&'s self, i: usize) -> Result<Resolvable<'s, E>, ()>;
fn into_child<'s>(
        self: Box<Self>,
        i: usize
    ) -> Result<Resolvable<'s, E>, ()>
    where
        Self: 's
;
fn into_childs<'w>(self: Box<Self>) -> Vec<Resolvable<'w, E>>
    where
        Self: 'w
;
fn child_bounds(
        &self,
        l: Link<'_, E>,
        b: &Bounds,
        e: &EStyle<E>,
        force: bool
    ) -> Result<Vec<Bounds>, ()>;
fn focusable(&self) -> bool; fn childs_ref<'s>(&'s self) -> Vec<Resolvable<'s, E>> { ... }
fn child_paths(&self, own_path: E::WidgetPath) -> Vec<E::WidgetPath> { ... }
fn resolve<'s>(
        &'s self,
        i: E::WidgetPath
    ) -> Result<Resolvable<'s, E>, GuionError<E>> { ... }
fn into_resolve<'w>(
        self: Box<Self>,
        i: E::WidgetPath
    ) -> Result<Resolvable<'w, E>, GuionError<E>>
    where
        Self: 'w
, { ... }
fn resolve_child(
        &self,
        sub_path: &E::WidgetPath
    ) -> Result<(usize, E::WidgetPath), GuionError<E>> { ... }
fn trace_bounds(
        &self,
        l: Link<'_, E>,
        i: E::WidgetPath,
        b: &Bounds,
        e: &EStyle<E>,
        force: bool
    ) -> Result<Bounds, GuionError<E>> { ... }
fn in_parent_path(&self, parent: E::WidgetPath) -> E::WidgetPath { ... }
fn resolved_by_path(
        &self,
        sub_path: &E::WidgetPath
    ) -> Option<ResolvesThruResult<E>> { ... }
fn _focus_on_mouse_down(&self) -> bool { ... }
fn _tabulate_by_tab(&self) -> bool { ... }
fn _tabulate_next_child(
        &self,
        _l: Link<'_, E>,
        origin: TabulateNextChildOrigin,
        dir: TabulateDirection
    ) -> TabulateNextChildResponse { ... }
fn _tabulate(
        &self,
        l: Link<'_, E>,
        op: TabulateOrigin<E>,
        dir: TabulateDirection
    ) -> Result<TabulateResponse<E>, GuionError<E>> { ... }
fn inner(&self) -> Option<&dyn Widget<E>> { ... }
fn innest(&self) -> Option<&dyn Widget<E>> { ... }
fn debug_type_name(&self, dest: &mut Vec<&'static str>) { ... }
fn debugged_type_name(&self) -> Vec<&'static str> { ... }
fn box_ref<'s>(&'s self) -> WidgetRef<'s, E> { ... }
fn box_box<'w>(self: Box<Self>) -> WidgetRef<'w, E>
    where
        Self: 'w
, { ... }
fn boxed<'w>(self) -> WidgetRef<'w, E>
    where
        Self: Sized + 'w
, { ... }
fn gen_diag_error_resolve_fail(
        &self,
        sub_path: &E::WidgetPath,
        op: &'static str
    ) -> GuionError<E> { ... } }

Core Trait of guion ™️

Required methods

fn id(&self) -> E::WidgetID[src]

fn _render(&self, l: Link<'_, E>, r: &mut RenderLink<'_, E>)[src]

RENDER IMPL
RENDER USER generally not called directly, rather through Link::render

fn _event_direct(&self, l: Link<'_, E>, e: &EventCompound<E>) -> EventResp[src]

EVENT IMPL
EVENT USER generally not called directly, rather through Link::event

fn _size(&self, l: Link<'_, E>, e: &EStyle<E>) -> ESize<E>[src]

LAYOUT IMPL
LAYOUT USER generally not called directly, rather through Link::size

fn childs(&self) -> usize[src]

CHILDS

fn child<'s>(&'s self, i: usize) -> Result<Resolvable<'s, E>, ()>[src]

CHILDS

fn into_child<'s>(self: Box<Self>, i: usize) -> Result<Resolvable<'s, E>, ()> where
    Self: 's, 
[src]

CHILDS

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

CHILDS

fn child_bounds(
    &self,
    l: Link<'_, E>,
    b: &Bounds,
    e: &EStyle<E>,
    force: bool
) -> Result<Vec<Bounds>, ()>
[src]

LAYOUT

fn focusable(&self) -> bool[src]

If the widget should be focusable

Regularly true for interactive widgets, false for layouts.

Loading content...

Provided methods

fn childs_ref<'s>(&'s self) -> Vec<Resolvable<'s, E>>[src]

👎 Deprecated

CHILDS

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

👎 Deprecated

CHILDS

fn resolve<'s>(
    &'s self,
    i: E::WidgetPath
) -> Result<Resolvable<'s, E>, GuionError<E>>
[src]

RESOLVING
Resolve a deep child item by the given relative path

An empty path will resolve to this widget

USER generally not used directly, but through Widgets::widget

fn into_resolve<'w>(
    self: Box<Self>,
    i: E::WidgetPath
) -> Result<Resolvable<'w, E>, GuionError<E>> where
    Self: 'w, 
[src]

RESOLVING
Resolve a deep child item by the given relative path

An empty path will resolve to this widget

USER generally not used directly, but through Widgets::widget

fn resolve_child(
    &self,
    sub_path: &E::WidgetPath
) -> Result<(usize, E::WidgetPath), GuionError<E>>
[src]

RESOLVING
To (or through) which child path would the given sub_path resolve?

Returns the child index and the subpath inside the child widget to resolve further

USER generally not used directly, but through Widgets::widget

fn trace_bounds(
    &self,
    l: Link<'_, E>,
    i: E::WidgetPath,
    b: &Bounds,
    e: &EStyle<E>,
    force: bool
) -> Result<Bounds, GuionError<E>>
[src]

LAYOUT

fn in_parent_path(&self, parent: E::WidgetPath) -> E::WidgetPath[src]

👎 Deprecated

RESOLVING
Attach widget’s id to the given parent path

fn resolved_by_path(
    &self,
    sub_path: &E::WidgetPath
) -> Option<ResolvesThruResult<E>>
[src]

👎 Deprecated

RESOLVING
Refer WidgetPath::resolves_thru

sub_path: subpath in parent widget (which contains this widget as child) which would probably resolve to/through this widget

fn _focus_on_mouse_down(&self) -> bool[src]

fn _tabulate_by_tab(&self) -> bool[src]

fn _tabulate_next_child(
    &self,
    _l: Link<'_, E>,
    origin: TabulateNextChildOrigin,
    dir: TabulateDirection
) -> TabulateNextChildResponse
[src]

Determines the next child in this widget in the tabulation step

fn _tabulate(
    &self,
    l: Link<'_, E>,
    op: TabulateOrigin<E>,
    dir: TabulateDirection
) -> Result<TabulateResponse<E>, GuionError<E>>
[src]

fn inner(&self) -> Option<&dyn Widget<E>>[src]

fn innest(&self) -> Option<&dyn Widget<E>>[src]

fn debug_type_name(&self, dest: &mut Vec<&'static str>)[src]

fn debugged_type_name(&self) -> Vec<&'static str>[src]

fn box_ref<'s>(&'s self) -> WidgetRef<'s, E>[src]

BOXING
Box reference of this widget immutable. Use WidgetMut::box_mut to box into mutable WidgetRef.

fn box_box<'w>(self: Box<Self>) -> WidgetRef<'w, E> where
    Self: 'w, 
[src]

BOXING
Move widget into box immutable. Use WidgetMut::box_box_mut to box into mutable WidgetRef.

fn boxed<'w>(self) -> WidgetRef<'w, E> where
    Self: Sized + 'w, 
[src]

BOXING
Move widget into box immutable. Use WidgetMut::boxed_mut to box into mutable WidgetRef.

fn gen_diag_error_resolve_fail(
    &self,
    sub_path: &E::WidgetPath,
    op: &'static str
) -> GuionError<E>
[src]

Loading content...

Implementations

impl<E> dyn Widget<E> + '_ where
    E: Env
[src]

pub fn traitcast_ref<'s, T>(&'s self) -> Result<&'s T, GuionError<E>> where
    Self: Traitcast<T, E>,
    T: ?Sized
[src]

pub fn try_traitcast_ref<'s, T>(&'s self) -> Result<&'s T, ()> where
    Self: Traitcast<T, E>,
    T: ?Sized
[src]

Trait Implementations

impl<'w, T, E> Traitcast<dyn AtomState<E, T> + 'w, E> for dyn Widget<E> + 'w where
    E: Env,
    T: 'static, 
[src]

type DestTypeID = dyn AtomState<E, T>

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

type DestTypeID = dyn Caption<E> + 'static

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

type DestTypeID = dyn ICheckBox<E> + 'static

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

type DestTypeID = dyn ITextBox<E> + 'static

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

type DestTypeID = dyn Validation<E> + 'static

impl<E> Widget<E> for &(dyn Widget<E> + '_) where
    E: Env
[src]

impl<E> Widget<E> for &mut (dyn Widget<E> + '_) where
    E: Env
[src]

Implementations on Foreign Types

impl<E> Widget<E> for Box<dyn Widget<E> + '_> where
    E: Env
[src]

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

Loading content...

Implementors

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

impl<'w, E, L, R, V> Widget<E> for SplitPane<'w, E, L, R, V> where
    E: Env,
    ERenderer<E>: RenderStdWidgets<E>,
    EEvent<E>: StdVarSup<E>,
    E::Context: CtxStdState<E>,
    L: AsWidget<E>,
    R: AsWidget<E>,
    V: AtomState<E, f32>, 
[src]

impl<'w, E, State, Text> Widget<E> for CheckBox<'w, E, State, Text> where
    E: Env,
    ERenderer<E>: RenderStdWidgets<E>,
    EEvent<E>: StdVarSup<E>,
    E::Context: CtxStdState<E>,
    State: AtomState<E, bool>,
    Text: AsWidget<E>, 
[src]

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

impl<'w, E, Text> Widget<E> for Button<'w, E, Text> where
    E: Env,
    ERenderer<E>: RenderStdWidgets<E>,
    EEvent<E>: StdVarSup<E>,
    E::Context: CtxStdState<E>,
    Text: AsWidget<E>, 
[src]

impl<'w, E, Text, GlyphCache> Widget<E> for Label<'w, E, Text, GlyphCache> where
    E: Env,
    ERenderer<E>: RenderStdWidgets<E>,
    EEvent<E>: StdVarSup<E>,
    Text: Caption<E> + Validation<E> + 'w,
    GlyphCache: AtomState<E, LocalGlyphCache<E>> + Clone
[src]

impl<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache> Widget<E> for TextBox<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache> where
    E: Env,
    ERenderer<E>: RenderStdWidgets<E>,
    EEvent<E>: StdVarSup<E>,
    E::Context: CtxStdState<E> + CtxClipboardAccess<E>,
    Text: Caption<E> + Validation<E> + 'w,
    Scroll: AtomState<E, (u32, u32)>,
    Curs: AtomState<E, Cursor>,
    CursorStickX: AtomState<E, Option<u32>>,
    GlyphCache: AtomState<E, LocalGlyphCache<E>> + Clone
[src]

impl<'w, E, W, Scroll> Widget<E> for Area<'w, E, W, Scroll> where
    E: Env,
    ERenderer<E>: RenderStdWidgets<E>,
    EEvent<E>: StdVarSup<E>,
    E::Context: CtxStdState<E> + CtxClipboardAccess<E>,
    W: AsWidget<E> + 'w,
    Scroll: AtomState<E, (u32, u32)>, 
[src]

impl<E> Widget<E> for &(dyn Widget<E> + '_) where
    E: Env
[src]

impl<E> Widget<E> for &(dyn WidgetMut<E> + '_) where
    E: Env
[src]

impl<E> Widget<E> for &mut (dyn Widget<E> + '_) where
    E: Env
[src]

impl<E> Widget<E> for &mut (dyn WidgetMut<E> + '_) where
    E: Env
[src]

Loading content...