Struct TextBox

Source
pub struct TextBox<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache>
where E: Env, Text: 'w, Scroll: 'w, Curs: 'w, CursorStickX: 'w, GlyphCache: 'w,
{ pub size: ESize<E>, pub style: EStyle<E>, pub text: Text, pub scroll: Scroll, pub cursor: Curs, pub cursor_stick_x: CursorStickX, pub glyph_cache: GlyphCache, /* private fields */ }

Fields§

§size: ESize<E>§style: EStyle<E>§text: Text§scroll: Scroll§cursor: Curs§cursor_stick_x: CursorStickX§glyph_cache: GlyphCache

Implementations§

Source§

impl<'w, E> TextBox<'w, E, String, (u32, u32), Cursor, Option<u32>, LocalGlyphCache<E>>
where E: Env,

Source

pub fn new(id: E::WidgetID) -> Self

Source§

impl<'w, E, Text> TextBox<'w, E, Text, RemoteState<E, (u32, u32)>, RemoteState<E, Cursor>, RemoteState<E, Option<u32>>, RemoteState<E, LocalGlyphCache<E>>>
where E: Env, E::Context: DynState<E>, Text: 'w,

Source

pub fn immediate(id: E::WidgetID, text: Text) -> Self

Source§

impl<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache> TextBox<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache>
where E: Env, Text: 'w, Scroll: 'w, Curs: 'w, CursorStickX: 'w, GlyphCache: 'w,

Source

pub fn with_text<T>( self, text: T, ) -> TextBox<'w, E, T, Scroll, Curs, CursorStickX, GlyphCache>
where T: 'w,

Source

pub fn with_states<PScroll, CCurs, XCursorStickX>( self, scroll: PScroll, cursor: CCurs, cursor_stick_x: XCursorStickX, ) -> TextBox<'w, E, Text, PScroll, CCurs, XCursorStickX, GlyphCache>
where PScroll: 'w, CCurs: 'w, XCursorStickX: 'w,

Source

pub fn with_size(self, s: ESize<E>) -> Self

Source

pub fn with_style(self, style: EStyle<E>) -> Self

Trait Implementations§

Source§

impl<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache> ITextBoxMut<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: CaptionMut<E> + ValidationMut<E> + 'w, Scroll: AtomStateMut<E, (u32, u32)>, Curs: AtomStateMut<E, Cursor>, CursorStickX: AtomStateMut<E, Option<u32>>, GlyphCache: AtomStateMut<E, LocalGlyphCache<E>> + Clone,

Source§

fn insert_text(&mut self, s: &str, ctx: &mut E::Context)

Source§

fn remove_selection_or_n(&mut self, n: u32, ctx: &mut E::Context)

Source§

fn remove_selection(&mut self, ctx: &mut E::Context) -> bool

Source§

fn move_cursor_x(&mut self, o: i32, skip_unselect: bool, ctx: &mut E::Context)

Source§

fn move_cursor_y( &mut self, o: i32, skip_unselect: bool, ctx: &mut E::Context, b: &Bounds, )

Source§

fn _m( &mut self, mouse_down: Option<MouseDown<E>>, mouse_pressed: bool, mouse: Offset, b: Bounds, ctx: &mut E::Context, )

Source§

fn scroll_to_cursor(&mut self, ctx: &mut E::Context, b: &Bounds)

Source§

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,

Source§

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

👎Deprecated
CHILDS Read more
Source§

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

Source§

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

RENDER IMPL
RENDER USER generally not called directly, rather through Link::render Read more
Source§

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

EVENT IMPL
EVENT USER generally not called directly, rather through Link::event Read more
Source§

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

LAYOUT IMPL
LAYOUT USER generally not called directly, rather through Link::size Read more
Source§

fn childs(&self) -> usize

CHILDS Read more
Source§

fn childs_ref(&self) -> Vec<Resolvable<'_, E>>

👎Deprecated
CHILDS Read more
Source§

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

CHILDS Read more
Source§

