pub struct Ui<A>where
A: ?Sized,{ /* private fields */ }
Expand description
Ui
represents an ImGui frame that is being built.
Usually you will get a &mut Ui
when you are expected to build a user interface,
as in UiBuilder::do_ui
.
Implementations§
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn set_next_item_selection_user_data(&self, i: usize)
pub fn is_item_toggled_selection(&self) -> bool
Sourcepub fn with_multi_select<R, Storage: MultiSelectStorage>(
&self,
flags: MultiSelectFlags,
items_count: Option<usize>,
storage: Storage,
f: impl FnOnce(&mut Storage, &mut MultiSelect) -> R,
) -> R
pub fn with_multi_select<R, Storage: MultiSelectStorage>( &self, flags: MultiSelectFlags, items_count: Option<usize>, storage: Storage, f: impl FnOnce(&mut Storage, &mut MultiSelect) -> R, ) -> R
Wraps the call to f
between BeginMultiselect
and EndMultiselect
.
The storage
argument defines how the selection status will be stored.
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn progress_bar_config<'a>(&self, fraction: f32) -> ProgressBar<&'a str>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn image_config(&self, user_texture_id: TextureId, size: Vector2) -> Image
pub fn image_with_custom_rect_config( &self, ridx: CustomRectIndex, scale: f32, ) -> Image
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn selectable_config<S: IntoCStr>(&self, label: LblId<S>) -> Selectable<S>
pub fn selectable<S: IntoCStr>(&self, label: LblId<S>) -> bool
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn drag_float_2_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 2], ) -> DragFloat2<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn drag_float_3_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 3], ) -> DragFloat3<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn drag_float_4_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 4], ) -> DragFloat4<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_float_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut f32, ) -> SliderFloat<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_float_2_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 2], ) -> SliderFloat2<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_float_3_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 3], ) -> SliderFloat3<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_float_4_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 4], ) -> SliderFloat4<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_int_2_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [i32; 2], ) -> SliderInt2<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_int_3_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [i32; 3], ) -> SliderInt3<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_int_4_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [i32; 4], ) -> SliderInt4<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn slider_angle_config<'v, S: IntoCStr>( &self, label: LblId<S>, v_rad: &'v mut f32, ) -> SliderAngle<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn color_edit_3_config<'v, S: IntoCStr>( &self, label: LblId<S>, color: &'v mut [f32; 3], ) -> ColorEdit3<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn color_edit_4_config<'v, S: IntoCStr>( &self, label: LblId<S>, color: &'v mut Color, ) -> ColorEdit4<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn color_picker_3_config<'v, S: IntoCStr>( &self, label: LblId<S>, color: &'v mut [f32; 3], ) -> ColorPicker3<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn color_picker_4_config<'v, S: IntoCStr>( &self, label: LblId<S>, color: &'v mut Color, ) -> ColorPicker4<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn input_os_string_config<'v, S: IntoCStr>( &self, label: LblId<S>, text: &'v mut OsString, ) -> InputOsString<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn input_text_multiline_config<'v, S: IntoCStr>( &self, label: LblId<S>, text: &'v mut String, ) -> InputTextMultiline<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn input_text_hint_config<'v, S1: IntoCStr, S2: IntoCStr>( &self, label: LblId<S1>, hint: S2, text: &'v mut String, ) -> InputTextHint<'v, S1, S2>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn input_float_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut f32, ) -> InputFloat<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn input_float_2_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 2], ) -> InputFloat2<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn input_float_3_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 3], ) -> InputFloat3<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn input_float_4_config<'v, S: IntoCStr>( &self, label: LblId<S>, value: &'v mut [f32; 4], ) -> InputFloat4<'v, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn collapsing_header_config<S: IntoCStr>( &self, label: LblId<S>, ) -> CollapsingHeader<S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn popup_modal_config<S: IntoCStr>( &self, name: LblId<S>, ) -> PopupModal<'static, S>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn popup_context_item_config<'a>(&self) -> PopupContextItem<&'a str>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn popup_context_window_config<'a>(&self) -> PopupContextWindow<&'a str>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn popup_context_void_config<'a>(&self) -> PopupContextVoid<&'a str>
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn tab_item_config<S: IntoCStr>(&self, str_id: LblId<S>) -> TabItem<'_, S>
pub fn set_tab_item_closed(tab_or_docked_window_label: LblId<impl IntoCStr>)
Source§impl<A> Ui<A>
impl<A> Ui<A>
Sourcepub fn invalidate_font_atlas(&self)
pub fn invalidate_font_atlas(&self)
The next time CurrentContext::do_frame()
is called, it will trigger a call to
UiBuilder::build_custom_atlas
.
pub fn display_size(&self) -> Vector2
pub fn display_scale(&self) -> f32
pub fn get_clipboard_text(&self) -> String
pub fn set_clipboard_text(&self, text: impl IntoCStr)
pub fn set_next_window_size_constraints_callback( &self, size_min: Vector2, size_max: Vector2, cb: impl FnMut(SizeCallbackData<'_>) + 'static, )
pub fn set_next_window_size_constraints( &self, size_min: Vector2, size_max: Vector2, )
pub fn set_next_item_width(&self, item_width: f32)
pub fn set_next_item_open(&self, is_open: bool, cond: Cond)
pub fn set_keyboard_focus_here(&self, offset: i32)
Sourcepub fn with_group<R>(&self, f: impl FnOnce() -> R) -> R
pub fn with_group<R>(&self, f: impl FnOnce() -> R) -> R
See BeginGroup
, EndGroup
.
Sourcepub fn with_disabled<R>(&self, disabled: bool, f: impl FnOnce() -> R) -> R
pub fn with_disabled<R>(&self, disabled: bool, f: impl FnOnce() -> R) -> R
See BeginDisabled
, EndDisabled
.
Sourcepub fn with_clip_rect<R>(
&self,
clip_rect_min: Vector2,
clip_rect_max: Vector2,
intersect_with_current_clip_rect: bool,
f: impl FnOnce() -> R,
) -> R
pub fn with_clip_rect<R>( &self, clip_rect_min: Vector2, clip_rect_max: Vector2, intersect_with_current_clip_rect: bool, f: impl FnOnce() -> R, ) -> R
See PushClipRect
, PopClipRect
.
See BeginMainMenuBar
, EndMainMenuBar
.
See BeginMenuBar
, EndMenuBar
.
Sourcepub fn with_tooltip<R>(&self, f: impl FnOnce() -> R) -> Option<R>
pub fn with_tooltip<R>(&self, f: impl FnOnce() -> R) -> Option<R>
See BeginTooltip
, EndTooltip
.
pub fn with_always_tooltip<R>(&self, f: impl FnOnce(bool) -> R) -> R
Sourcepub fn with_item_tooltip<R>(&self, f: impl FnOnce() -> R) -> Option<R>
pub fn with_item_tooltip<R>(&self, f: impl FnOnce() -> R) -> Option<R>
See BeginItemTooltip
, EndTooltip
. There is not EndItemTooltip
.
pub fn with_always_item_tooltip<R>(&self, f: impl FnOnce(bool) -> R) -> R
Sourcepub fn with_push<R>(&self, push: impl Pushable, f: impl FnOnce() -> R) -> R
pub fn with_push<R>(&self, push: impl Pushable, f: impl FnOnce() -> R) -> R
Calls the f
functions with the given push
pub fn show_demo_window(&self, show: Option<&mut bool>)
pub fn set_next_window_pos(&self, pos: Vector2, cond: Cond, pivot: Vector2)
pub fn set_next_window_size(&self, size: Vector2, cond: Cond)
pub fn set_next_window_content_size(&self, size: Vector2)
pub fn set_next_window_collapsed(&self, collapsed: bool, cond: Cond)
pub fn set_next_window_focus(&self)
pub fn set_next_window_scroll(&self, scroll: Vector2)
pub fn set_next_window_bg_alpha(&self, alpha: f32)
pub fn window_draw_list(&self) -> WindowDrawList<'_, A>
pub fn foreground_draw_list(&self) -> WindowDrawList<'_, A>
pub fn background_draw_list(&self) -> WindowDrawList<'_, A>
pub fn text(&self, text: &str)
pub fn text_colored(&self, color: Color, text: impl IntoCStr)
pub fn text_disabled(&self, text: impl IntoCStr)
pub fn text_wrapped(&self, text: impl IntoCStr)
pub fn text_link(&self, label: LblId<impl IntoCStr>) -> bool
pub fn text_link_open_url( &self, label: LblId<impl IntoCStr>, url: impl IntoCStr, )
pub fn label_text(&self, label: impl IntoCStr, text: impl IntoCStr)
pub fn bullet_text(&self, text: impl IntoCStr)
pub fn bullet(&self)
pub fn separator_text(&self, text: impl IntoCStr)
pub fn separator(&self)
pub fn set_item_default_focus(&self)
pub fn is_item_hovered(&self) -> bool
pub fn is_item_hovered_ex(&self, flags: HoveredFlags) -> bool
pub fn is_item_active(&self) -> bool
pub fn is_item_focused(&self) -> bool
pub fn is_item_clicked(&self, flags: MouseButton) -> bool
pub fn is_item_visible(&self) -> bool
pub fn is_item_edited(&self) -> bool
pub fn is_item_activated(&self) -> bool
pub fn is_item_deactivated(&self) -> bool
pub fn is_item_deactivated_after_edit(&self) -> bool
pub fn is_item_toggled_open(&self) -> bool
pub fn is_any_item_hovered(&self) -> bool
pub fn is_any_item_active(&self) -> bool
pub fn is_any_item_focused(&self) -> bool
pub fn is_window_collapsed(&self) -> bool
pub fn is_window_focused(&self, flags: FocusedFlags) -> bool
pub fn is_window_hovered(&self, flags: FocusedFlags) -> bool
pub fn get_item_id(&self) -> ImGuiID
pub fn get_id(&self, id: impl Hashable) -> ImGuiID
pub fn get_item_rect_min(&self) -> Vector2
pub fn get_item_rect_max(&self) -> Vector2
pub fn get_item_rect_size(&self) -> Vector2
pub fn get_main_viewport(&self) -> Viewport<'_>
pub fn get_content_region_avail(&self) -> Vector2
pub fn get_window_pos(&self) -> Vector2
pub fn get_window_width(&self) -> f32
pub fn get_window_height(&self) -> f32
pub fn get_scroll_x(&self) -> f32
pub fn get_scroll_y(&self) -> f32
pub fn set_scroll_x(&self, scroll_x: f32)
pub fn set_scroll_y(&self, scroll_y: f32)
pub fn get_scroll_max_x(&self) -> f32
pub fn get_scroll_max_y(&self) -> f32
pub fn set_scroll_here_x(&self, center_x_ratio: f32)
pub fn set_scroll_here_y(&self, center_y_ratio: f32)
pub fn set_scroll_from_pos_x(&self, local_x: f32, center_x_ratio: f32)
pub fn set_scroll_from_pos_y(&self, local_y: f32, center_y_ratio: f32)
pub fn set_window_pos(&self, pos: Vector2, cond: Cond)
pub fn set_window_size(&self, size: Vector2, cond: Cond)
pub fn set_window_collapsed(&self, collapsed: bool, cond: Cond)
pub fn set_window_focus(&self)
pub fn same_line(&self)
pub fn same_line_ex(&self, offset_from_start_x: f32, spacing: f32)
pub fn new_line(&self)
pub fn spacing(&self)
pub fn dummy(&self, size: Vector2)
pub fn indent(&self, indent_w: f32)
pub fn unindent(&self, indent_w: f32)
pub fn get_cursor_pos(&self) -> Vector2
pub fn get_cursor_pos_x(&self) -> f32
pub fn get_cursor_pos_y(&self) -> f32
pub fn set_cursor_pos(&self, local_pos: Vector2)
pub fn set_cursor_pos_x(&self, local_x: f32)
pub fn set_cursor_pos_y(&self, local_y: f32)
pub fn get_cursor_start_pos(&self) -> Vector2
pub fn get_cursor_screen_pos(&self) -> Vector2
pub fn set_cursor_screen_pos(&self, pos: Vector2)
pub fn align_text_to_frame_padding(&self)
pub fn get_text_line_height(&self) -> f32
pub fn get_text_line_height_with_spacing(&self) -> f32
pub fn get_frame_height(&self) -> f32
pub fn get_frame_height_with_spacing(&self) -> f32
pub fn calc_item_width(&self) -> f32
pub fn calc_text_size(&self, text: &str) -> Vector2
pub fn calc_text_size_ex( &self, text: &str, hide_text_after_double_hash: bool, wrap_width: f32, ) -> Vector2
pub fn set_color_edit_options(&self, flags: ColorEditFlags)
pub fn key_mods(&self) -> KeyMod
pub fn is_key_down(&self, key: Key) -> bool
pub fn is_key_pressed(&self, key: Key) -> bool
pub fn is_key_pressed_no_repeat(&self, key: Key) -> bool
pub fn is_key_released(&self, key: Key) -> bool
pub fn get_key_pressed_amount( &self, key: Key, repeat_delay: f32, rate: f32, ) -> i32
pub fn get_font_tex_uv_white_pixel(&self) -> Vector2
pub fn get_font_size(&self) -> f32
pub fn is_mouse_down(&self, button: MouseButton) -> bool
pub fn is_mouse_clicked(&self, button: MouseButton) -> bool
pub fn is_mouse_clicked_repeat(&self, button: MouseButton) -> bool
pub fn is_mouse_released(&self, button: MouseButton) -> bool
pub fn is_mouse_double_clicked(&self, button: MouseButton) -> bool
pub fn get_mouse_clicked_count(&self, button: MouseButton) -> i32
pub fn is_rect_visible_size(&self, size: Vector2) -> bool
pub fn is_rect_visible(&self, rect_min: Vector2, rect_max: Vector2) -> bool
pub fn is_any_mouse_down(&self) -> bool
pub fn get_mouse_pos(&self) -> Vector2
pub fn get_mouse_pos_on_opening_current_popup(&self) -> Vector2
pub fn is_mouse_dragging(&self, button: MouseButton) -> bool
pub fn get_mouse_drag_delta(&self, button: MouseButton) -> Vector2
pub fn reset_mouse_drag_delta(&self, button: MouseButton)
pub fn get_mouse_cursor(&self) -> MouseCursor
pub fn set_mouse_cursor(&self, cursor_type: MouseCursor)
pub fn get_time(&self) -> f64
pub fn get_frame_count(&self) -> i32
pub fn is_popup_open(&self, str_id: Option<Id<impl IntoCStr>>) -> bool
pub fn is_popup_open_ex( &self, str_id: Option<Id<impl IntoCStr>>, flags: PopupFlags, ) -> bool
Sourcepub fn is_below_blocking_modal(&self) -> bool
pub fn is_below_blocking_modal(&self) -> bool
Returns true if the current window is below a modal pop-up.
Sourcepub fn is_blocking_modal(&self) -> bool
pub fn is_blocking_modal(&self) -> bool
Return true if there is any modal window opened
pub fn open_popup(&self, str_id: Id<impl IntoCStr>)
pub fn open_popup_ex(&self, str_id: Id<impl IntoCStr>, flags: PopupFlags)
pub fn close_current_popup(&self)
pub fn is_window_appearing(&self) -> bool
pub fn io(&self) -> &ImGuiIO
pub fn font_atlas(&self) -> FontAtlas<'_>
pub fn with_always_drag_drop_source<R>( &self, flags: DragDropSourceFlags, f: impl FnOnce(Option<DragDropPayloadSetter<'_>>) -> R, ) -> R
pub fn with_drag_drop_source<R>( &self, flags: DragDropSourceFlags, f: impl FnOnce(DragDropPayloadSetter<'_>) -> R, ) -> Option<R>
pub fn with_always_drag_drop_target<R>( &self, f: impl FnOnce(Option<DragDropPayloadGetter<'_>>) -> R, ) -> R
pub fn with_drag_drop_target<R>( &self, f: impl FnOnce(DragDropPayloadGetter<'_>) -> R, ) -> Option<R>
pub fn list_clipper(&self, items_count: usize) -> ListClipper
pub fn shortcut(&self, key_chord: impl Into<KeyChord>) -> bool
pub fn shortcut_ex( &self, key_chord: impl Into<KeyChord>, flags: InputFlags, ) -> bool
pub fn set_next_item_shortcut(&self, key_chord: impl Into<KeyChord>)
pub fn set_next_item_shortcut_ex( &self, key_chord: impl Into<KeyChord>, flags: InputFlags, )
pub fn is_keychord_pressed(&self, key_chord: impl Into<KeyChord>) -> bool
Sourcepub fn find_glyph(&self, font_id: FontId, c: char) -> FontGlyph<'_>
pub fn find_glyph(&self, font_id: FontId, c: char) -> FontGlyph<'_>
Gets information about a glyph for a font.
This is a member of Ui
instead of FontAtlas
because it requires the atlas to be fully
built, and in build_custom_atlas
it is not yet. The only way to ensure a fully built
atlas is by requiring a &Ui
.
Source§impl<A> Ui<A>
impl<A> Ui<A>
pub fn table_config<S: IntoCStr>( &self, str_id: LblId<S>, column: i32, ) -> TableConfig<S>
pub fn table_next_row(&self, flags: TableRowFlags, min_row_height: f32)
pub fn table_next_column(&self) -> bool
pub fn table_set_column_index(&self, column_n: i32) -> bool
pub fn table_setup_column( &self, label: impl IntoCStr, flags: TableColumnFlags, init_width_or_weight: f32, user_id: ImGuiID, )
pub fn table_setup_scroll_freeze(&self, cols: i32, rows: i32)
pub fn table_headers_row(&self)
pub fn table_angle_headers_row(&self)
pub fn table_get_columns_count(&self) -> i32
pub fn table_get_column_index(&self) -> i32
Sourcepub fn table_get_hovered_column(&self) -> Option<i32>
pub fn table_get_hovered_column(&self) -> Option<i32>
Can return one-pass the last column if hovering the empty space
pub fn table_get_row_index(&self) -> i32
pub fn table_get_column_flags(&self, column_n: Option<i32>) -> TableColumnFlags
pub fn table_get_column_name(&self, column_n: Option<i32>) -> String
pub fn table_set_column_enabled(&self, column_n: Option<i32>, enabled: bool)
pub fn table_set_bg_color( &self, target: TableBgTarget, color: Color, column_n: Option<i32>, )
pub fn table_with_sort_specs( &self, sort_fn: impl FnOnce(&[TableColumnSortSpec]), )
Sourcepub fn table_with_sort_specs_always(
&self,
sort_fn: impl FnOnce(bool, &[TableColumnSortSpec]) -> bool,
)
pub fn table_with_sort_specs_always( &self, sort_fn: impl FnOnce(bool, &[TableColumnSortSpec]) -> bool, )
The sort_fn
takes the old dirty
and returns the new dirty
.