Struct fyrox::gui::text_box::TextBoxBuilder
source · 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: SharedFont) -> TextBoxBuilder
pub fn with_font(self, font: SharedFont) -> TextBoxBuilder
Sets the desired font of the text box.
sourcepub fn with_text<P>(self, text: P) -> TextBoxBuilderwhere
P: AsRef<str>,
pub fn with_text<P>(self, text: P) -> TextBoxBuilderwhere P: AsRef<str>,
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: Rc<RefCell<dyn FnMut(char) -> bool>>
) -> TextBoxBuilder
pub fn with_filter( self, filter: Rc<RefCell<dyn FnMut(char) -> bool>> ) -> 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_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 !RefUnwindSafe for TextBoxBuilder
impl !Send for TextBoxBuilder
impl !Sync for TextBoxBuilder
impl Unpin for TextBoxBuilder
impl !UnwindSafe for TextBoxBuilder
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§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.§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.§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.§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> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.