fn child_bounds( &self, _: Link<'_, E>, _: &Bounds, e: &EStyle<E>, _: bool, ) -> Result<Vec<Bounds>, ()>

LAYOUT Read more
Source§

fn focusable(&self) -> bool

If the widget should be focusable Read more
Source§

fn child(&self, _: usize) -> Result<Resolvable<'_, E>, ()>

CHILDS Read more
Source§

fn into_child<'a>(self: Box<Self>, _: usize) -> Result<Resolvable<'a, E>, ()>
where Self: 'a,

CHILDS Read more
Source§

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

RESOLVING
Resolve a deep child item by the given relative path Read more
Source§

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

RESOLVING
Resolve a deep child item by the given relative path Read more
Source§

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

RESOLVING
To (or through) which child path would the given sub_path resolve? Read more
Source§

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

LAYOUT Read more
Source§

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

👎Deprecated
RESOLVING
Attach widget’s id to the given parent path Read more
Source§

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

👎Deprecated
Source§

fn _focus_on_mouse_down(&self) -> bool

Source§

fn _tabulate_by_tab(&self) -> bool

Source§

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

Determines the next child in this widget in the tabulation step
Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

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

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

BOXING
Move widget into box immutable. Use WidgetMut::box_box_mut to box into mutable WidgetRef. Read more
Source§

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

BOXING
Move widget into box immutable. Use WidgetMut::boxed_mut to box into mutable WidgetRef. Read more
Source§

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

Source§

impl<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache> WidgetMut<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: CaptionMut<E> + ValidationMut<E> + 'w, Scroll: AtomStateMut<E, (u32, u32)>, Curs: AtomStateMut<E, Cursor>, CursorStickX: AtomStateMut<E, Option<u32>>, GlyphCache: AtomStateMut<E, LocalGlyphCache<E>> + Clone,

Source§

fn childs_mut(&mut self) -> Vec<ResolvableMut<'_, E>>

👎Deprecated
CHILDS Read more
Source§

fn into_childs_mut<'a>(self: Box<Self>) -> Vec<ResolvableMut<'a, E>>
where Self: 'a,

CHILDS Read more
Source§

fn child_mut(&mut self, _: usize) -> Result<ResolvableMut<'_, E>, ()>

CHILDS Read more
Source§

fn into_child_mut<'a>( self: Box<Self>, _: usize, ) -> Result<ResolvableMut<'a, E>, ()>
where Self: 'a,

CHILDS Read more
Source§

fn message(&mut self, m: E::Message)

EVENT
An alternative way to pass mutations. See [Widgets::message] and [link::enqueue_message] Read more
Source§

fn _set_invalid(&mut self, v: bool)

Source§

fn resolve_mut<'s>( &'s mut self, i: E::WidgetPath, ) -> Result<ResolvableMut<'s, E>, GuionError<E>>

RESOLVING
Resolve a deep child item by the given relative path Read more
Source§

fn into_resolve_mut<'w>( self: Box<Self>, i: E::WidgetPath, ) -> Result<ResolvableMut<'w, E>, GuionError<E>>
where Self: 'w,

RESOLVING
Resolve a deep child item by the given relative path Read more
Source§

fn resolve_child_mut( &mut self, sub_path: &E::WidgetPath, ) -> Result<(usize, E::WidgetPath), GuionError<E>>

RESOLVING
To (or through) which child path would the given sub_path resolve? Read more
Source§

fn inner_mut(&mut self) -> Option<&mut dyn WidgetMut<E>>

Source§

fn pass(self) -> Self
where Self: Sized,

Source§

fn debug_type_name_mut(&mut self, dest: &mut Vec<&'static str>)

Source§

fn debugged_type_name_mut(&mut self) -> Vec<&'static str>

Source§

fn box_mut<'s>(&'s mut self) -> WidgetRefMut<'s, E>

BOXING
Box mut reference of this widget Read more
Source§

fn box_box_mut<'w>(self: Box<Self>) -> WidgetRefMut<'w, E>
where Self: 'w,

BOXING
Move widget into box Read more
Source§

fn boxed_mut<'w>(self) -> WidgetRefMut<'w, E>
where Self: Sized + 'w,

BOXING
Move widget into box Read more
Source§

