Struct imgui::InputText

source ·
pub struct InputText<'ui, 'p, L, H = &'static str, T = PassthroughCallback> { /* private fields */ }

Implementations§

source§

impl<'ui, 'p, L: AsRef<str>> InputText<'ui, 'p, L>

source

pub fn new(ui: &'ui Ui, label: L, buf: &'p mut String) -> Self

Creates a new input text widget to edit the given string.

String Editing

Please note, ImGui requires this string to be null-terminated. We accomplish this by appending and then removing a null terminator (\0) from the String you pass in. This has several consequences:

  1. The string’s backing buffer may be resized and relocated even without edits as result of this pushed char.
  2. The string will appear truncated if the string contains \0 inside it. This will not cause memory unsafety, but it will limit your usage. If that’s the case, please pre-process your string.
  3. Truncations by ImGui appear to be done primarily by insertions of \0 to the truncation point. We will handle this for you and edit the string “properly” too, but this might show up in callbacks.
source§

impl<'ui, 'p, T, L, H> InputText<'ui, 'p, L, H, T>where L: AsRef<str>, H: AsRef<str>, T: InputTextCallbackHandler,

source

pub fn hint<H2: AsRef<str>>(self, hint: H2) -> InputText<'ui, 'p, L, H2, T>

Sets the hint displayed in the input text background.

source

pub fn flags(self, flags: InputTextFlags) -> Self

source

pub fn chars_decimal(self, value: bool) -> Self

source

pub fn chars_hexadecimal(self, value: bool) -> Self

source

pub fn chars_uppercase(self, value: bool) -> Self

source

pub fn chars_noblank(self, value: bool) -> Self

source

pub fn auto_select_all(self, value: bool) -> Self

source

pub fn enter_returns_true(self, value: bool) -> Self

source

pub fn allow_tab_input(self, value: bool) -> Self

source

pub fn no_horizontal_scroll(self, value: bool) -> Self

source

pub fn always_insert_mode(self, value: bool) -> Self

Note: this is equivalent to always_overwrite

source

pub fn always_overwrite(self, value: bool) -> Self

source

pub fn read_only(self, value: bool) -> Self

source

pub fn password(self, value: bool) -> Self

source

pub fn no_undo_redo(self, value: bool) -> Self

source

pub fn callback<T2: InputTextCallbackHandler>( self, callbacks: InputTextCallback, callback: T2 ) -> InputText<'ui, 'p, L, H, T2>

source

pub fn build(self) -> bool

Builds the string editor, performing string editing operations.

String Editing

Please note, ImGui requires this string to be null-terminated. We accomplish this by appending and then removing a null terminator (\0) from the String you pass in. This has several consequences:

  1. The string’s backing buffer may be resized and relocated even without edits as result of this pushed char.
  2. The string will appear truncated if the string contains \0 inside it. This will not cause memory unsafety, but it will limit your usage. If that’s the case, please pre-process your string.
  3. Truncations by ImGui appear to be done primarily by insertions of \0 to the truncation point. We will handle this for you and edit the string “properly” too, but this might show up in callbacks.

Auto Trait Implementations§

§

impl<'ui, 'p, L, H = &'static str, T = PassthroughCallback> !RefUnwindSafe for InputText<'ui, 'p, L, H, T>

§

impl<'ui, 'p, L, H = &'static str, T = PassthroughCallback> !Send for InputText<'ui, 'p, L, H, T>

§

impl<'ui, 'p, L, H = &'static str, T = PassthroughCallback> !Sync for InputText<'ui, 'p, L, H, T>

§

impl<'ui, 'p, L, H, T> Unpin for InputText<'ui, 'p, L, H, T>where H: Unpin, L: Unpin, T: Unpin,

§

impl<'ui, 'p, L, H = &'static str, T = PassthroughCallback> !UnwindSafe for InputText<'ui, 'p, L, H, T>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.