pub struct RepeatButton {
pub content: WidgetRef,
pub click: Listener,
pub delay: Duration,
pub interval: Duration,
pub is_enabled: bool,
pub is_tab_stop: bool,
pub template: Option<ButtonTemplate>,
pub key: Option<KeyRef>,
}Expand description
XAML RepeatButton: Click on the press, then again after Delay and every Interval while held.
Fields§
§content: WidgetRefThe content rendered by the button’s template.
click: ListenerRaised on the initial press and each repeat tick.
delay: DurationXAML Delay: the time from the press to the first repeat.
interval: DurationXAML Interval: the time between repeats.
is_enabled: boolWhether this button accepts input.
is_tab_stop: boolWhether keyboard traversal includes this button; defaults to true.
template: Option<ButtonTemplate>An alternate ContentPresenter template using the same input and repeat state.
key: Option<KeyRef>Identity of this button in its parent’s child list.
Implementations§
Source§impl RepeatButton
impl RepeatButton
Sourcepub fn new<K>(content: impl IntoWidget<K>, click: Listener) -> RepeatButton
pub fn new<K>(content: impl IntoWidget<K>, click: Listener) -> RepeatButton
Creates a repeating button with the default WinUI style.
Sourcepub fn text(text: impl Into<String>, click: Listener) -> RepeatButton
pub fn text(text: impl Into<String>, click: Listener) -> RepeatButton
A text Content, as <RepeatButton Content="…"/>.
Sourcepub fn delay(self, delay: Duration) -> RepeatButton
pub fn delay(self, delay: Duration) -> RepeatButton
XAML Delay.
Sourcepub fn interval(self, interval: Duration) -> RepeatButton
pub fn interval(self, interval: Duration) -> RepeatButton
XAML Interval; OnIntervalPropertyChanged rejects a value that is not positive.
Sourcepub fn is_enabled(self, enabled: bool) -> RepeatButton
pub fn is_enabled(self, enabled: bool) -> RepeatButton
XAML IsEnabled.
Sourcepub fn is_tab_stop(self, is_tab_stop: bool) -> Self
pub fn is_tab_stop(self, is_tab_stop: bool) -> Self
XAML IsTabStop.
Sourcepub fn template(
self,
builder: impl Fn(&mut App, BuildContext, ControlStates, WidgetRef) -> WidgetRef + 'static,
) -> Self
pub fn template( self, builder: impl Fn(&mut App, BuildContext, ControlStates, WidgetRef) -> WidgetRef + 'static, ) -> Self
Replaces the visual template while preserving repeat, keyboard and pointer handling.
Sourcepub fn key(self, key: KeyRef) -> RepeatButton
pub fn key(self, key: KeyRef) -> RepeatButton
Sets this button’s identity.
Trait Implementations§
Source§impl Clone for RepeatButton
impl Clone for RepeatButton
Source§impl Debug for RepeatButton
impl Debug for RepeatButton
Source§impl StatefulWidget for RepeatButton
impl StatefulWidget for RepeatButton
Source§type State = RepeatButtonState
type State = RepeatButtonState
Source§fn create_state(&self) -> RepeatButtonState
fn create_state(&self) -> RepeatButtonState
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
impl !RefUnwindSafe for RepeatButton
impl !Send for RepeatButton
impl !Sync for RepeatButton
impl !UnwindSafe for RepeatButton
impl Forget for RepeatButton
impl Freeze for RepeatButtonwhere
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
*const RcInner<dyn Fn(&mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze,
NonZero<u32>: Freeze,
*const (): Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement, ControlStates, Rc<dyn Widget>) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, ControlStates, Rc<dyn Widget>) -> Rc<dyn Widget>>>: Freeze,
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
impl Move for RepeatButton
impl Unpin for RepeatButton
impl UnsafeUnpin for RepeatButtonwhere
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
*const (): UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement, ControlStates, Rc<dyn Widget>) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, ControlStates, Rc<dyn Widget>) -> Rc<dyn Widget>>>: UnsafeUnpin,
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.