Struct fltk::text::TextEditor [−][src]
pub struct TextEditor { /* fields omitted */ }
Expand description
Creates an editable text display widget
Implementations
impl TextEditor
[src]
impl TextEditor
[src]pub fn set_insert_mode(&mut self, b: bool)
[src]
pub fn set_insert_mode(&mut self, b: bool)
[src]Set to insert mode
pub fn insert_mode(&self) -> bool
[src]
pub fn insert_mode(&self) -> bool
[src]Returns whether insert mode is set
pub fn set_tab_nav(&mut self, val: bool)
[src]
pub fn set_tab_nav(&mut self, val: bool)
[src]Set tab navigation
pub fn kf_default(&mut self, c: Key)
[src]
pub fn kf_default(&mut self, c: Key)
[src]Inserts the text associated with key ‘c’
pub fn kf_backspace(&mut self)
[src]
pub fn kf_backspace(&mut self)
[src]Does a backspace
pub fn kf_shift_move(&mut self, c: Key)
[src]
pub fn kf_shift_move(&mut self, c: Key)
[src]Extends the current selection in the direction of key ‘c’
pub fn kf_ctrl_move(&mut self, c: Key)
[src]
pub fn kf_ctrl_move(&mut self, c: Key)
[src]Moves the current text cursor in the direction indicated by control key ‘c’
pub fn kf_c_s_move(&mut self, c: Key)
[src]
pub fn kf_c_s_move(&mut self, c: Key)
[src]Extends the current selection in the direction indicated by control key ‘c’
pub fn kf_meta_move(&mut self, c: Key)
[src]
pub fn kf_meta_move(&mut self, c: Key)
[src]Moves the current text cursor in the direction indicated by meta key ‘c’
pub fn kf_m_s_move(&mut self, c: Key)
[src]
pub fn kf_m_s_move(&mut self, c: Key)
[src]Extends the current selection in the direction indicated by meta key ‘c’
pub fn kf_page_up(&mut self)
[src]
pub fn kf_page_up(&mut self)
[src]Moves the text cursor up one page
pub fn kf_page_down(&mut self)
[src]
pub fn kf_page_down(&mut self)
[src]Moves the text cursor down one page
pub fn kf_delete(&mut self)
[src]
pub fn kf_delete(&mut self)
[src]Does a delete of selected text or the current character in the current buffer
pub fn kf_select_all(&mut self)
[src]
pub fn kf_select_all(&mut self)
[src]Selects all text in the associated buffer
Trait Implementations
impl Clone for TextEditor
[src]
impl Clone for TextEditor
[src]fn clone(&self) -> TextEditor
[src]
fn clone(&self) -> TextEditor
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for TextEditor
[src]
impl Debug for TextEditor
[src]impl Default for TextEditor
[src]
impl Default for TextEditor
[src]impl DisplayExt for TextEditor
[src]
impl DisplayExt for TextEditor
[src]fn buffer(&self) -> Option<TextBuffer>
[src]
fn buffer(&self) -> Option<TextBuffer>
[src]Get the associated TextBuffer
fn set_buffer<B: Into<Option<TextBuffer>>>(&mut self, buffer: B)
[src]
fn set_buffer<B: Into<Option<TextBuffer>>>(&mut self, buffer: B)
[src]Sets the associated TextBuffer
fn style_buffer(&self) -> Option<TextBuffer>
[src]
fn style_buffer(&self) -> Option<TextBuffer>
[src]Get the associated style TextBuffer
fn set_text_font(&mut self, font: Font)
[src]
fn set_text_font(&mut self, font: Font)
[src]Sets the text font
fn text_color(&self) -> Color
[src]
fn text_color(&self) -> Color
[src]Return the text color
fn set_text_color(&mut self, color: Color)
[src]
fn set_text_color(&mut self, color: Color)
[src]Sets the text color
fn set_text_size(&mut self, sz: i32)
[src]
fn set_text_size(&mut self, sz: i32)
[src]Sets the text size
fn set_insert_position(&mut self, newPos: i32)
[src]
fn set_insert_position(&mut self, newPos: i32)
[src]Set the insert position
fn insert_position(&self) -> i32
[src]
fn insert_position(&self) -> i32
[src]Return the insert position
fn count_lines(&self, start: i32, end: i32, is_line_start: bool) -> i32
[src]
fn count_lines(&self, start: i32, end: i32, is_line_start: bool) -> i32
[src]Counts the lines from start to end
fn show_cursor(&mut self, val: bool)
[src]
fn show_cursor(&mut self, val: bool)
[src]Shows/hides the cursor
fn set_highlight_data<B: Into<Option<TextBuffer>>>(
&mut self,
style_buffer: B,
entries: Vec<StyleTableEntry>
)
[src]
fn set_highlight_data<B: Into<Option<TextBuffer>>>(
&mut self,
style_buffer: B,
entries: Vec<StyleTableEntry>
)
[src]Sets the style of the text widget
fn set_cursor_style(&mut self, style: Cursor)
[src]
fn set_cursor_style(&mut self, style: Cursor)
[src]Sets the cursor style
fn set_cursor_color(&mut self, color: Color)
[src]
fn set_cursor_color(&mut self, color: Color)
[src]Sets the cursor color
fn set_scrollbar_size(&mut self, size: i32)
[src]
fn set_scrollbar_size(&mut self, size: i32)
[src]Sets the scrollbar size in pixels
fn set_scrollbar_align(&mut self, align: Align)
[src]
fn set_scrollbar_align(&mut self, align: Align)
[src]Sets the scrollbar alignment
fn cursor_style(&self) -> Cursor
[src]
fn cursor_style(&self) -> Cursor
[src]Returns the cursor style
fn cursor_color(&self) -> Color
[src]
fn cursor_color(&self) -> Color
[src]Returns the cursor color
fn scrollbar_size(&self) -> i32
[src]
fn scrollbar_size(&self) -> i32
[src]Returns the scrollbar size in pixels
fn scrollbar_align(&self) -> Align
[src]
fn scrollbar_align(&self) -> Align
[src]Returns the scrollbar alignment
fn line_start(&self, pos: i32) -> i32
[src]
fn line_start(&self, pos: i32) -> i32
[src]Returns the beginning of the line from the current position. Returns new position as index Read more
fn line_end(&self, start_pos: i32, is_line_start: bool) -> i32
[src]
fn line_end(&self, start_pos: i32, is_line_start: bool) -> i32
[src]Returns the ending of the line from the current position. Returns new position as index Read more
fn skip_lines(&mut self, start_pos: i32, lines: i32, is_line_start: bool) -> i32
[src]
fn skip_lines(&mut self, start_pos: i32, lines: i32, is_line_start: bool) -> i32
[src]Skips lines from start_pos
fn rewind_lines(&mut self, start_pos: i32, lines: i32) -> i32
[src]
fn rewind_lines(&mut self, start_pos: i32, lines: i32) -> i32
[src]Rewinds the lines
fn previous_word(&mut self)
[src]
fn previous_word(&mut self)
[src]Goes to the previous word
fn word_start(&self, pos: i32) -> i32
[src]
fn word_start(&self, pos: i32) -> i32
[src]Returns the position of the start of the word, relative to the current position
fn word_end(&self, pos: i32) -> i32
[src]
fn word_end(&self, pos: i32) -> i32
[src]Returns the position of the end of the word, relative to the current position
fn set_linenumber_width(&mut self, w: i32)
[src]
fn set_linenumber_width(&mut self, w: i32)
[src]Sets the linenumber width
fn linenumber_width(&self) -> i32
[src]
fn linenumber_width(&self) -> i32
[src]Gets the linenumber width
fn set_linenumber_font(&mut self, font: Font)
[src]
fn set_linenumber_font(&mut self, font: Font)
[src]Sets the linenumber font
fn linenumber_font(&self) -> Font
[src]
fn linenumber_font(&self) -> Font
[src]Gets the linenumber font
fn set_linenumber_size(&mut self, size: i32)
[src]
fn set_linenumber_size(&mut self, size: i32)
[src]Sets the linenumber size
fn linenumber_size(&self) -> i32
[src]
fn linenumber_size(&self) -> i32
[src]Gets the linenumber size
fn set_linenumber_fgcolor(&mut self, color: Color)
[src]
fn set_linenumber_fgcolor(&mut self, color: Color)
[src]Sets the linenumber foreground color
fn linenumber_fgcolor(&self) -> Color
[src]
fn linenumber_fgcolor(&self) -> Color
[src]Gets the linenumber foreground color
fn set_linenumber_bgcolor(&mut self, color: Color)
[src]
fn set_linenumber_bgcolor(&mut self, color: Color)
[src]Sets the linenumber background color
fn linenumber_bgcolor(&self) -> Color
[src]
fn linenumber_bgcolor(&self) -> Color
[src]Gets the linenumber background color
fn set_linenumber_align(&mut self, align: Align)
[src]
fn set_linenumber_align(&mut self, align: Align)
[src]Sets the linenumber alignment
fn linenumber_align(&self) -> Align
[src]
fn linenumber_align(&self) -> Align
[src]Gets the linenumber alignment
fn in_selection(&self, x: i32, y: i32) -> bool
[src]
fn in_selection(&self, x: i32, y: i32) -> bool
[src]Checks whether a pixel is within a text selection
fn wrapped_column(&self, row: i32, column: i32) -> i32
[src]
fn wrapped_column(&self, row: i32, column: i32) -> i32
[src]Correct a column number based on an unconstrained position
fn wrapped_row(&self, row: i32) -> i32
[src]
fn wrapped_row(&self, row: i32) -> i32
[src]Correct a row number from an unconstrained position
impl WidgetBase for TextEditor
[src]
impl WidgetBase for TextEditor
[src]fn new<T: Into<Option<&'static str>>>(
x: i32,
y: i32,
width: i32,
height: i32,
title: T
) -> TextEditor
[src]
fn new<T: Into<Option<&'static str>>>(
x: i32,
y: i32,
width: i32,
height: i32,
title: T
) -> TextEditor
[src]Creates a new widget, takes an x, y coordinates, as well as a width and height, plus a title Read more
unsafe fn from_widget_ptr(ptr: *mut Fl_Widget) -> Self
[src]
unsafe fn from_widget_ptr(ptr: *mut Fl_Widget) -> Self
[src]transforms a widget pointer to a Widget, for internal use Read more
unsafe fn from_widget<W: WidgetExt>(w: W) -> Self
[src]
unsafe fn from_widget<W: WidgetExt>(w: W) -> Self
[src]Get a widget from base widget Read more
fn handle<F: FnMut(&mut Self, Event) -> bool + 'static>(&mut self, cb: F)
[src]
fn handle<F: FnMut(&mut Self, Event) -> bool + 'static>(&mut self, cb: F)
[src]Set a custom handler, where events are managed manually, akin to Fl_Widget::handle(int)
.
Handled or ignored events should return true, unhandled events should return false.
takes the widget as a closure argument Read more
fn draw<F: FnMut(&mut Self) + 'static>(&mut self, cb: F)
[src]
fn draw<F: FnMut(&mut Self) + 'static>(&mut self, cb: F)
[src]Set a custom draw method.
takes the widget as a closure argument.
macOS requires that WidgetBase::draw
actually calls drawing functions Read more
impl WidgetExt for TextEditor
[src]
impl WidgetExt for TextEditor
[src]fn set_label(&mut self, title: &str)
[src]
fn set_label(&mut self, title: &str)
[src]Sets the widget’s label.
labels support special symbols preceded by an @
sign.
and for the associated formatting. Read more
unsafe fn as_widget_ptr(&self) -> *mut Fl_Widget
[src]
unsafe fn as_widget_ptr(&self) -> *mut Fl_Widget
[src]transforms a widget to a base Fl_Widget
, for internal use Read more
fn deactivate(&mut self)
[src]
fn deactivate(&mut self)
[src]Deactivates the widget
fn redraw_label(&mut self)
[src]
fn redraw_label(&mut self)
[src]Redraws the label of the widget
fn resize(&mut self, x: i32, y: i32, width: i32, height: i32)
[src]
fn resize(&mut self, x: i32, y: i32, width: i32, height: i32)
[src]Resizes and/or moves the widget, takes x, y, width and height
fn set_tooltip(&mut self, txt: &str)
[src]
fn set_tooltip(&mut self, txt: &str)
[src]Sets the tooltip text
fn label_color(&self) -> Color
[src]
fn label_color(&self) -> Color
[src]Returns the widget label’s color
fn set_label_color(&mut self, color: Color)
[src]
fn set_label_color(&mut self, color: Color)
[src]Sets the widget label’s color
fn label_font(&self) -> Font
[src]
fn label_font(&self) -> Font
[src]Returns the widget label’s font
fn set_label_font(&mut self, font: Font)
[src]
fn set_label_font(&mut self, font: Font)
[src]Sets the widget label’s font
fn label_size(&self) -> i32
[src]
fn label_size(&self) -> i32
[src]Returns the widget label’s size
fn set_label_size(&mut self, sz: i32)
[src]
fn set_label_size(&mut self, sz: i32)
[src]Sets the widget label’s size
fn label_type(&self) -> LabelType
[src]
fn label_type(&self) -> LabelType
[src]Returns the widget label’s type
fn set_label_type(&mut self, typ: LabelType)
[src]
fn set_label_type(&mut self, typ: LabelType)
[src]Sets the widget label’s type
fn set_changed(&mut self)
[src]
fn set_changed(&mut self)
[src]Mark the widget as changed
fn clear_changed(&mut self)
[src]
fn clear_changed(&mut self)
[src]Clears the changed status of the widget
fn set_trigger(&mut self, trigger: CallbackTrigger)
[src]
fn set_trigger(&mut self, trigger: CallbackTrigger)
[src]Sets the default callback trigger for a widget
fn trigger(&self) -> CallbackTrigger
[src]
fn trigger(&self) -> CallbackTrigger
[src]Return the callback trigger
fn selection_color(&mut self) -> Color
[src]
fn selection_color(&mut self) -> Color
[src]Gets the selection color of the widget
fn set_selection_color(&mut self, color: Color)
[src]
fn set_selection_color(&mut self, color: Color)
[src]Sets the selection color of the widget
fn do_callback(&mut self)
[src]
fn do_callback(&mut self)
[src]Runs the already registered callback
fn top_window(&self) -> Option<Box<dyn WindowExt>>
[src]
fn top_window(&self) -> Option<Box<dyn WindowExt>>
[src]Returns the topmost window holding the widget
fn takes_events(&self) -> bool
[src]
fn takes_events(&self) -> bool
[src]Checks whether a widget is capable of taking events
unsafe fn user_data(&self) -> Option<Box<dyn FnMut()>>
[src]
unsafe fn user_data(&self) -> Option<Box<dyn FnMut()>>
[src]INTERNAL: Retakes ownership of the user callback data Read more
fn set_visible_focus(&mut self)
[src]
fn set_visible_focus(&mut self)
[src]Set the widget to have visible focus
fn clear_visible_focus(&mut self)
[src]
fn clear_visible_focus(&mut self)
[src]Clear visible focus
fn visible_focus(&mut self, v: bool)
[src]
fn visible_focus(&mut self, v: bool)
[src]Set the visible focus using a flag
fn has_visible_focus(&mut self) -> bool
[src]
fn has_visible_focus(&mut self) -> bool
[src]Return whether the widget has visible focus
fn was_deleted(&self) -> bool
[src]
fn was_deleted(&self) -> bool
[src]Check if a widget was deleted
fn set_damage(&mut self, flag: bool)
[src]
fn set_damage(&mut self, flag: bool)
[src]Signal the widget as damaged and it should be redrawn in the next event loop cycle
fn damage_type(&self) -> Damage
[src]
fn damage_type(&self) -> Damage
[src]Return the damage mask
fn set_damage_type(&mut self, mask: Damage)
[src]
fn set_damage_type(&mut self, mask: Damage)
[src]Signal the type of damage a widget received
fn clear_damage(&mut self)
[src]
fn clear_damage(&mut self)
[src]Clear the damaged flag
fn as_window(&self) -> Option<Box<dyn WindowExt>>
[src]
fn as_window(&self) -> Option<Box<dyn WindowExt>>
[src]Return the widget as a window if it’s a window
fn as_group(&self) -> Option<Box<dyn GroupExt>>
[src]
fn as_group(&self) -> Option<Box<dyn GroupExt>>
[src]Return the widget as a group widget if it’s a group widget
fn below_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self
[src]
fn below_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self
[src]Positions the widget below w, the size of w should be known
fn above_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self
[src]
fn above_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self
[src]Positions the widget above w, the size of w should be known
fn right_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self
[src]
fn right_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self
[src]Positions the widget to the right of w, the size of w should be known
fn left_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self
[src]
fn left_of<W: WidgetExt>(self, w: &W, padding: i32) -> Self
[src]Positions the widget to the left of w, the size of w should be known
fn center_of<W: WidgetExt>(self, w: &W) -> Self
[src]
fn center_of<W: WidgetExt>(self, w: &W) -> Self
[src]Positions the widget to the center of w, the size of w should be known
fn center_of_parent(self) -> Self
[src]
fn center_of_parent(self) -> Self
[src]Positions the widget to the center of its parent
fn size_of<W: WidgetExt>(self, w: &W) -> Self
[src]
fn size_of<W: WidgetExt>(self, w: &W) -> Self
[src]Takes the size of w, the size of w should be known
fn size_of_parent(self) -> Self
[src]
fn size_of_parent(self) -> Self
[src]Takes the size of the parent group or window
fn inside<W: WidgetExt>(&self, wid: &W) -> bool
[src]
fn inside<W: WidgetExt>(&self, wid: &W) -> bool
[src]Checks whether the self widget is inside another widget
fn with_pos(self, x: i32, y: i32) -> Self
[src]
fn with_pos(self, x: i32, y: i32) -> Self
[src]Initialize to position x, y, (should only be called on initialization)
fn with_size(self, width: i32, height: i32) -> Self
[src]
fn with_size(self, width: i32, height: i32) -> Self
[src]Initialilze to dimensions width and height, (should only be called on initialization)
fn with_label(self, title: &str) -> Self
[src]
fn with_label(self, title: &str) -> Self
[src]Initialize with label/title, (should only be called on initialization)
fn with_align(self, align: Align) -> Self
[src]
fn with_align(self, align: Align) -> Self
[src]Sets the initial alignment of the widget, (should only be called on initialization)
fn get_type<T: WidgetType>(&self) -> T
[src]
fn get_type<T: WidgetType>(&self) -> T
[src]Returns the widget type when applicable
fn set_type<T: WidgetType>(&mut self, typ: T)
[src]
fn set_type<T: WidgetType>(&mut self, typ: T)
[src]Sets the widget type
fn set_deimage<I: ImageExt>(&mut self, image: Option<I>)
[src]
fn set_deimage<I: ImageExt>(&mut self, image: Option<I>)
[src]Sets the image of the widget
fn set_callback<F: FnMut(&mut Self) + 'static>(&mut self, cb: F)
[src]
fn set_callback<F: FnMut(&mut Self) + 'static>(&mut self, cb: F)
[src]Sets the callback when the widget is triggered (clicks for example) takes the widget as a closure argument Read more
fn emit<T: 'static + Clone + Send + Sync>(&mut self, sender: Sender<T>, msg: T)
[src]
fn emit<T: 'static + Clone + Send + Sync>(&mut self, sender: Sender<T>, msg: T)
[src]Emits a message on callback using a sender
unsafe fn into_widget<W: WidgetBase>(&self) -> W where
Self: Sized,
[src]
unsafe fn into_widget<W: WidgetBase>(&self) -> W where
Self: Sized,
[src]Upcast a WidgetExt
to a Widget Read more
impl Send for TextEditor
[src]
impl Sync for TextEditor
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more