pub struct AutoSuggestBox<T: Display + 'static> {Show 17 fields
pub controller: TextEditingControllerRef,
pub items_source: Rc<[T]>,
pub text_member_path: Option<AutoSuggestBoxTextMember<T>>,
pub item_template: Option<AutoSuggestBoxItemTemplate<T>>,
pub placeholder_text: String,
pub header: Option<WidgetRef>,
pub description: Option<WidgetRef>,
pub query_icon: Option<WidgetRef>,
pub max_suggestion_list_height: f64,
pub is_suggestion_list_open: Option<bool>,
pub is_suggestion_list_open_changed: Option<AutoSuggestBoxOpenChangedHandler>,
pub update_text_on_select: bool,
pub auto_maximize_suggestion_area: bool,
pub text_changed: Option<AutoSuggestBoxTextChangedHandler>,
pub suggestion_chosen: Option<AutoSuggestBoxSuggestionChosenHandler<T>>,
pub query_submitted: Option<AutoSuggestBoxQuerySubmittedHandler<T>>,
pub key: Option<KeyRef>,
}Expand description
XAML AutoSuggestBox: a text box whose text lives in the application’s controller, with the
suggestions the application sets in items_source as it hears text_changed.
Fields§
§controller: TextEditingControllerRefTextBox’s text: Text.
items_source: Rc<[T]>ItemsSource: the suggestions.
text_member_path: Option<AutoSuggestBoxTextMember<T>>TextMemberPath: the text a chosen suggestion puts in the box; the item’s Display
when unset.
item_template: Option<AutoSuggestBoxItemTemplate<T>>ItemTemplate: what the list shows for an item; its Display when unset.
placeholder_text: StringPlaceholderText.
header: Option<WidgetRef>Header.
description: Option<WidgetRef>Description.
query_icon: Option<WidgetRef>QueryIcon: the query button’s content; no query button when unset. WinUI’s
SymbolIcon takes AutoSuggestBoxIconFontSize; the kit’s icons bring their own size.
max_suggestion_list_height: f64MaxSuggestionListHeight: unbounded by default, and all the room there is when negative.
is_suggestion_list_open: Option<bool>IsSuggestionListOpen, when the application owns it, and where the box asks to change it.
is_suggestion_list_open_changed: Option<AutoSuggestBoxOpenChangedHandler>§update_text_on_select: boolUpdateTextOnSelect: whether moving to a suggestion puts its text in the box.
auto_maximize_suggestion_area: boolAutoMaximizeSuggestionArea: read only while an on-screen keyboard covers the window,
which no platform of the kit reports.
text_changed: Option<AutoSuggestBoxTextChangedHandler>TextChanged, 150 ms after the last change of the text.
suggestion_chosen: Option<AutoSuggestBoxSuggestionChosenHandler<T>>SuggestionChosen.
query_submitted: Option<AutoSuggestBoxQuerySubmittedHandler<T>>QuerySubmitted.
key: Option<KeyRef>Identity retained across rebuilds.
Implementations§
Source§impl<T: Display + 'static> AutoSuggestBox<T>
impl<T: Display + 'static> AutoSuggestBox<T>
Sourcepub fn new(controller: TextEditingControllerRef) -> Self
pub fn new(controller: TextEditingControllerRef) -> Self
Creates a box editing controller’s text, with no suggestions.
Sourcepub fn items_source(self, items: Vec<T>) -> Self
pub fn items_source(self, items: Vec<T>) -> Self
Sets ItemsSource.
Sourcepub fn text_member_path(self, text: impl Fn(&T) -> String + 'static) -> Self
pub fn text_member_path(self, text: impl Fn(&T) -> String + 'static) -> Self
Sets TextMemberPath.
Sourcepub fn item_template(
self,
template: impl Fn(&mut App, BuildContext, &T) -> WidgetRef + 'static,
) -> Self
pub fn item_template( self, template: impl Fn(&mut App, BuildContext, &T) -> WidgetRef + 'static, ) -> Self
Sets ItemTemplate.
Sourcepub fn placeholder_text(self, value: impl Into<String>) -> Self
pub fn placeholder_text(self, value: impl Into<String>) -> Self
Sets PlaceholderText.
Sourcepub fn header<K>(self, value: impl IntoWidget<K>) -> Self
pub fn header<K>(self, value: impl IntoWidget<K>) -> Self
Sets Header.
Sourcepub fn description<K>(self, value: impl IntoWidget<K>) -> Self
pub fn description<K>(self, value: impl IntoWidget<K>) -> Self
Sets Description.
Sourcepub fn query_icon<K>(self, value: impl IntoWidget<K>) -> Self
pub fn query_icon<K>(self, value: impl IntoWidget<K>) -> Self
Sets QueryIcon.
Sourcepub fn max_suggestion_list_height(self, value: f64) -> Self
pub fn max_suggestion_list_height(self, value: f64) -> Self
Sets MaxSuggestionListHeight.
Sourcepub fn is_suggestion_list_open(
self,
open: bool,
changed: impl Fn(&mut App, bool) + 'static,
) -> Self
pub fn is_suggestion_list_open( self, open: bool, changed: impl Fn(&mut App, bool) + 'static, ) -> Self
Gives the application IsSuggestionListOpen: the box shows open and asks for changes
through changed. Opening it moves the focus to the box, as the property’s setter does.
Sourcepub fn update_text_on_select(self, value: bool) -> Self
pub fn update_text_on_select(self, value: bool) -> Self
Sets UpdateTextOnSelect.
Sourcepub fn auto_maximize_suggestion_area(self, value: bool) -> Self
pub fn auto_maximize_suggestion_area(self, value: bool) -> Self
Sets AutoMaximizeSuggestionArea.
Sourcepub fn text_changed(
self,
handler: impl Fn(&mut App, &AutoSuggestBoxTextChangedEventArgs) + 'static,
) -> Self
pub fn text_changed( self, handler: impl Fn(&mut App, &AutoSuggestBoxTextChangedEventArgs) + 'static, ) -> Self
Sets TextChanged.
Sourcepub fn suggestion_chosen(
self,
handler: impl Fn(&mut App, &AutoSuggestBoxSuggestionChosenEventArgs<T>) + 'static,
) -> Self
pub fn suggestion_chosen( self, handler: impl Fn(&mut App, &AutoSuggestBoxSuggestionChosenEventArgs<T>) + 'static, ) -> Self
Sets SuggestionChosen.
Sourcepub fn query_submitted(
self,
handler: impl Fn(&mut App, &AutoSuggestBoxQuerySubmittedEventArgs<T>) + 'static,
) -> Self
pub fn query_submitted( self, handler: impl Fn(&mut App, &AutoSuggestBoxQuerySubmittedEventArgs<T>) + 'static, ) -> Self
Sets QuerySubmitted.
Trait Implementations§
Source§impl<T: Display + 'static> Clone for AutoSuggestBox<T>
impl<T: Display + 'static> Clone for AutoSuggestBox<T>
Source§impl<T: Display + 'static> Debug for AutoSuggestBox<T>
impl<T: Display + 'static> Debug for AutoSuggestBox<T>
Source§impl<T: Display + 'static> StatefulWidget for AutoSuggestBox<T>
impl<T: Display + 'static> StatefulWidget for AutoSuggestBox<T>
Source§type State = AutoSuggestBoxState<T>
type State = AutoSuggestBoxState<T>
Source§fn create_state(&self) -> AutoSuggestBoxState<T>
fn create_state(&self) -> AutoSuggestBoxState<T>
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<T> !RefUnwindSafe for AutoSuggestBox<T>
impl<T> !Send for AutoSuggestBox<T>
impl<T> !Sync for AutoSuggestBox<T>
impl<T> !UnwindSafe for AutoSuggestBox<T>
impl<T> Forget for AutoSuggestBox<T>
impl<T> Freeze for AutoSuggestBox<T>where
NonZero<u32>: Freeze,
&'static TextEditingControllerVTable: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
*const RcInner<[T]> is !null: Freeze,
PhantomData<RcInner<[T]>>: Freeze,
*const RcInner<dyn Fn(&T) -> String> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&T) -> String>>: Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement, &T) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, &T) -> Rc<dyn Widget>>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
*const RcInner<dyn Fn(&mut App, bool)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, bool)>>: Freeze,
*const RcInner<dyn Fn(&mut App, &AutoSuggestBoxTextChangedEventArgs)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, &AutoSuggestBoxTextChangedEventArgs)>>: Freeze,
*const RcInner<dyn Fn(&mut App, &AutoSuggestBoxSuggestionChosenEventArgs<T>)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, &AutoSuggestBoxSuggestionChosenEventArgs<T>)>>: Freeze,
*const RcInner<dyn Fn(&mut App, &AutoSuggestBoxQuerySubmittedEventArgs<T>)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, &AutoSuggestBoxQuerySubmittedEventArgs<T>)>>: Freeze,
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
impl<T> Move for AutoSuggestBox<T>
impl<T> Unpin for AutoSuggestBox<T>where
NonZero<u32>: Unpin,
&'static TextEditingControllerVTable: Unpin,
Rc<Keep>: Unpin,
Rc<[T]>: Unpin,
Rc<dyn Fn(&T) -> String>: Unpin,
Rc<dyn Fn(&mut App, AnyElement, &T) -> Rc<dyn Widget>>: Unpin,
*const u8 is !null: Unpin,
Rc<dyn Widget>: Unpin,
Rc<dyn Fn(&mut App, bool)>: Unpin,
Rc<dyn Fn(&mut App, &AutoSuggestBoxTextChangedEventArgs)>: Unpin,
Rc<dyn Fn(&mut App, &AutoSuggestBoxSuggestionChosenEventArgs<T>)>: Unpin,
Rc<dyn Fn(&mut App, &AutoSuggestBoxQuerySubmittedEventArgs<T>)>: Unpin,
Rc<dyn Key>: Unpin,
impl<T> UnsafeUnpin for AutoSuggestBox<T>where
NonZeroU32Inner: UnsafeUnpin,
&'static TextEditingControllerVTable: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
*const RcInner<[T]> is !null: UnsafeUnpin,
PhantomData<RcInner<[T]>>: UnsafeUnpin,
*const RcInner<dyn Fn(&T) -> String> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&T) -> String>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement, &T) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, &T) -> Rc<dyn Widget>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, bool)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, bool)>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, &AutoSuggestBoxTextChangedEventArgs)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, &AutoSuggestBoxTextChangedEventArgs)>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, &AutoSuggestBoxSuggestionChosenEventArgs<T>)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, &AutoSuggestBoxSuggestionChosenEventArgs<T>)>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, &AutoSuggestBoxQuerySubmittedEventArgs<T>)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, &AutoSuggestBoxQuerySubmittedEventArgs<T>)>>: 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.