pub struct Spinbox<T> {
pub value: T,
pub textbox: Entity,
pub increment: Entity,
pub decrement: Entity,
pub increment_value: T,
pub decrement_value: T,
pub min: T,
pub max: T,
/* private fields */
}Fields§
§value: T§textbox: Entity§increment: Entity§decrement: Entity§increment_value: T§decrement_value: T§min: T§max: TImplementations§
Source§impl<T> Spinbox<T>
impl<T> Spinbox<T>
pub fn new(initial_value: T) -> Self
Sourcepub fn with_increment(self, increment_value: T) -> Self
pub fn with_increment(self, increment_value: T) -> Self
Set the increment value of the spinbox
Sourcepub fn with_decrement(self, decrement_value: T) -> Self
pub fn with_decrement(self, decrement_value: T) -> Self
Set the decrement value of the spinbox
Sourcepub fn on_increment<F>(self, callback: F) -> Self
pub fn on_increment<F>(self, callback: F) -> Self
Set callback triggered when the spinbox is incremented
Sourcepub fn on_decrement<F>(self, callback: F) -> Self
pub fn on_decrement<F>(self, callback: F) -> Self
Set callback triggered when the spinbox is decremented
pub fn on_change<F>(self, callback: F) -> Self
pub fn on_max<F>(self, callback: F) -> Self
pub fn on_min<F>(self, callback: F) -> Self
Trait Implementations§
Source§impl<T> Widget for Spinbox<T>where
T: 'static + Default + Debug + Display + Copy + PartialEq + FromStr + Num + One + AddAssign + SubAssign + PartialOrd + CheckedAdd + CheckedSub,
impl<T> Widget for Spinbox<T>where
T: 'static + Default + Debug + Display + Copy + PartialEq + FromStr + Num + One + AddAssign + SubAssign + PartialOrd + CheckedAdd + CheckedSub,
type Ret = Entity
type Data = T
fn on_build(&mut self, state: &mut State, entity: Entity) -> Self::Ret
fn on_event(&mut self, state: &mut State, entity: Entity, event: &mut Event)
fn widget_name(&self) -> String
Source§fn build<F>(
self,
state: &mut State,
parent: impl AsEntity,
builder: F,
) -> Self::Ret
fn build<F>( self, state: &mut State, parent: impl AsEntity, builder: F, ) -> Self::Ret
Adds the widget into state and returns the associated type Ret - an entity id or a tuple of entity ids
fn bind<L, F>(self, lens: L, converter: F) -> Wrapper<L, Self>
fn bind2<L>(self, lens: L) -> LensWrap<L, Self>where
L: Lens,
fn on_update(&mut self, state: &mut State, entity: Entity, data: &Self::Data)
fn on_style( &mut self, state: &mut State, entity: Entity, property: (String, PropType), )
fn on_draw( &mut self, state: &mut State, entity: Entity, canvas: &mut Canvas<OpenGl>, )
Auto Trait Implementations§
impl<T> Freeze for Spinbox<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Spinbox<T>
impl<T> !Send for Spinbox<T>
impl<T> !Sync for Spinbox<T>
impl<T> Unpin for Spinbox<T>where
T: Unpin,
impl<T> !UnwindSafe for Spinbox<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more