#[repr(C)]pub struct Context {Show 35 fields
pub char_width: Option<fn(_: FontId, _: char) -> usize>,
pub font_height: Option<fn(_: FontId) -> usize>,
pub draw_frame: Option<fn(_: &mut Context, _: Rect, _: ControlColor)>,
pub style: Style,
pub hover: Option<Id>,
pub focus: Option<Id>,
pub last_id: Option<Id>,
pub last_rect: Rect,
pub last_zindex: i32,
pub updated_focus: bool,
pub frame: usize,
pub hover_root: Option<usize>,
pub next_hover_root: Option<usize>,
pub scroll_target: Option<usize>,
pub number_edit_buf: FixedString<127>,
pub number_edit: Option<Id>,
pub command_list: FixedVec<Command, 4096>,
pub root_list: FixedVec<usize, 32>,
pub container_stack: FixedVec<usize, 32>,
pub clip_stack: FixedVec<Rect, 32>,
pub id_stack: FixedVec<Id, 32>,
pub layout_stack: FixedVec<Layout, 16>,
pub text_stack: FixedString<65536>,
pub container_pool: Pool<48>,
pub containers: [Container; 48],
pub treenode_pool: Pool<48>,
pub mouse_pos: Vec2i,
pub last_mouse_pos: Vec2i,
pub mouse_delta: Vec2i,
pub scroll_delta: Vec2i,
pub mouse_down: MouseButton,
pub mouse_pressed: MouseButton,
pub key_down: KeyMode,
pub key_pressed: KeyMode,
pub input_text: FixedString<32>,
}
Fields§
§char_width: Option<fn(_: FontId, _: char) -> usize>
§font_height: Option<fn(_: FontId) -> usize>
§draw_frame: Option<fn(_: &mut Context, _: Rect, _: ControlColor)>
§style: Style
§hover: Option<Id>
§focus: Option<Id>
§last_id: Option<Id>
§last_rect: Rect
§last_zindex: i32
§updated_focus: bool
§frame: usize
§hover_root: Option<usize>
§next_hover_root: Option<usize>
§scroll_target: Option<usize>
§number_edit_buf: FixedString<127>
§number_edit: Option<Id>
§command_list: FixedVec<Command, 4096>
§root_list: FixedVec<usize, 32>
§container_stack: FixedVec<usize, 32>
§clip_stack: FixedVec<Rect, 32>
§id_stack: FixedVec<Id, 32>
§layout_stack: FixedVec<Layout, 16>
§text_stack: FixedString<65536>
§container_pool: Pool<48>
§containers: [Container; 48]
§treenode_pool: Pool<48>
§mouse_pos: Vec2i
§last_mouse_pos: Vec2i
§mouse_delta: Vec2i
§scroll_delta: Vec2i
§mouse_down: MouseButton
§mouse_pressed: MouseButton
§key_down: KeyMode
§key_pressed: KeyMode
§input_text: FixedString<32>
Implementations§
source§impl Context
impl Context
pub fn new() -> Self
pub fn begin(&mut self)
pub fn end(&mut self)
pub fn set_focus(&mut self, id: Option<Id>)
pub fn get_id_u32(&mut self, orig_id: u32) -> Id
pub fn get_id_from_ptr<T: ?Sized>(&mut self, orig_id: &T) -> Id
pub fn get_id_from_str(&mut self, s: &str) -> Id
pub fn push_id_from_ptr<T>(&mut self, orig_id: &T)
pub fn push_id_from_str(&mut self, s: &str)
pub fn pop_id(&mut self)
pub fn push_clip_rect(&mut self, rect: Rect)
pub fn pop_clip_rect(&mut self)
pub fn get_clip_rect(&mut self) -> Rect
pub fn check_clip(&mut self, r: Rect) -> Clip
pub fn get_current_container(&self) -> usize
pub fn get_current_container_rect(&self) -> Rect
pub fn set_current_container_rect(&mut self, rect: &Rect)
pub fn get_current_container_scroll(&self) -> Vec2i
pub fn set_current_container_scroll(&mut self, scroll: &Vec2i)
pub fn get_current_container_content_size(&self) -> Vec2i
pub fn get_current_container_body(&self) -> Rect
pub fn bring_to_front(&mut self, cnt: usize)
pub fn input_mousemove(&mut self, x: i32, y: i32)
pub fn input_mousedown(&mut self, x: i32, y: i32, btn: MouseButton)
pub fn input_mouseup(&mut self, x: i32, y: i32, btn: MouseButton)
pub fn input_scroll(&mut self, x: i32, y: i32)
pub fn input_keydown(&mut self, key: KeyMode)
pub fn input_keyup(&mut self, key: KeyMode)
pub fn input_text(&mut self, text: &str)
pub fn push_command(&mut self, cmd: Command) -> (&mut Command, usize)
pub fn push_text(&mut self, str: &str) -> usize
sourcepub fn mu_next_command(&mut self, cmd_id: usize) -> Option<(Command, usize)>
pub fn mu_next_command(&mut self, cmd_id: usize) -> Option<(Command, usize)>
returns the next command to execute and the next index to use
pub fn set_clip(&mut self, rect: Rect)
pub fn draw_rect(&mut self, rect: Rect, color: Color)
pub fn draw_box(&mut self, r: Rect, color: Color)
pub fn draw_text(&mut self, font: FontId, str: &str, pos: Vec2i, color: Color)
pub fn draw_icon(&mut self, id: Icon, rect: Rect, color: Color)
pub fn layout_begin_column(&mut self)
pub fn layout_end_column(&mut self)
pub fn layout_row_for_layout(layout: &mut Layout, widths: &[i32], height: i32)
pub fn layout_row(&mut self, widths: &[i32], height: i32)
pub fn layout_width(&mut self, width: i32)
pub fn layout_height(&mut self, height: i32)
pub fn layout_set_next(&mut self, r: Rect, position: LayoutPosition)
pub fn layout_next(&mut self) -> Rect
pub fn draw_control_frame( &mut self, id: Id, rect: Rect, colorid: ControlColor, opt: WidgetOption )
pub fn draw_control_text( &mut self, str: &str, rect: Rect, colorid: ControlColor, opt: WidgetOption )
pub fn mouse_over(&mut self, rect: Rect) -> bool
pub fn update_control(&mut self, id: Id, rect: Rect, opt: WidgetOption)
pub fn get_text_width(&self, font: FontId, text: &str) -> i32
pub fn get_text_height(&self, font: FontId, text: &str) -> i32
pub fn text(&mut self, text: &str)
pub fn label(&mut self, text: &str)
pub fn checkbox(&mut self, label: &str, state: &mut bool) -> ResourceState
pub fn textbox_raw( &mut self, buf: &mut dyn IString, id: Id, r: Rect, opt: WidgetOption ) -> ResourceState
pub fn textbox_ex( &mut self, buf: &mut dyn IString, opt: WidgetOption ) -> ResourceState
pub fn slider_ex( &mut self, value: &mut Real, low: Real, high: Real, step: Real, precision: usize, opt: WidgetOption ) -> ResourceState
pub fn number_ex( &mut self, value: &mut Real, step: Real, precision: usize, opt: WidgetOption ) -> ResourceState
pub fn header_ex(&mut self, label: &str, opt: WidgetOption) -> ResourceState
pub fn begin_treenode_ex( &mut self, label: &str, opt: WidgetOption ) -> ResourceState
pub fn end_treenode(&mut self)
pub fn begin_window_ex( &mut self, title: &str, r: Rect, opt: WidgetOption ) -> ResourceState
pub fn end_window(&mut self)
pub fn open_popup(&mut self, name: &str)
pub fn begin_popup(&mut self, name: &str) -> ResourceState
pub fn end_popup(&mut self)
pub fn begin_panel_ex(&mut self, name: &str, opt: WidgetOption)
pub fn end_panel(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more