Struct Context

Source
pub struct Context { /* private fields */ }

Implementations§

Source§

impl Context

Source

pub fn new(alloc: &mut Allocator, font: &UserFont) -> Context

Source

pub fn clip_mut(&mut self) -> &mut Clipboard

Source

pub fn clip(&self) -> &Clipboard

Source

pub fn last_widget_state(&self) -> Flags

Source

pub fn delta_time_seconds(&self) -> f32

Source

pub fn button_behavior(&self) -> ButtonBehavior

Source

pub fn set_button_behavior(&mut self, bb: ButtonBehavior)

Source

pub fn input_mut(&mut self) -> &mut Input

Source

pub fn style_mut(&mut self) -> &mut Style

Source

pub fn draw_list_mut(&mut self) -> &mut DrawList

Source

pub fn input(&self) -> &Input

Source

pub fn style(&self) -> &Style

Source

pub fn draw_list(&self) -> &DrawList

Source

pub fn clear(&mut self)

Source

pub fn begin(&mut self, title: String<'_>, bounds: Rect, flags: Flags) -> bool

Source

pub fn begin_titled( &mut self, name: String<'_>, title: String<'_>, bounds: Rect, flags: Flags, ) -> i32

Source

pub fn end(&mut self)

Source

pub fn window_find<S: AsRef<str>>(&self, name: S) -> Option<&Window>

Source

pub fn window_find_mut(&mut self, name: String<'_>) -> Option<&mut Window>

Source

pub fn window_get_bounds(&self) -> Rect

Source

pub fn window_get_size(&self) -> Vec2

Source

pub fn window_get_position(&self) -> Vec2

Source

pub fn window_get_width(&self) -> f32

Source

pub fn window_get_height(&self) -> f32

Source

pub fn window_get_panel_mut(&mut self) -> Option<&mut Panel>

Source

pub fn window_get_panel(&self) -> Option<&Panel>

Source

pub fn window_get_content_region(&self) -> Rect

Source

pub fn window_get_content_region_min(&self) -> Vec2

Source

pub fn window_get_content_region_max(&self) -> Vec2

Source

pub fn window_get_content_region_size(&self) -> Vec2

Source

pub fn window_get_canvas_mut(&mut self) -> Option<&mut CommandBuffer>

Source

pub fn window_get_canvas(&self) -> Option<&CommandBuffer>

Source

pub fn window_has_focus(&self) -> bool

Source

pub fn window_is_collapsed(&self, name: String<'_>) -> bool

Source

pub fn window_is_closed(&self, name: String<'_>) -> bool

Source

pub fn window_is_hidden(&self, name: String<'_>) -> bool

Source

pub fn window_is_active(&self, name: String<'_>) -> bool

Source

pub fn window_is_hovered(&self) -> bool

Source

pub fn window_is_any_hovered(&self) -> bool

Source

pub fn item_is_any_active(&self) -> bool

Source

pub fn window_set_bounds<S: AsRef<str>>(&mut self, name: S, bounds: Rect)

Source

pub fn window_set_position<S: AsRef<str>>(&mut self, name: S, pos: Vec2)

Source

pub fn window_set_size<S: AsRef<str>>(&mut self, name: S, size: Vec2)

Source

pub fn window_set_focus(&mut self, name: String<'_>)

Source

pub fn window_close(&mut self, name: String<'_>)

Source

pub fn window_collapse(&mut self, name: String<'_>, state: CollapseState)

Source

pub fn window_collapse_if( &mut self, name: String<'_>, state: CollapseState, cond: bool, )

Source

pub fn window_show(&mut self, name: String<'_>, state: ShowState)

Source

pub fn window_show_if(&mut self, name: String<'_>, state: ShowState, cond: bool)

Source

pub fn layout_row_dynamic(&mut self, height: f32, cols: i32)

Source

pub fn layout_row_static(&mut self, height: f32, item_width: i32, cols: i32)

Source

pub fn layout_row_begin( &mut self, fmt: LayoutFormat, row_height: f32, cols: i32, )

Source

pub fn layout_row_push(&mut self, value: f32)

Source

pub fn layout_row_end(&mut self)

Source

pub fn layout_row(&mut self, fmt: LayoutFormat, height: f32, cols_ratio: &[f32])

Source

pub fn layout_space_begin( &mut self, fmt: LayoutFormat, height: f32, widget_count: i32, )

Source

pub fn layout_space_push(&mut self, space: Rect)

Source

pub fn layout_space_end(&mut self)

Source

pub fn layout_space_bounds(&mut self) -> Rect

Source

pub fn layout_space_to_screen(&mut self, space: Vec2) -> Vec2

Source

pub fn layout_space_to_local(&mut self, space: Vec2) -> Vec2

Source

pub fn layout_space_rect_to_screen(&mut self, space: Rect) -> Rect

Source

pub fn layout_space_rect_to_local(&mut self, space: Rect) -> Rect

Source

pub fn layout_ratio_from_pixel(&mut self, pixel_width: f32) -> f32

Source

pub fn group_begin(&mut self, title: String<'_>, flags: Flags) -> i32

Source

pub fn group_end(&mut self)

Source

pub fn tree_push_hashed( &mut self, ty: TreeType, title: String<'_>, initial_state: CollapseState, hash: String<'_>, len: i32, seed: i32, ) -> i32

Source

pub fn tree_image_push_hashed( &mut self, ty: TreeType, i: Image, title: String<'_>, initial_state: CollapseState, hash: String<'_>, len: i32, seed: i32, ) -> i32

Source

pub fn tree_pop(&mut self)

Source

pub fn text(&mut self, text: &str, flags: Flags)

Source

pub fn text_colored(&mut self, text: &str, flags: Flags, color: Color)

Source

pub fn text_wrap(&mut self, text: &str)

Source

pub fn text_wrap_colored(&mut self, text: &str, color: Color)

Source

pub fn label(&mut self, text: String<'_>, flags: Flags)

Source

pub fn label_colored(&mut self, text: String<'_>, flags: Flags, color: Color)

Source

pub fn label_wrap(&mut self, text: String<'_>)

Source

pub fn label_colored_wrap(&mut self, text: String<'_>, color: Color)

Source

pub fn image(&mut self, img: Image)

Source

pub fn button_text(&mut self, text: &str) -> bool

Source

pub fn button_label(&mut self, title: String<'_>) -> bool

Source

pub fn button_color(&mut self, color: Color) -> bool

Source

pub fn button_symbol(&mut self, ty: SymbolType) -> bool

Source

pub fn button_image(&mut self, img: Image) -> bool

Source

pub fn button_symbol_label( &mut self, ty: SymbolType, title: String<'_>, text_alignment: Flags, ) -> bool

Source

pub fn button_symbol_text( &mut self, ty: SymbolType, title: &str, text_alignment: Flags, ) -> bool

Source

pub fn button_image_label( &mut self, img: Image, title: String<'_>, text_alignment: Flags, ) -> bool

Source

pub fn button_image_text( &mut self, img: Image, title: &str, text_alignment: Flags, ) -> bool

Source

pub fn button_set_behavior(&mut self, b: ButtonBehavior)

Source

pub fn button_push_behavior(&mut self, b: ButtonBehavior) -> i32

Source

pub fn button_pop_behavior(&mut self) -> i32

Source

pub fn check_label(&mut self, title: String<'_>, active: bool) -> i32

Source

pub fn check_text(&mut self, title: &str, active: bool) -> i32

Source

pub fn check_flags_label( &mut self, title: String<'_>, flags: u32, value: u32, ) -> u32

Source

pub fn check_flags_text(&mut self, title: &str, flags: u32, value: u32) -> u32

Source

pub fn checkbox_label(&mut self, title: String<'_>, active: &mut bool) -> bool

Source

pub fn checkbox_text(&mut self, title: &str, active: &mut bool) -> bool

Source

pub fn checkbox_flags_label( &mut self, title: String<'_>, flags: &mut u32, value: u32, ) -> bool

Source

pub fn checkbox_flags_text( &mut self, title: &str, flags: &mut u32, value: u32, ) -> bool

Source

pub fn radio_label(&mut self, title: String<'_>, active: &mut bool) -> bool

Source

pub fn radio_text(&mut self, title: &str, active: &mut bool) -> bool

Source

pub fn option_label(&mut self, title: String<'_>, active: bool) -> bool

Source

pub fn option_text(&mut self, title: &str, active: bool) -> bool

Source

pub fn selectable_label( &mut self, title: String<'_>, align: Flags, value: &mut i32, ) -> bool

Source

pub fn selectable_text( &mut self, title: &str, align: Flags, value: &mut i32, ) -> bool

Source

pub fn selectable_image_label( &mut self, img: Image, title: String<'_>, align: Flags, value: &mut i32, ) -> bool

Source

pub fn selectable_image_text( &mut self, img: Image, title: &str, align: Flags, value: &mut i32, ) -> bool

Source

pub fn select_label( &mut self, title: String<'_>, align: Flags, value: i32, ) -> i32

Source

pub fn select_text(&mut self, title: &str, align: Flags, value: i32) -> i32

Source

pub fn select_image_label( &mut self, img: Image, title: String<'_>, align: Flags, value: i32, ) -> i32

Source

pub fn select_image_text( &mut self, img: Image, title: &str, align: Flags, value: i32, ) -> i32

Source

pub fn slide_float(&mut self, min: f32, val: f32, max: f32, step: f32) -> f32

Source

pub fn slide_int(&mut self, min: i32, val: i32, max: i32, step: i32) -> i32

Source

pub fn slider_float( &mut self, min: f32, val: &mut f32, max: f32, step: f32, ) -> bool

Source

pub fn slider_int( &mut self, min: i32, val: &mut i32, max: i32, step: i32, ) -> bool

Source

pub fn progress( &mut self, cur: &mut Size, max: Size, is_modifyable: bool, ) -> bool

Source

pub fn prog(&mut self, cur: Size, max: Size, is_modifyable: bool) -> usize

Source

pub fn color_picker(&mut self, color: ColorF, fmt: ColorFormat) -> ColorF

Source

pub fn color_pick(&mut self, fmt: ColorFormat) -> (bool, ColorF)

Source

pub fn property_int( &mut self, name: String<'_>, min: i32, val: &mut i32, max: i32, step: i32, inc_per_pixel: f32, )

Source

pub fn property_float( &mut self, name: String<'_>, min: f32, val: &mut f32, max: f32, step: f32, inc_per_pixel: f32, )

Source

pub fn property_double( &mut self, name: String<'_>, min: f64, val: &mut f64, max: f64, step: f64, inc_per_pixel: f32, )

Source

pub fn propertyi( &mut self, name: String<'_>, min: i32, val: i32, max: i32, step: i32, inc_per_pixel: f32, ) -> i32

Source

pub fn propertyf( &mut self, name: String<'_>, min: f32, val: f32, max: f32, step: f32, inc_per_pixel: f32, ) -> f32

Source

pub fn propertyd( &mut self, name: String<'_>, min: f64, val: f64, max: f64, step: f64, inc_per_pixel: f32, ) -> f64

Source

pub fn edit_string_custom_filter( &mut self, flags: Flags, buffer: &mut [u8], len: &mut i32, filter: fn(&TextEdit, char) -> bool, ) -> Flags

Source

pub fn edit_string( &mut self, flags: Flags, buffer: &mut [u8], len: &mut i32, filter: PluginFilter, ) -> Flags

Source

pub fn edit_buffer( &mut self, flags: Flags, editor: &mut TextEdit, filter: PluginFilter, ) -> Flags

Source

pub fn chart_begin( &mut self, ty: ChartType, num: i32, min: f32, max: f32, ) -> bool

Source

pub fn chart_begin_colored( &mut self, ty: ChartType, color: Color, active: Color, num: i32, min: f32, max: f32, ) -> bool

Source

pub fn chart_add_slot( &mut self, ty: ChartType, count: i32, min_value: f32, max_value: f32, )

Source

pub fn chart_add_slot_colored( &mut self, ty: ChartType, color: Color, active: Color, count: i32, min_value: f32, max_value: f32, )

Source

pub fn chart_push(&mut self, value: f32) -> Flags

Source

pub fn chart_push_slot(&mut self, value: f32, count: i32) -> Flags

Source

pub fn chart_end(&mut self)

Source

pub fn plot(&mut self, ty: ChartType, values: &[f32])

Source

pub fn popup_begin( &mut self, ty: PopupType, title: String<'_>, flags: Flags, bounds: Rect, ) -> bool

Source

pub fn popup_close(&mut self)

Source

pub fn popup_end(&mut self)

Source

pub fn combo( &mut self, items: &mut StringArray<'_>, selected: i32, item_height: i32, size: Vec2, ) -> i32

Source

pub fn combo_separator( &mut self, items_separated_by_separator: String<'_>, separator: char, selected: i32, item_height: i32, size: Vec2, ) -> i32

Source

pub fn combo_begin_label(&mut self, selected: String<'_>, size: Vec2) -> bool

Source

pub fn combo_begin_text(&mut self, selected: &str, size: Vec2) -> bool

Source

pub fn combo_begin_color(&mut self, color: Color, size: Vec2) -> bool

Source

pub fn combo_begin_symbol(&mut self, sym: SymbolType, size: Vec2) -> bool

Source

pub fn combo_begin_symbol_label( &mut self, label: String<'_>, sym: SymbolType, size: Vec2, ) -> bool

Source

pub fn combo_begin_symbol_text( &mut self, label: &str, sym: SymbolType, size: Vec2, ) -> bool

Source

pub fn combo_begin_image(&mut self, img: Image, size: Vec2) -> bool

Source

pub fn combo_begin_image_label( &mut self, label: String<'_>, img: Image, size: Vec2, ) -> bool

Source

pub fn combo_begin_image_text( &mut self, label: &str, img: Image, size: Vec2, ) -> bool

Source

pub fn combo_item_label(&mut self, label: String<'_>, alignment: Flags) -> bool

Source

pub fn combo_item_text(&mut self, label: &str, alignment: Flags) -> bool

Source

pub fn combo_item_image_label( &mut self, img: Image, label: String<'_>, alignment: Flags, ) -> bool

Source

pub fn combo_item_image_text( &mut self, img: Image, label: &str, alignment: Flags, ) -> bool

Source

pub fn combo_item_symbol_label( &mut self, sym: SymbolType, label: String<'_>, alignment: Flags, ) -> bool

Source

pub fn combo_item_symbol_text( &mut self, sym: SymbolType, label: &str, alignment: Flags, ) -> bool

Source

pub fn combo_close(&mut self)

Source

pub fn combo_end(&mut self)

Source

pub fn contextual_begin( &mut self, flags: Flags, bounds: Vec2, trigger_bounds: Rect, ) -> bool

Source

pub fn contextual_item_label(&mut self, label: String<'_>, align: Flags) -> bool

Source

pub fn contextual_item_text(&mut self, label: &str, align: Flags) -> bool

Source

pub fn contextual_item_image_label( &mut self, img: Image, label: String<'_>, align: Flags, ) -> bool

Source

pub fn contextual_item_image_text( &mut self, img: Image, label: &str, align: Flags, ) -> bool

Source

pub fn contextual_item_symbol_label( &mut self, sym: SymbolType, label: String<'_>, align: Flags, ) -> bool

Source

pub fn contextual_item_symbol_text( &mut self, sym: SymbolType, label: &str, align: Flags, ) -> bool

Source

pub fn contextual_close(&mut self)

Source

pub fn contextual_end(&mut self)

Source

pub fn tooltip(&mut self, text: String<'_>)

Source

pub fn tooltip_begin(&mut self, width: f32) -> bool

Source

pub fn tooltip_end(&mut self)

Source

pub fn menubar_begin(&mut self)

Source

pub fn menubar_end(&mut self)

Source

pub fn menu_begin_label( &mut self, title: String<'_>, align: Flags, size: Vec2, ) -> bool

Source

pub fn menu_begin_text(&mut self, title: &str, align: Flags, size: Vec2) -> bool

Source

pub fn menu_begin_image( &mut self, title: String<'_>, img: Image, size: Vec2, ) -> bool

Source

pub fn menu_begin_image_label( &mut self, title: String<'_>, align: Flags, img: Image, size: Vec2, ) -> bool

Source

pub fn menu_begin_image_text( &mut self, title: &str, align: Flags, img: Image, size: Vec2, ) -> bool

Source

pub fn menu_begin_symbol( &mut self, title: String<'_>, sym: SymbolType, size: Vec2, ) -> bool

Source

pub fn menu_begin_symbol_label( &mut self, title: String<'_>, align: Flags, sym: SymbolType, size: Vec2, ) -> bool

Source

pub fn menu_begin_symbol_text( &mut self, title: &str, align: Flags, sym: SymbolType, size: Vec2, ) -> bool

Source

pub fn menu_item_label(&mut self, title: String<'_>, align: Flags) -> bool

Source

pub fn menu_item_text(&mut self, title: &str, align: Flags) -> bool

Source

pub fn menu_item_image_label( &mut self, img: Image, title: String<'_>, align: Flags, ) -> bool

Source

pub fn menu_item_image_text( &mut self, img: Image, title: &str, align: Flags, ) -> bool

Source

pub fn menu_item_symbol_label( &mut self, sym: SymbolType, title: String<'_>, align: Flags, ) -> bool

Source

pub fn menu_item_symbol_text( &mut self, sym: SymbolType, title: &str, align: Flags, ) -> bool

Source

pub fn menu_close(&mut self)

Source

pub fn menu_end(&mut self)

Source

pub fn convert( &mut self, cmds: &mut Buffer, vertices: &mut Buffer, elements: &mut Buffer, config: &ConvertConfig, )

Source

pub fn input_begin(&mut self)

Source

pub fn input_motion(&mut self, x: i32, y: i32)

Source

pub fn input_key(&mut self, key: Key, down: bool)

Source

pub fn input_button(&mut self, b: Button, x: i32, y: i32, down: bool)

Source

pub fn input_scroll(&mut self, y: Vec2)

Source

pub fn input_char(&mut self, c: u8)

Source

pub fn input_glyph(&mut self, g: Glyph)

Source

pub fn input_unicode(&mut self, r: char)

Source

pub fn input_end(&mut self)

Source

pub fn style_default(&mut self)

Source

pub fn style_from_table(&mut self, table: &ColorMap)

Source

pub fn style_load_cursor(&mut self, cur: StyleCursor, res: &Cursor)

Source

pub fn style_load_all_cursors(&mut self, table: &mut CursorMap<'_>)

Source

pub fn style_set_font(&mut self, font: &UserFont)

Source

pub fn style_set_cursor(&mut self, cur: StyleCursor) -> bool

Source

pub fn style_show_cursor(&mut self)

Source

pub fn style_hide_cursor(&mut self)

Source

pub fn style_push_font(&mut self, font: &mut UserFont) -> bool

Source

pub fn style_push_float(&mut self, addr: &mut f32, val: f32) -> bool

Source

pub fn style_push_vec2(&mut self, addr: &mut Vec2, val: Vec2) -> bool

Source

pub fn style_push_style_item( &mut self, addr: &mut StyleItem, val: StyleItem, ) -> bool

Source

pub fn style_push_flags(&mut self, addr: &mut Flags, val: Flags) -> bool

Source

pub fn style_push_color(&mut self, addr: &mut Color, val: Color) -> bool

Source

pub fn style_pop_font(&mut self) -> bool

Source

pub fn style_pop_float(&mut self) -> bool

Source

pub fn style_pop_vec2(&mut self) -> bool

Source

pub fn style_pop_style_item(&mut self) -> bool

Source

pub fn style_pop_flags(&mut self) -> bool

Source

pub fn style_pop_color(&mut self) -> bool

Source

pub fn widget_bounds(&mut self) -> Rect

Source

pub fn widget_position(&mut self) -> Vec2

Source

pub fn widget_size(&mut self) -> Vec2

Source

pub fn widget_width(&mut self) -> f32

Source

pub fn widget_height(&mut self) -> f32

Source

pub fn widget_is_hovered(&mut self) -> bool

Source

pub fn widget_is_mouse_clicked(&mut self, b: Button) -> bool

Source

pub fn widget_has_mouse_click_down(&mut self, b: Button, down: bool) -> bool

Source

pub fn widget(&self, arg1: &mut Rect) -> WidgetLayoutState

Source

pub fn spacing(&mut self, cols: i32)

Source

pub fn draw_begin(&self, buf: &Buffer) -> Option<&DrawCommand>

Source

pub fn draw_next<'a>( &self, prev: &DrawCommand, buf: &Buffer, ) -> Option<&'a DrawCommand>

Source

pub fn next_cmd<'a, 'b>(&self, arg2: &'b Command) -> Option<&'a Command>

Source

pub fn begin_cmd(&self) -> Option<&Command>

Source

pub fn draw_command_iterator<'a>( &'a mut self, buf: &'a Buffer, ) -> DrawCommandIterator<'a>

Source

pub fn command_iterator(&mut self) -> CommandIterator<'_>

Trait Implementations§

Source§

impl Default for Context

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for Context

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.