InputTextCallbackHandler

Trait InputTextCallbackHandler 

Source
pub trait InputTextCallbackHandler {
    // Provided methods
    fn char_filter(&mut self, _c: char) -> Option<char> { ... }
    fn on_completion(&mut self, _data: TextCallbackData) { ... }
    fn on_history(
        &mut self,
        _direction: HistoryDirection,
        _data: TextCallbackData,
    ) { ... }
    fn on_always(&mut self, _data: TextCallbackData) { ... }
    fn on_edit(&mut self, _data: TextCallbackData) { ... }
}
Expand description

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

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

Provided Methods§

Source

fn char_filter(&mut self, _c: char) -> Option<char>

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

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

Source

fn on_completion(&mut self, _data: TextCallbackData)

Called when the user presses the completion key (TAB by default).

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

Source

fn on_history(&mut self, _direction: HistoryDirection, _data: TextCallbackData)

Called when the user presses Up/Down arrow keys for history navigation.

To make ImGui run this callback, use InputTextCallback::HISTORY.

Source

fn on_always(&mut self, _data: TextCallbackData)

Called every frame when the input text is active.

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

Source

fn on_edit(&mut self, _data: TextCallbackData)

Called when the text buffer is edited.

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

Implementors§