Trait imgui::InputTextCallbackHandler[][src]

pub trait InputTextCallbackHandler {
    fn char_filter(&mut self, c: char) -> Option<char> { ... }
fn on_completion(&mut self, _: TextCallbackData<'_>) { ... }
fn on_edit(&mut self, _: TextCallbackData<'_>) { ... }
fn on_history(&mut self, _: HistoryDirection, _: TextCallbackData<'_>) { ... }
fn on_always(&mut self, _: TextCallbackData<'_>) { ... } }
Expand description

This trait provides an interface which ImGui will call on InputText and InputTextMultiline callbacks.

Each method is called if and only if the corresponding flag for each method is passed to ImGui in the callback builder.

Each method here lists the flag required to call it, and this module begins with an example of callbacks being used.

Provided methods

Filters a char – returning a None means that the char is removed, and returning another char substitutes it out.

Because of upstream ImGui choices, you do not have access to the buffer during this callback (for some reason).

To make ImGui run this callback, use InputTextCallback::CHAR_FILTER or InputTextMultilineCallback::CHAR_FILTER.

Allows one to perform autocompletion work when the Tab key has been pressed.

To make ImGui run this callback, use InputTextCallback::COMPLETION or InputTextMultilineCallback::COMPLETION.

Allows one to edit the inner buffer whenever the buffer has been changed.

To make ImGui run this callback, use InputTextCallback::EDIT or InputTextMultilineCallback::EDIT.

A callback when one of the direction keys have been pressed.

To make ImGui run this callback, use InputTextCallback::HISTORY. It appears that this callback will not be ran in a multiline input widget at all.

A callback which will always fire, each tick.

To make ImGui run this callback, use InputTextCallback::ALWAYS or InputTextMultilineCallback::ALWAYS.

Implementors