Struct imgui::Ui
[−]
[src]
pub struct Ui<'ui> { /* fields omitted */ }
Methods
impl<'ui> Ui<'ui>
[src]
fn imgui(&self) -> &ImGui
[src]
fn want_capture_mouse(&self) -> bool
[src]
fn want_capture_keyboard(&self) -> bool
[src]
fn framerate(&self) -> f32
[src]
fn metrics_allocs(&self) -> i32
[src]
fn metrics_render_vertices(&self) -> i32
[src]
fn metrics_render_indices(&self) -> i32
[src]
fn metrics_active_windows(&self) -> i32
[src]
fn render<F, E>(self, f: F) -> Result<(), E> where
F: FnMut(&Ui, DrawList) -> Result<(), E>,
[src]
F: FnMut(&Ui, DrawList) -> Result<(), E>,
fn show_user_guide(&self)
[src]
fn show_default_style_editor(&self)
[src]
fn show_style_editor<'p>(&self, style: &'p mut ImGuiStyle)
[src]
fn show_test_window(&self, opened: &mut bool)
[src]
fn show_metrics_window(&self, opened: &mut bool)
[src]
impl<'a> Ui<'a>
[src]
unsafe fn current_ui() -> Option<&'a Ui<'a>>
[src]
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
[src]
fn push_item_width(&self, width: f32)
[src]
Pushes a value to the item width stack.
fn pop_item_width(&self)
[src]
Pops a value from the item width stack.
Aborts
The current process is aborted if the item width stack is empty.
fn with_item_width<F>(&self, width: f32, f: F) where
F: FnOnce(),
[src]
F: FnOnce(),
Runs a function after temporarily pushing a value to the item width stack.
fn separator(&self)
[src]
fn new_line(&self)
[src]
fn same_line(&self, pos_x: f32)
[src]
fn same_line_spacing(&self, pos_x: f32, spacing_w: f32)
[src]
fn spacing(&self)
[src]
fn columns<'p>(&self, count: i32, id: &'p ImStr, border: bool)
[src]
fn next_column(&self)
[src]
fn get_column_index(&self) -> i32
[src]
fn get_column_offset(&self, column_index: i32) -> f32
[src]
fn set_column_offset(&self, column_index: i32, offset_x: f32)
[src]
fn get_column_width(&self, column_index: i32) -> f32
[src]
fn get_columns_count(&self) -> i32
[src]
impl<'ui> Ui<'ui>
[src]
fn push_id(&self, id: i32)
[src]
Pushes an identifier to the ID stack.
fn pop_id(&self)
[src]
Pops an identifier from the ID stack.
Aborts
The current process is aborted if the ID stack is empty.
fn with_id<F>(&self, id: i32, f: F) where
F: FnOnce(),
[src]
F: FnOnce(),
Runs a function after temporarily pushing a value to the ID stack.
impl<'ui> Ui<'ui>
[src]
fn text<T: AsRef<str>>(&self, text: T)
[src]
fn text_colored<'p, A>(&self, col: A, text: &'p ImStr) where
A: Into<ImVec4>,
[src]
A: Into<ImVec4>,
fn text_disabled<'p>(&self, text: &'p ImStr)
[src]
fn text_wrapped<'p>(&self, text: &'p ImStr)
[src]
fn label_text<'p>(&self, label: &'p ImStr, text: &'p ImStr)
[src]
fn bullet(&self)
[src]
fn bullet_text<'p>(&self, text: &'p ImStr)
[src]
[src]
[src]
fn checkbox<'p>(&self, label: &'p ImStr, value: &'p mut bool) -> bool
[src]
impl<'ui> Ui<'ui>
[src]
fn input_text<'p>(
&self,
label: &'p ImStr,
buf: &'p mut ImString
) -> InputText<'ui, 'p>
[src]
&self,
label: &'p ImStr,
buf: &'p mut ImString
) -> InputText<'ui, 'p>
fn input_float<'p>(
&self,
label: &'p ImStr,
value: &'p mut f32
) -> InputFloat<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut f32
) -> InputFloat<'ui, 'p>
fn input_float2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 2]
) -> InputFloat2<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut [f32; 2]
) -> InputFloat2<'ui, 'p>
fn input_float3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 3]
) -> InputFloat3<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut [f32; 3]
) -> InputFloat3<'ui, 'p>
fn input_float4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 4]
) -> InputFloat4<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut [f32; 4]
) -> InputFloat4<'ui, 'p>
fn input_int<'p>(
&self,
label: &'p ImStr,
value: &'p mut i32
) -> InputInt<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut i32
) -> InputInt<'ui, 'p>
fn input_int2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 2]
) -> InputInt2<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut [i32; 2]
) -> InputInt2<'ui, 'p>
fn input_int3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 3]
) -> InputInt3<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut [i32; 3]
) -> InputInt3<'ui, 'p>
fn input_int4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 4]
) -> InputInt4<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut [i32; 4]
) -> InputInt4<'ui, 'p>
impl<'ui> Ui<'ui>
[src]
fn slider_float<'p>(
&self,
label: &'p ImStr,
value: &'p mut f32,
min: f32,
max: f32
) -> SliderFloat<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut f32,
min: f32,
max: f32
) -> SliderFloat<'ui, 'p>
fn slider_float2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 2],
min: f32,
max: f32
) -> SliderFloat2<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut [f32; 2],
min: f32,
max: f32
) -> SliderFloat2<'ui, 'p>
fn slider_float3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 3],
min: f32,
max: f32
) -> SliderFloat3<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut [f32; 3],
min: f32,
max: f32
) -> SliderFloat3<'ui, 'p>
fn slider_float4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [f32; 4],
min: f32,
max: f32
) -> SliderFloat4<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut [f32; 4],
min: f32,
max: f32
) -> SliderFloat4<'ui, 'p>
fn slider_int<'p>(
&self,
label: &'p ImStr,
value: &'p mut i32,
min: i32,
max: i32
) -> SliderInt<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut i32,
min: i32,
max: i32
) -> SliderInt<'ui, 'p>
fn slider_int2<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 2],
min: i32,
max: i32
) -> SliderInt2<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut [i32; 2],
min: i32,
max: i32
) -> SliderInt2<'ui, 'p>
fn slider_int3<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 3],
min: i32,
max: i32
) -> SliderInt3<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut [i32; 3],
min: i32,
max: i32
) -> SliderInt3<'ui, 'p>
fn slider_int4<'p>(
&self,
label: &'p ImStr,
value: &'p mut [i32; 4],
min: i32,
max: i32
) -> SliderInt4<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: &'p mut [i32; 4],
min: i32,
max: i32
) -> SliderInt4<'ui, 'p>
impl<'ui> Ui<'ui>
[src]
fn color_edit<'p, V: Into<EditableColor<'p>>>(
&self,
label: &'p ImStr,
value: V
) -> ColorEdit<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: V
) -> ColorEdit<'ui, 'p>
Constructs a new color editor builder.
fn color_picker<'p, V: Into<EditableColor<'p>>>(
&self,
label: &'p ImStr,
value: V
) -> ColorPicker<'ui, 'p>
[src]
&self,
label: &'p ImStr,
value: V
) -> ColorPicker<'ui, 'p>
Constructs a new color picker builder.
[src]
Constructs a new color button builder.
fn set_color_edit_options(&self, flags: ImGuiColorEditFlags)
[src]
Initialize current options (generally on application startup) if you want to select a default format, picker type, etc. Users will be able to change many settings, unless you use .options(false) in your widget builders.
impl<'ui> Ui<'ui>
[src]
fn tree_node<'p>(&self, id: &'p ImStr) -> TreeNode<'ui, 'p>
[src]
fn collapsing_header<'p>(&self, label: &'p ImStr) -> CollapsingHeader<'ui, 'p>
[src]
impl<'ui> Ui<'ui>
[src]
fn selectable<'p, S: Into<ImVec2>>(
&self,
label: &'p ImStr,
selected: bool,
flags: ImGuiSelectableFlags,
size: S
) -> bool
[src]
&self,
label: &'p ImStr,
selected: bool,
flags: ImGuiSelectableFlags,
size: S
) -> bool
impl<'ui> Ui<'ui>
[src]
fn tooltip<F: FnOnce()>(&self, f: F)
[src]
Construct a tooltip window that can have any kind of content.
Typically used with Ui::is_item_hovered()
or some other conditional check.
Examples
fn user_interface(ui: &Ui) { ui.text("Hover over me"); if ui.is_item_hovered() { ui.tooltip(|| { ui.text_colored((1.0, 0.0, 0.0, 1.0), im_str!("I'm red!")); }); } }
fn tooltip_text<T: AsRef<str>>(&self, text: T)
[src]
Construct a tooltip window with simple text content.
Typically used with Ui::is_item_hovered()
or some other conditional check.
Examples
fn user_interface(ui: &Ui) { ui.text("Hover over me"); if ui.is_item_hovered() { ui.tooltip_text("I'm a tooltip!"); } }
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
[src]
fn open_popup<'p>(&self, str_id: &'p ImStr)
[src]
fn popup<'p, F>(&self, str_id: &'p ImStr, f: F) where
F: FnOnce(),
[src]
F: FnOnce(),
fn close_current_popup(&self)
[src]
impl<'ui> Ui<'ui>
[src]
fn combo<'p>(
&self,
label: &'p ImStr,
current_item: &mut i32,
items: &'p [&'p ImStr],
height_in_items: i32
) -> bool
[src]
&self,
label: &'p ImStr,
current_item: &mut i32,
items: &'p [&'p ImStr],
height_in_items: i32
) -> bool
impl<'ui> Ui<'ui>
[src]
fn list_box<'p>(
&self,
label: &'p ImStr,
current_item: &mut i32,
items: &'p [&'p ImStr],
height_in_items: i32
) -> bool
[src]
&self,
label: &'p ImStr,
current_item: &mut i32,
items: &'p [&'p ImStr],
height_in_items: i32
) -> bool
impl<'ui> Ui<'ui>
[src]
[src]
Creates a radio button for selecting an integer value. Returns true if pressed.
Example
ui.radio_button(im_str!("Item 1"), &mut selected_radio_value, 1); ui.radio_button(im_str!("Item 2"), &mut selected_radio_value, 2); ui.radio_button(im_str!("Item 3"), &mut selected_radio_value, 3);
[src]
Creates a radio button that shows as selected if the given value is true. Returns true if pressed.
Example
if ui.radio_button_bool(im_str!("Cats"), radio_button_test == "cats") { radio_button_test = "cats".to_string(); } if ui.radio_button_bool(im_str!("Dogs"), radio_button_test == "dogs") { radio_button_test = "dogs".to_string(); }
impl<'ui> Ui<'ui>
[src]
impl<'ui> Ui<'ui>
[src]
fn plot_histogram<'p>(
&self,
label: &'p ImStr,
values: &'p [f32]
) -> PlotHistogram<'ui, 'p>
[src]
&self,
label: &'p ImStr,
values: &'p [f32]
) -> PlotHistogram<'ui, 'p>
impl<'ui> Ui<'ui>
[src]
fn calc_text_size(
&self,
text: &ImStr,
hide_text_after_double_hash: bool,
wrap_width: f32
) -> ImVec2
[src]
&self,
text: &ImStr,
hide_text_after_double_hash: bool,
wrap_width: f32
) -> ImVec2
Calculate the size required for a given text string.
hide_text_after_double_hash allows the user to insert comments into their text, using a double hash-tag prefix. This is a feature of imgui.
wrap_width allows you to request a width at which to wrap the text to a newline for the calculation.
impl<'ui> Ui<'ui>
[src]
fn progress_bar<'p>(&self, fraction: f32) -> ProgressBar<'ui, 'p>
[src]
Creates a progress bar. Fraction is the progress level with 0.0 = 0% and 1.0 = 100%.
Example
ui.progress_bar(0.6) .size((100.0, 12.0)) .overlay_text(im_str!("Progress!")) .build();
impl<'ui> Ui<'ui>
[src]
fn child_frame<'p, S: Into<ImVec2>>(
&self,
name: &'p ImStr,
size: S
) -> ChildFrame<'ui, 'p>
[src]
&self,
name: &'p ImStr,
size: S
) -> ChildFrame<'ui, 'p>
Creates a child frame. Size is size of child_frame within parent window.
Example
ui.window(im_str!("ChatWindow")) .title_bar(true) .scrollable(false) .build(|| { ui.separator(); ui.child_frame(im_str!("child frame"), (400.0, 100.0)) .show_borders(true) .always_show_vertical_scroll_bar(true) .build(|| { ui.text_colored((1.0, 0.0, 0.0, 1.0), im_str!("hello mate!")); }); });
impl<'ui> Ui<'ui>
[src]
fn with_style_var<F: FnOnce()>(&self, style_var: StyleVar, f: F)
[src]
Runs a function after temporarily pushing a value to the style stack.
Example
ui.with_style_var(StyleVar::Alpha(0.2), || { ui.text(im_str!("AB")); });
fn with_style_vars<F: FnOnce()>(&self, style_vars: &[StyleVar], f: F)
[src]
Runs a function after temporarily pushing an array of values into the stack. Supporting multiple is also easy since you can freely mix and match them in a safe manner.
Example
ui.with_style_vars(&styles, || { ui.text(im_str!("A")); ui.text(im_str!("B")); ui.text(im_str!("C")); ui.text(im_str!("D")); });
impl<'ui> Ui<'ui>
[src]
fn with_color_var<F: FnOnce(), C: Into<ImVec4> + Copy>(
&self,
var: ImGuiCol,
color: C,
f: F
)
[src]
&self,
var: ImGuiCol,
color: C,
f: F
)
Runs a function after temporarily pushing a value to the color stack.
Example
ui.with_color_var(ImGuiCol::Text, (1.0, 0.0, 0.0, 1.0), || { ui.text_wrapped(im_str!("AB")); });
fn with_color_vars<F: FnOnce(), C: Into<ImVec4> + Copy>(
&self,
color_vars: &[(ImGuiCol, C)],
f: F
)
[src]
&self,
color_vars: &[(ImGuiCol, C)],
f: F
)
Runs a function after temporarily pushing an array of values to the color stack.
Example
let red = (1.0, 0.0, 0.0, 1.0); let green = (0.0, 1.0, 0.0, 1.0); ui.with_color_vars(&vars, || { ui.text_wrapped(im_str!("AB")); });
impl<'ui> Ui<'ui>
[src]
fn is_item_hovered(&self) -> bool
[src]
Returns true
if the last item is being hovered by the mouse.
Examples
fn user_interface(ui: &Ui) { ui.text("Hover over me"); let is_hover_over_me_text_hovered = ui.is_item_hovered(); }