pub struct CodeEditor {
pub font_size: f32,
pub cursor_pos: (usize, usize),
pub cursor_rect: (usize, usize, usize, usize),
pub mode: CodeEditorMode,
pub theme: Theme,
pub settings: Settings,
pub drag_pos: Option<(usize, usize)>,
/* private fields */
}Fields§
§font_size: f32§cursor_pos: (usize, usize)§cursor_rect: (usize, usize, usize, usize)§mode: CodeEditorMode§theme: Theme§settings: Settings§drag_pos: Option<(usize, usize)>Implementations§
Source§impl CodeEditor
impl CodeEditor
pub fn new() -> Selfwhere
Self: Sized,
Sourcepub fn set_font_data(&mut self, font: Font)
pub fn set_font_data(&mut self, font: Font)
Sets the font directly
Sourcepub fn set_font_size(&mut self, font_size: f32)
pub fn set_font_size(&mut self, font_size: f32)
Sets the font size
pub fn set_theme(&mut self, theme: Theme)
pub fn set_error(&mut self, error: Option<(String, Option<usize>)>)
Sourcepub fn set_mode(&mut self, mode: CodeEditorMode)
pub fn set_mode(&mut self, mode: CodeEditorMode)
Sets the mode of the editor
pub fn draw( &mut self, frame: &mut [u8], rect: (usize, usize, usize, usize), stride: usize, )
Sourcepub fn set_cursor(&mut self, pos: (usize, usize))
pub fn set_cursor(&mut self, pos: (usize, usize))
Sets the cursor to the given position
pub fn key_down(&mut self, char: Option<char>, key: Option<WidgetKey>) -> bool
pub fn mouse_down(&mut self, p: (usize, usize)) -> bool
pub fn mouse_up(&mut self, _pos: (usize, usize)) -> bool
pub fn mouse_dragged(&mut self, pos: (usize, usize)) -> bool
pub fn mouse_hover(&mut self, _pos: (usize, usize)) -> bool
pub fn mouse_wheel(&mut self, delta: (isize, isize)) -> bool
Sourcepub fn offset_sanity_check(&mut self)
pub fn offset_sanity_check(&mut self)
Makes sure that the offset is within a reasonable range.
pub fn modifier_changed( &mut self, shift: bool, ctrl: bool, alt: bool, logo: bool, ) -> bool
Auto Trait Implementations§
impl Freeze for CodeEditor
impl RefUnwindSafe for CodeEditor
impl Send for CodeEditor
impl Sync for CodeEditor
impl Unpin for CodeEditor
impl UnwindSafe for CodeEditor
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