pub unsafe trait DisplayExt: WidgetExt {
Show 77 methods
// Required methods
fn buffer(&self) -> Option<TextBuffer>;
fn set_buffer<B: Into<Option<TextBuffer>>>(&mut self, buffer: B);
fn style_buffer(&self) -> Option<TextBuffer>;
fn text_font(&self) -> Font;
fn set_text_font(&mut self, font: Font);
fn text_color(&self) -> Color;
fn set_text_color(&mut self, color: Color);
fn text_size(&self) -> i32;
fn set_text_size(&mut self, sz: i32);
fn scroll(&mut self, top_line_num: i32, horiz_offset: i32);
fn insert(&self, text: &str);
fn set_insert_position(&mut self, new_pos: i32);
fn insert_position(&self) -> i32;
fn position_to_xy(&self, pos: i32) -> (i32, i32);
fn count_lines(&self, start: i32, end: i32, is_line_start: bool) -> i32;
fn move_right(&mut self) -> Result<(), FltkError>;
fn move_left(&mut self) -> Result<(), FltkError>;
fn move_up(&mut self) -> Result<(), FltkError>;
fn move_down(&mut self) -> Result<(), FltkError>;
fn show_cursor(&mut self, val: bool);
fn set_highlight_data<B: Into<Option<TextBuffer>>, E: Into<Vec<StyleTableEntry>>>(
&mut self,
style_buffer: B,
entries: E,
);
fn unset_highlight_data<B: Into<Option<TextBuffer>>>(
&mut self,
style_buffer: B,
);
fn set_cursor_style(&mut self, style: Cursor);
fn set_cursor_color(&mut self, color: Color);
fn set_scrollbar_size(&mut self, size: i32);
fn set_scrollbar_align(&mut self, align: Align);
fn cursor_style(&self) -> Cursor;
fn cursor_color(&self) -> Color;
fn scrollbar_size(&self) -> i32;
fn scrollbar_align(&self) -> Align;
fn line_start(&self, pos: i32) -> i32;
fn line_end(&self, start_pos: i32, is_line_start: bool) -> i32;
fn skip_lines(
&mut self,
start_pos: i32,
lines: i32,
is_line_start: bool,
) -> i32;
fn rewind_lines(&mut self, start_pos: i32, lines: i32) -> i32;
fn next_word(&mut self);
fn previous_word(&mut self);
fn word_start(&self, pos: i32) -> i32;
fn word_end(&self, pos: i32) -> i32;
fn x_to_col(&self, x: f64) -> f64;
fn col_to_x(&self, col: f64) -> f64;
fn set_linenumber_width(&mut self, w: i32);
fn linenumber_width(&self) -> i32;
fn set_linenumber_font(&mut self, font: Font);
fn linenumber_font(&self) -> Font;
fn set_linenumber_size(&mut self, size: i32);
fn linenumber_size(&self) -> i32;
fn set_linenumber_fgcolor(&mut self, color: Color);
fn linenumber_fgcolor(&self) -> Color;
fn set_linenumber_bgcolor(&mut self, color: Color);
fn linenumber_bgcolor(&self) -> Color;
fn set_linenumber_align(&mut self, align: Align);
fn linenumber_align(&self) -> Align;
fn set_linenumber_format(&mut self, fmt: &str);
fn linenumber_format(&self) -> Option<String>;
fn position_style(
&self,
line_start_pos: i32,
line_len: i32,
line_index: i32,
) -> i32;
fn maintain_absolute_top_line_number(&mut self, state: bool);
fn get_absolute_top_line_number(&self) -> i32;
fn absolute_top_line_number(&mut self, old_first_char: i32);
fn maintaining_absolute_top_line_number(&self) -> bool;
fn reset_absolute_top_line_number(&mut self);
fn in_selection(&self, x: i32, y: i32) -> bool;
fn wrap_mode(&mut self, wrap: WrapMode, wrap_margin: i32);
fn wrapped_column(&self, row: i32, column: i32) -> i32;
fn wrapped_row(&self, row: i32) -> i32;
fn set_grammar_underline_color(&mut self, color: Color);
fn grammar_underline_color(&self) -> Color;
fn set_spelling_underline_color(&mut self, color: Color);
fn spelling_underline_color(&self) -> Color;
fn set_secondary_selection_color(&mut self, color: Color);
fn secondary_selection_color(&self) -> Color;
fn show_insert_position(&mut self);
fn overstrike(&mut self, text: &str);
fn redisplay_range(&mut self, start: i32, end: i32);
fn xy_to_position(&self, x: i32, y: i32, pos_type: PositionType) -> i32;
fn xy_to_rowcol(&self, x: i32, y: i32, pos_type: PositionType) -> (i32, i32);
fn scroll_row(&self) -> i32;
fn scroll_col(&self) -> i32;
}Expand description
Defines the methods implemented by TextDisplay and TextEditor
More details can be found in the wiki.
§Safety
fltk-rs traits depend on some FLTK internal code
§Warning
fltk-rs traits are non-exhaustive,
to avoid future breakage if you try to implement them manually,
use the Deref and DerefMut pattern or the widget_extends! macro
Required Methods§
Sourcefn buffer(&self) -> Option<TextBuffer>
fn buffer(&self) -> Option<TextBuffer>
Get the associated TextBuffer
Sourcefn set_buffer<B: Into<Option<TextBuffer>>>(&mut self, buffer: B)
fn set_buffer<B: Into<Option<TextBuffer>>>(&mut self, buffer: B)
Sets the associated TextBuffer.
Since the widget is long-lived, the lifetime of the buffer is prolonged to the lifetime of the program
Sourcefn style_buffer(&self) -> Option<TextBuffer>
fn style_buffer(&self) -> Option<TextBuffer>
Get the associated style TextBuffer
Sourcefn set_text_font(&mut self, font: Font)
fn set_text_font(&mut self, font: Font)
Sets the text font
Sourcefn text_color(&self) -> Color
fn text_color(&self) -> Color
Return the text color
Sourcefn set_text_color(&mut self, color: Color)
fn set_text_color(&mut self, color: Color)
Sets the text color
Sourcefn set_text_size(&mut self, sz: i32)
fn set_text_size(&mut self, sz: i32)
Sets the text size
Sourcefn set_insert_position(&mut self, new_pos: i32)
fn set_insert_position(&mut self, new_pos: i32)
Set the insert position
Sourcefn insert_position(&self) -> i32
fn insert_position(&self) -> i32
Return the insert position
Sourcefn position_to_xy(&self, pos: i32) -> (i32, i32)
fn position_to_xy(&self, pos: i32) -> (i32, i32)
Gets the x and y positions of the cursor
Sourcefn count_lines(&self, start: i32, end: i32, is_line_start: bool) -> i32
fn count_lines(&self, start: i32, end: i32, is_line_start: bool) -> i32
Counts the lines from start to end
Sourcefn move_right(&mut self) -> Result<(), FltkError>
fn move_right(&mut self) -> Result<(), FltkError>
Sourcefn show_cursor(&mut self, val: bool)
fn show_cursor(&mut self, val: bool)
Shows/hides the cursor
Sourcefn set_highlight_data<B: Into<Option<TextBuffer>>, E: Into<Vec<StyleTableEntry>>>(
&mut self,
style_buffer: B,
entries: E,
)
fn set_highlight_data<B: Into<Option<TextBuffer>>, E: Into<Vec<StyleTableEntry>>>( &mut self, style_buffer: B, entries: E, )
Sets the style of the text widget
Sourcefn unset_highlight_data<B: Into<Option<TextBuffer>>>(&mut self, style_buffer: B)
fn unset_highlight_data<B: Into<Option<TextBuffer>>>(&mut self, style_buffer: B)
Unset the style of the text widget
Sourcefn set_cursor_style(&mut self, style: Cursor)
fn set_cursor_style(&mut self, style: Cursor)
Sets the cursor style
Sourcefn set_cursor_color(&mut self, color: Color)
fn set_cursor_color(&mut self, color: Color)
Sets the cursor color
Sourcefn set_scrollbar_size(&mut self, size: i32)
fn set_scrollbar_size(&mut self, size: i32)
Sets the scrollbar size in pixels
Sourcefn set_scrollbar_align(&mut self, align: Align)
fn set_scrollbar_align(&mut self, align: Align)
Sets the scrollbar alignment
Sourcefn cursor_style(&self) -> Cursor
fn cursor_style(&self) -> Cursor
Returns the cursor style
Sourcefn cursor_color(&self) -> Color
fn cursor_color(&self) -> Color
Returns the cursor color
Sourcefn scrollbar_size(&self) -> i32
fn scrollbar_size(&self) -> i32
Returns the scrollbar size in pixels
Sourcefn scrollbar_align(&self) -> Align
fn scrollbar_align(&self) -> Align
Returns the scrollbar alignment
Sourcefn line_start(&self, pos: i32) -> i32
fn line_start(&self, pos: i32) -> i32
Returns the beginning of the line from the current position. Returns new position as index
Sourcefn line_end(&self, start_pos: i32, is_line_start: bool) -> i32
fn line_end(&self, start_pos: i32, is_line_start: bool) -> i32
Returns the ending of the line from the current position. Returns new position as index
Sourcefn skip_lines(&mut self, start_pos: i32, lines: i32, is_line_start: bool) -> i32
fn skip_lines(&mut self, start_pos: i32, lines: i32, is_line_start: bool) -> i32
Skips lines from start_pos
Sourcefn rewind_lines(&mut self, start_pos: i32, lines: i32) -> i32
fn rewind_lines(&mut self, start_pos: i32, lines: i32) -> i32
Rewinds the lines
Sourcefn previous_word(&mut self)
fn previous_word(&mut self)
Goes to the previous word
Sourcefn word_start(&self, pos: i32) -> i32
fn word_start(&self, pos: i32) -> i32
Returns the position of the start of the word, relative to the current position
Sourcefn word_end(&self, pos: i32) -> i32
fn word_end(&self, pos: i32) -> i32
Returns the position of the end of the word, relative to the current position
Sourcefn set_linenumber_width(&mut self, w: i32)
fn set_linenumber_width(&mut self, w: i32)
Sets the linenumber width
Sourcefn linenumber_width(&self) -> i32
fn linenumber_width(&self) -> i32
Gets the linenumber width
Sourcefn set_linenumber_font(&mut self, font: Font)
fn set_linenumber_font(&mut self, font: Font)
Sets the linenumber font
Sourcefn linenumber_font(&self) -> Font
fn linenumber_font(&self) -> Font
Gets the linenumber font
Sourcefn set_linenumber_size(&mut self, size: i32)
fn set_linenumber_size(&mut self, size: i32)
Sets the linenumber size
Sourcefn linenumber_size(&self) -> i32
fn linenumber_size(&self) -> i32
Gets the linenumber size
Sourcefn set_linenumber_fgcolor(&mut self, color: Color)
fn set_linenumber_fgcolor(&mut self, color: Color)
Sets the linenumber foreground color
Sourcefn linenumber_fgcolor(&self) -> Color
fn linenumber_fgcolor(&self) -> Color
Gets the linenumber foreground color
Sourcefn set_linenumber_bgcolor(&mut self, color: Color)
fn set_linenumber_bgcolor(&mut self, color: Color)
Sets the linenumber background color
Sourcefn linenumber_bgcolor(&self) -> Color
fn linenumber_bgcolor(&self) -> Color
Gets the linenumber background color
Sourcefn set_linenumber_align(&mut self, align: Align)
fn set_linenumber_align(&mut self, align: Align)
Sets the linenumber alignment
Sourcefn linenumber_align(&self) -> Align
fn linenumber_align(&self) -> Align
Gets the linenumber alignment
Sourcefn set_linenumber_format(&mut self, fmt: &str)
fn set_linenumber_format(&mut self, fmt: &str)
Sets the line number format string
Sourcefn linenumber_format(&self) -> Option<String>
fn linenumber_format(&self) -> Option<String>
Gets the current line number format string
Sourcefn position_style(
&self,
line_start_pos: i32,
line_len: i32,
line_index: i32,
) -> i32
fn position_style( &self, line_start_pos: i32, line_len: i32, line_index: i32, ) -> i32
Query style position in line
Sourcefn maintain_absolute_top_line_number(&mut self, state: bool)
fn maintain_absolute_top_line_number(&mut self, state: bool)
Maintain absolute top line number state
Sourcefn get_absolute_top_line_number(&self) -> i32
fn get_absolute_top_line_number(&self) -> i32
Get absolute top line number
Sourcefn absolute_top_line_number(&mut self, old_first_char: i32)
fn absolute_top_line_number(&mut self, old_first_char: i32)
Update absolute top line number with old first char
Sourcefn maintaining_absolute_top_line_number(&self) -> bool
fn maintaining_absolute_top_line_number(&self) -> bool
Return whether maintaining absolute top line number is enabled
Sourcefn reset_absolute_top_line_number(&mut self)
fn reset_absolute_top_line_number(&mut self)
Reset absolute top line number tracking
Sourcefn in_selection(&self, x: i32, y: i32) -> bool
fn in_selection(&self, x: i32, y: i32) -> bool
Checks whether a pixel is within a text selection
Sourcefn wrap_mode(&mut self, wrap: WrapMode, wrap_margin: i32)
fn wrap_mode(&mut self, wrap: WrapMode, wrap_margin: i32)
Sets the wrap mode of the Display widget.
If the wrap mode is AtColumn, wrap margin is the column.
If the wrap mode is AtPixel, wrap margin is the pixel.
For more info
Sourcefn wrapped_column(&self, row: i32, column: i32) -> i32
fn wrapped_column(&self, row: i32, column: i32) -> i32
Correct a column number based on an unconstrained position
Sourcefn wrapped_row(&self, row: i32) -> i32
fn wrapped_row(&self, row: i32) -> i32
Correct a row number from an unconstrained position
Sourcefn set_grammar_underline_color(&mut self, color: Color)
fn set_grammar_underline_color(&mut self, color: Color)
Set the grammar underline color
Sourcefn grammar_underline_color(&self) -> Color
fn grammar_underline_color(&self) -> Color
Get the grammar underline color
Sourcefn set_spelling_underline_color(&mut self, color: Color)
fn set_spelling_underline_color(&mut self, color: Color)
Set the spelling underline color
Sourcefn spelling_underline_color(&self) -> Color
fn spelling_underline_color(&self) -> Color
Get the spelling underline color
Sourcefn set_secondary_selection_color(&mut self, color: Color)
fn set_secondary_selection_color(&mut self, color: Color)
Set the secondary selection color
Sourcefn secondary_selection_color(&self) -> Color
fn secondary_selection_color(&self) -> Color
Get the secondary selection color
Sourcefn show_insert_position(&mut self)
fn show_insert_position(&mut self)
Scrolls the text buffer to show the current insert position
Sourcefn overstrike(&mut self, text: &str)
fn overstrike(&mut self, text: &str)
Overstrikes the current selection or inserts text at cursor
Sourcefn redisplay_range(&mut self, start: i32, end: i32)
fn redisplay_range(&mut self, start: i32, end: i32)
Redisplay a range of text
Sourcefn xy_to_position(&self, x: i32, y: i32, pos_type: PositionType) -> i32
fn xy_to_position(&self, x: i32, y: i32, pos_type: PositionType) -> i32
Converts x and y pixel positions into a position in the text buffer
Sourcefn xy_to_rowcol(&self, x: i32, y: i32, pos_type: PositionType) -> (i32, i32)
fn xy_to_rowcol(&self, x: i32, y: i32, pos_type: PositionType) -> (i32, i32)
Converts x and y pixel positions into a column and row number
Sourcefn scroll_row(&self) -> i32
fn scroll_row(&self) -> i32
Returns the number of rows
Sourcefn scroll_col(&self) -> i32
fn scroll_col(&self) -> i32
Returns the number of columns
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.