Struct panoramix::elements::TextBox[][src]

pub struct TextBox<CpEvent = NoEvent, CpState = ()> {
    pub text: String,
    pub flex: FlexParams,
    pub _markers: PhantomData<(CpEvent, CpState)>,
}

A text-editing box.

Events

Emits TextChanged events.

Fields

text: Stringflex: FlexParams_markers: PhantomData<(CpEvent, CpState)>

Implementations

impl<CpEvent, CpState> TextBox<CpEvent, CpState>[src]

pub fn new(text: impl Into<String>) -> Self[src]

Build a text box with the given content.

Use the .on_text_changed method to provide a closure to be called when the box is edited.

pub fn with_flex_params(self, flex_params: FlexParams) -> Self[src]

Change the way the box’s size is calculated

pub fn on_text_changed(
    self,
    callback: impl Fn(&mut CpState, TextChanged)
) -> impl Element<CpEvent, CpState>
[src]

Provide a closure to be called when this box is edited.

Trait Implementations

impl<CpEvent, CpState> Clone for TextBox<CpEvent, CpState>[src]

impl<CpEvent, CpState> Debug for TextBox<CpEvent, CpState>[src]

impl<CpEvent, CpState> Default for TextBox<CpEvent, CpState>[src]

impl<CpEvent, CpState> Element<CpEvent, CpState> for TextBox<CpEvent, CpState>[src]

type Event = TextChanged

The type of events this element can raise. Read more

type AggregateChildrenState = ()

type BuildOutput = TextBoxData<CpEvent, CpState>

impl<CpEvent: PartialEq, CpState: PartialEq> PartialEq<TextBox<CpEvent, CpState>> for TextBox<CpEvent, CpState>[src]

impl<CpEvent, CpState> StructuralPartialEq for TextBox<CpEvent, CpState>[src]

Auto Trait Implementations

impl<CpEvent, CpState> RefUnwindSafe for TextBox<CpEvent, CpState> where
    CpEvent: RefUnwindSafe,
    CpState: RefUnwindSafe

impl<CpEvent, CpState> Send for TextBox<CpEvent, CpState> where
    CpEvent: Send,
    CpState: Send

impl<CpEvent, CpState> Sync for TextBox<CpEvent, CpState> where
    CpEvent: Sync,
    CpState: Sync

impl<CpEvent, CpState> Unpin for TextBox<CpEvent, CpState> where
    CpEvent: Unpin,
    CpState: Unpin

impl<CpEvent, CpState> UnwindSafe for TextBox<CpEvent, CpState> where
    CpEvent: UnwindSafe,
    CpState: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AnyEq for T where
    T: Any + PartialEq<T>, 

impl<T> AnyState for T where
    T: Clone + Default + Debug + PartialEq<T> + 'static, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.