From abd39597ed58f35fa6ba52d6316c8d16a8b44a37 Mon Sep 17 00:00:00 2001 From: Malik Olivier Boussejra Date: Mon, 30 Apr 2018 12:46:18 +0900 Subject: [PATCH] input: Add API to set read_only, password and no_undo_redo falgs --- src/input.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/input.rs b/src/input.rs index 8b8413b..ec16428 100644 --- a/src/input.rs +++ b/src/input.rs @@ -89,6 +89,24 @@ macro_rules! impl_text_flags { self.flags.set(ImGuiInputTextFlags::AlwaysInsertMode, value); self } + + #[inline] + pub fn read_only(mut self, value: bool) -> Self { + self.flags.set(ImGuiInputTextFlags::ReadOnly, value); + self + } + + #[inline] + pub fn password(mut self, value: bool) -> Self { + self.flags.set(ImGuiInputTextFlags::Password, value); + self + } + + #[inline] + pub fn no_undo_redo(mut self, value: bool) -> Self { + self.flags.set(ImGuiInputTextFlags::NoUndoRedo, value); + self + } } }