pub struct Textarea { /* private fields */ }Expand description
LVGL textarea — single- or multi-line text input with placeholder, password mode, max length, and accepted-character filter.
Implementations§
Source§impl Textarea
impl Textarea
Sourcepub fn placeholder(self, txt: &[u8]) -> Self
pub fn placeholder(self, txt: &[u8]) -> Self
Fluent: set placeholder shown while empty.
Sourcepub fn password_mode(self, en: bool) -> Self
pub fn password_mode(self, en: bool) -> Self
Fluent: enable password masking.
Sourcepub fn max_length(self, n: u32) -> Self
pub fn max_length(self, n: u32) -> Self
Fluent: set max character count (0 = unlimited).
Sourcepub fn accepted_chars(self, list: &[u8]) -> Self
pub fn accepted_chars(self, list: &[u8]) -> Self
Fluent: restrict input to characters in list (null pointer = any).
Sourcepub fn cursor_pos(self, pos: i32) -> Self
pub fn cursor_pos(self, pos: i32) -> Self
Fluent: move cursor to character position.
Sourcepub fn cursor_click_pos(self, en: bool) -> Self
pub fn cursor_click_pos(self, en: bool) -> Self
Fluent: enable moving cursor by clicking.
Sourcepub fn get_text_ptr(&self) -> *const c_char
pub fn get_text_ptr(&self) -> *const c_char
Returns the current text as a raw C pointer owned by LVGL. The pointer is invalidated by any subsequent mutation of the textarea.
Sourcepub fn get_cursor_pos(self) -> u32
pub fn get_cursor_pos(self) -> u32
Returns the current cursor position.
Sourcepub fn is_password_mode(self) -> bool
pub fn is_password_mode(self) -> bool
Returns true if password masking is enabled.
Sourcepub fn is_one_line(self) -> bool
pub fn is_one_line(self) -> bool
Returns true if the textarea is in single-line mode.
Sourcepub fn delete_char(self) -> Self
pub fn delete_char(self) -> Self
Fluent: delete the character before the cursor.
Trait Implementations§
impl Copy for Textarea
impl Send for Textarea
impl Sync for Textarea
Auto Trait Implementations§
impl Freeze for Textarea
impl RefUnwindSafe for Textarea
impl Unpin for Textarea
impl UnsafeUnpin for Textarea
impl UnwindSafe for Textarea
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EventTarget for Twhere
T: Widget,
impl<T> EventTarget for Twhere
T: Widget,
Source§fn on_fn(self, code: lv_event_code_t, handler: fn(EventCtx<'_>)) -> Self
fn on_fn(self, code: lv_event_code_t, handler: fn(EventCtx<'_>)) -> Self
Register a stateless safe handler for any LVGL event code.
Source§fn on_clicked(self, handler: fn(EventCtx<'_>)) -> Self
fn on_clicked(self, handler: fn(EventCtx<'_>)) -> Self
Register a stateless safe handler for click events.
Source§fn on_value_change(self, handler: fn(EventCtx<'_>)) -> Self
fn on_value_change(self, handler: fn(EventCtx<'_>)) -> Self
Register a stateless safe handler for value-changed events.
Source§fn on_with<T: Send + Sync + 'static>(
self,
code: lv_event_code_t,
handler: &'static EventHandler<T>,
) -> Self
fn on_with<T: Send + Sync + 'static>( self, code: lv_event_code_t, handler: &'static EventHandler<T>, ) -> Self
Register a stateful safe handler — the handler receives the shared
state from the bundled
InitCell and an EventCtx.Source§fn on_clicked_with<T: Send + Sync + 'static>(
self,
handler: &'static EventHandler<T>,
) -> Self
fn on_clicked_with<T: Send + Sync + 'static>( self, handler: &'static EventHandler<T>, ) -> Self
Stateful click handler (see
EventTarget::on_with).Source§fn on_value_change_with<T: Send + Sync + 'static>(
self,
handler: &'static EventHandler<T>,
) -> Self
fn on_value_change_with<T: Send + Sync + 'static>( self, handler: &'static EventHandler<T>, ) -> Self
Stateful value-change handler (see
EventTarget::on_with).Source§impl<T> Layout for Twhere
T: Widget,
impl<T> Layout for Twhere
T: Widget,
Source§fn pos(self, x: i32, y: i32) -> Self
fn pos(self, x: i32, y: i32) -> Self
Set the position of the widget relative to its parent’s top-left corner.
Source§fn align(self, a: u8, x_ofs: i32, y_ofs: i32) -> Self
fn align(self, a: u8, x_ofs: i32, y_ofs: i32) -> Self
Align the widget using an LVGL alignment constant and pixel offsets. Read more
Source§fn add_flag(self, f: u32) -> Self
fn add_flag(self, f: u32) -> Self
Add one or more LVGL object flags (bitwise OR of
LV_OBJ_FLAG_* values).Source§fn remove_flag(self, f: u32) -> Self
fn remove_flag(self, f: u32) -> Self
Remove one or more LVGL object flags.
Source§fn add_state(self, s: u32) -> Self
fn add_state(self, s: u32) -> Self
Add one or more LVGL object state bits (e.g.
LV_STATE_CHECKED).Source§fn remove_state(self, s: u32) -> Self
fn remove_state(self, s: u32) -> Self
Remove one or more LVGL object state bits.
Source§fn grid_dsc(self, cols: &'static [i32], rows: &'static [i32]) -> Self
fn grid_dsc(self, cols: &'static [i32], rows: &'static [i32]) -> Self
Configure this widget as a grid container. Read more
Source§fn grid_cell(
self,
col_align: u32,
col_pos: i32,
col_span: i32,
row_align: u32,
row_pos: i32,
row_span: i32,
) -> Self
fn grid_cell( self, col_align: u32, col_pos: i32, col_span: i32, row_align: u32, row_pos: i32, row_span: i32, ) -> Self
Place this widget into a cell of its parent grid.
Source§fn flex_flow(self, flow: FlexFlow) -> Self
fn flex_flow(self, flow: FlexFlow) -> Self
Configure this widget as a flex container with the given main-axis flow.
Source§fn flex_align(self, main: FlexAlign, cross: FlexAlign, track: FlexAlign) -> Self
fn flex_align(self, main: FlexAlign, cross: FlexAlign, track: FlexAlign) -> Self
Set flex container alignment along the main, cross (per item), and
cross (per track) axes. Equivalent to
lv_obj_set_flex_align.Source§fn layout(self, kind: LayoutKind) -> Self
fn layout(self, kind: LayoutKind) -> Self
Switch the widget’s layout engine (None / Flex / Grid).
Source§fn scroll_to_y(self, y: i32, anim: bool) -> Self
fn scroll_to_y(self, y: i32, anim: bool) -> Self
Scroll the widget so the given Y coordinate is visible.
anim enables animation.Source§fn update_layout(self) -> Self
fn update_layout(self) -> Self
Force layout recomputation immediately (for queries that need live values).
Source§fn content_width(self) -> i32
fn content_width(self) -> i32
Width of the inner content area (excludes paddings/scrollbars).
Source§fn scroll_bottom(self) -> i32
fn scroll_bottom(self) -> i32
Distance the widget can still scroll towards its bottom edge.
Source§impl<T> Styleable for Twhere
T: Widget,
impl<T> Styleable for Twhere
T: Widget,
Source§fn bg_opa(self, opa: u8) -> Self
fn bg_opa(self, opa: u8) -> Self
Set the background opacity of the widget’s main part (0 = transparent, 255 = opaque).
Source§fn border_color(self, c: Color) -> Self
fn border_color(self, c: Color) -> Self
Set the border color of the widget’s main part.
Source§fn border_width(self, w: i32) -> Self
fn border_width(self, w: i32) -> Self
Set the border width in pixels.
Source§fn radius(self, r: i32) -> Self
fn radius(self, r: i32) -> Self
Set the corner radius in pixels (use
LV_RADIUS_CIRCLE for a pill shape).Source§fn pad_bottom(self, p: i32) -> Self
fn pad_bottom(self, p: i32) -> Self
Set bottom padding.
Source§fn text_color(self, c: Color) -> Self
fn text_color(self, c: Color) -> Self
Set the text color for label-like widgets.
Source§fn text_font(self, f: *const lv_font_t) -> Self
fn text_font(self, f: *const lv_font_t) -> Self
Set the text font. Use
font_montserrat_32 or font_montserrat_14 for built-ins.Source§fn translate_y(self, v: i32, selector: u32) -> Self
fn translate_y(self, v: i32, selector: u32) -> Self
Apply a vertical translation (post-layout offset, in pixels).
Source§fn margin_top(self, v: i32, selector: u32) -> Self
fn margin_top(self, v: i32, selector: u32) -> Self
Top margin in pixels.
Source§fn margin_bottom(self, v: i32, selector: u32) -> Self
fn margin_bottom(self, v: i32, selector: u32) -> Self
Bottom margin in pixels.
Source§fn margin_left(self, v: i32, selector: u32) -> Self
fn margin_left(self, v: i32, selector: u32) -> Self
Left margin in pixels.
Source§fn margin_right(self, v: i32, selector: u32) -> Self
fn margin_right(self, v: i32, selector: u32) -> Self
Right margin in pixels.
Source§fn max_height(self, v: i32, selector: u32) -> Self
fn max_height(self, v: i32, selector: u32) -> Self
Maximum height in pixels (caps
set_height/content sizing).Source§fn arc_opa(self, opa: u8, selector: u32) -> Self
fn arc_opa(self, opa: u8, selector: u32) -> Self
Arc opacity for arc-drawing widgets (0..=255).
Source§fn arc_rounded(self, rounded: bool, selector: u32) -> Self
fn arc_rounded(self, rounded: bool, selector: u32) -> Self
Whether the arc has rounded ends.
Source§fn opa_layered(self, opa: u8, selector: u32) -> Self
fn opa_layered(self, opa: u8, selector: u32) -> Self
Layered opacity (composites the whole subtree at the given alpha).
Source§fn text_align(self, align: u32, selector: u32) -> Self
fn text_align(self, align: u32, selector: u32) -> Self
Set the text alignment (
TEXT_ALIGN_*) for the given selector.Source§fn bg_color_sel(self, c: Color, selector: u32) -> Self
fn bg_color_sel(self, c: Color, selector: u32) -> Self
Background color with explicit selector (part + state bits).
Source§fn bg_opa_sel(self, opa: u8, selector: u32) -> Self
fn bg_opa_sel(self, opa: u8, selector: u32) -> Self
Background opacity with explicit selector.
Source§fn border_color_sel(self, c: Color, selector: u32) -> Self
fn border_color_sel(self, c: Color, selector: u32) -> Self
Border color with explicit selector.
Source§fn text_color_sel(self, c: Color, selector: u32) -> Self
fn text_color_sel(self, c: Color, selector: u32) -> Self
Text color with explicit selector.
Source§fn arc_color_sel(self, c: Color, selector: u32) -> Self
fn arc_color_sel(self, c: Color, selector: u32) -> Self
Arc track color with explicit selector.
Source§fn pad_column(self, p: i32) -> Self
fn pad_column(self, p: i32) -> Self
Column gap (flex layout).