fn gen_diag_error_resolve_fail_mut( &mut self, sub_path: &E::WidgetPath, op: &'static str, ) -> GuionError<E>

Source§

impl<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache> ITextBox<E> for TextBox<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache>
where E: Env, Text: 'w, Scroll: 'w, Curs: 'w, CursorStickX: 'w, GlyphCache: 'w,

Auto Trait Implementations§

§

impl<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache> Freeze for TextBox<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache>
where <E as Env>::WidgetID: Freeze, <<E as Env>::Backend as Backend<E>>::Size: Freeze, <<E as Env>::Backend as Backend<E>>::Style: Freeze, Text: Freeze, Scroll: Freeze, Curs: Freeze, CursorStickX: Freeze, GlyphCache: Freeze,

§

impl<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache> RefUnwindSafe for TextBox<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache>
where <E as Env>::WidgetID: RefUnwindSafe, <<E as Env>::Backend as Backend<E>>::Size: RefUnwindSafe, <<E as Env>::Backend as Backend<E>>::Style: RefUnwindSafe, Text: RefUnwindSafe, Scroll: RefUnwindSafe, Curs: RefUnwindSafe, CursorStickX: RefUnwindSafe, GlyphCache: RefUnwindSafe,

§

impl<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache> Send for TextBox<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache>
where <E as Env>::WidgetID: Send, <<E as Env>::Backend as Backend<E>>::Size: Send, <<E as Env>::Backend as Backend<E>>::Style: Send, Text: Send, Scroll: Send, Curs: Send, CursorStickX: Send, GlyphCache: Send,

§

impl<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache> Sync for TextBox<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache>
where <E as Env>::WidgetID: Sync, <<E as Env>::Backend as Backend<E>>::Size: Sync, <<E as Env>::Backend as Backend<E>>::Style: Sync, Text: Sync, Scroll: Sync, Curs: Sync, CursorStickX: Sync, GlyphCache: Sync,

§

impl<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache> Unpin for TextBox<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache>
where <E as Env>::WidgetID: Unpin, <<E as Env>::Backend as Backend<E>>::Size: Unpin, <<E as Env>::Backend as Backend<E>>::Style: Unpin, Text: Unpin, Scroll: Unpin, Curs: Unpin, CursorStickX: Unpin, GlyphCache: Unpin,

§

impl<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache> !UnwindSafe for TextBox<'w, E, Text, Scroll, Curs, CursorStickX, GlyphCache>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<E, T> AsWidget<E> for T
where T: Widget<E>, E: Env,

Source§

fn as_ref(&self) -> Resolvable<'_, E>

IMPL Resolvable::from_widget can be used to create a Resolvable from a (immediate) Widget Read more
Source§

fn into_ref<'w>(self) -> Resolvable<'w, E>
where T: 'w,

IMPL Resolvable::from_widget can be used to create a Resolvable from a (immediate) Widget Read more
Source§

impl<E, T> AsWidgetMut<E> for T
where T: WidgetMut<E>, E: Env,

Source§

fn as_mut(&mut self) -> ResolvableMut<'_, E>

IMPL ResolvableMut::from_widget can be used to create a ResolvableMut from a (immediate) WidgetMut Read more
Source§

fn into_mut<'w>(self) -> ResolvableMut<'w, E>
where T: 'w,

IMPL ResolvableMut::from_widget can be used to create a ResolvableMut from a (immediate) WidgetMut Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> FromInto<U> for T
where T: From<U> + Into<U>,

Source§

fn qfrom(t: U) -> T

Source§

fn qinto(self) -> U

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<'a, S, T, E> StyleSelectorAppend<&'a [S], E> for T
where T: StyleSelectorAppend<S, E>, S: StyleSelectag<E>,

Source§

fn append(&mut self, selectag: &[S])

Source§

fn with(&self, selectag: S) -> Self
where Self: Sized,

Source§

fn from(selectag: S) -> Self
where Self: Sized,

Source§

impl<S, T, E> StyleSelectorAppend<&S, E> for T
where T: StyleSelectorAppend<S, E>, S: StyleSelectag<E>,

Source§

fn append(&mut self, selectag: &S)

Source§

fn with(&self, selectag: S) -> Self
where Self: Sized,

Source§

fn from(selectag: S) -> Self
where Self: Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.