pub struct TextBoxBuilder { /* private fields */ }
Expand description
Text box builder creates new TextBox
instances and adds them to the user interface.
Implementations§
Source§impl TextBoxBuilder
impl TextBoxBuilder
Sourcepub fn new(widget_builder: WidgetBuilder) -> TextBoxBuilder
pub fn new(widget_builder: WidgetBuilder) -> TextBoxBuilder
Creates new text box widget builder with the base widget builder specified.
Sourcepub fn with_font(self, font: Resource<Font>) -> TextBoxBuilder
pub fn with_font(self, font: Resource<Font>) -> TextBoxBuilder
Sets the desired font of the text box.
Sourcepub fn with_text<P>(self, text: P) -> TextBoxBuilder
pub fn with_text<P>(self, text: P) -> TextBoxBuilder
Sets the desired text of the text box.
Sourcepub fn with_caret_brush(self, brush: Brush) -> TextBoxBuilder
pub fn with_caret_brush(self, brush: Brush) -> TextBoxBuilder
Sets the desired caret brush of the text box.
Sourcepub fn with_selection_brush(self, brush: Brush) -> TextBoxBuilder
pub fn with_selection_brush(self, brush: Brush) -> TextBoxBuilder
Sets the desired selection brush of the text box.
Sourcepub fn with_filter(
self,
filter: Arc<Mutex<RawMutex, dyn FnMut(char) -> bool + Send>>,
) -> TextBoxBuilder
pub fn with_filter( self, filter: Arc<Mutex<RawMutex, dyn FnMut(char) -> bool + Send>>, ) -> TextBoxBuilder
Sets the desired character filter of the text box. See FilterCallback
for more info.
Sourcepub fn with_vertical_text_alignment(
self,
alignment: VerticalAlignment,
) -> TextBoxBuilder
pub fn with_vertical_text_alignment( self, alignment: VerticalAlignment, ) -> TextBoxBuilder
Sets the desired vertical text alignment of the text box.
Sourcepub fn with_horizontal_text_alignment(
self,
alignment: HorizontalAlignment,
) -> TextBoxBuilder
pub fn with_horizontal_text_alignment( self, alignment: HorizontalAlignment, ) -> TextBoxBuilder
Sets the desired horizontal text alignment of the text box.
Sourcepub fn with_wrap(self, wrap: WrapMode) -> TextBoxBuilder
pub fn with_wrap(self, wrap: WrapMode) -> TextBoxBuilder
Sets the desired word wrapping of the text box.
Sourcepub fn with_text_commit_mode(self, mode: TextCommitMode) -> TextBoxBuilder
pub fn with_text_commit_mode(self, mode: TextCommitMode) -> TextBoxBuilder
Sets the desired text commit mode of the text box.
Sourcepub fn with_multiline(self, multiline: bool) -> TextBoxBuilder
pub fn with_multiline(self, multiline: bool) -> TextBoxBuilder
Enables or disables multiline mode of the text box.
Sourcepub fn with_editable(self, editable: bool) -> TextBoxBuilder
pub fn with_editable(self, editable: bool) -> TextBoxBuilder
Enables or disables editing of the text box.
Sourcepub fn with_font_size(self, font_size: StyledProperty<f32>) -> TextBoxBuilder
pub fn with_font_size(self, font_size: StyledProperty<f32>) -> TextBoxBuilder
Sets the desired height of the text.
Sourcepub fn with_mask_char(self, mask_char: Option<char>) -> TextBoxBuilder
pub fn with_mask_char(self, mask_char: Option<char>) -> TextBoxBuilder
Sets the desired masking character of the text box.
Sourcepub fn with_shadow(self, shadow: bool) -> TextBoxBuilder
pub fn with_shadow(self, shadow: bool) -> TextBoxBuilder
Whether the shadow enabled or not.
Sourcepub fn with_shadow_brush(self, brush: Brush) -> TextBoxBuilder
pub fn with_shadow_brush(self, brush: Brush) -> TextBoxBuilder
Sets desired shadow brush. It will be used to render the shadow.
Sourcepub fn with_shadow_dilation(self, thickness: f32) -> TextBoxBuilder
pub fn with_shadow_dilation(self, thickness: f32) -> TextBoxBuilder
Sets desired shadow dilation in units. Keep in mind that the dilation is absolute, not percentage-based.
Sourcepub fn with_shadow_offset(
self,
offset: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>,
) -> TextBoxBuilder
pub fn with_shadow_offset( self, offset: Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> TextBoxBuilder
Sets desired shadow offset in units.
Sourcepub fn with_skip_chars(self, chars: Vec<char>) -> TextBoxBuilder
pub fn with_skip_chars(self, chars: Vec<char>) -> TextBoxBuilder
Sets desired set of characters that will be treated like whitespace during Ctrl+Arrow navigation
(Ctrl+Left Arrow and Ctrl+Right Arrow). This could be useful to treat underscores like whitespaces,
which in its turn could be useful for in-game consoles where commands usually separated using
underscores (like_this_one
).
Auto Trait Implementations§
impl Freeze for TextBoxBuilder
impl !RefUnwindSafe for TextBoxBuilder
impl Send for TextBoxBuilder
impl Sync for TextBoxBuilder
impl Unpin for TextBoxBuilder
impl !UnwindSafe for TextBoxBuilder
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.