[][src]Trait fltk::prelude::DisplayExt

pub unsafe trait DisplayExt: WidgetExt {
    pub fn buffer(&self) -> Option<TextBuffer>;
pub fn set_buffer(&mut self, buffer: Option<TextBuffer>);
pub fn style_buffer(&self) -> Option<TextBuffer>;
pub fn text_font(&self) -> Font;
pub fn set_text_font(&mut self, font: Font);
pub fn text_color(&self) -> Color;
pub fn set_text_color(&mut self, color: Color);
pub fn text_size(&self) -> u32;
pub fn set_text_size(&mut self, sz: u32);
pub fn scroll(&mut self, top_line_num: u32, horiz_offset: u32);
pub fn insert(&self, text: &str);
pub fn set_insert_position(&mut self, new_pos: u32);
pub fn insert_position(&self) -> u32;
pub fn position_to_xy(&self, pos: u32) -> (u32, u32);
pub fn count_lines(&self, start: u32, end: u32, is_line_start: bool) -> u32;
pub fn move_right(&mut self) -> Result<(), FltkError>;
pub fn move_left(&mut self) -> Result<(), FltkError>;
pub fn move_up(&mut self) -> Result<(), FltkError>;
pub fn move_down(&mut self) -> Result<(), FltkError>;
pub fn show_cursor(&mut self, val: bool);
pub fn set_highlight_data(
        &mut self,
        style_buffer: TextBuffer,
        entries: Vec<StyleTableEntry>
    );
pub fn set_cursor_style(&mut self, style: TextCursor);
pub fn set_cursor_color(&mut self, color: Color);
pub fn set_scrollbar_width(&mut self, width: i32);
pub fn set_scrollbar_size(&mut self, size: u32);
pub fn set_scrollbar_align(&mut self, align: Align);
pub fn cursor_style(&self) -> TextCursor;
pub fn cursor_color(&self) -> Color;
pub fn scrollbar_width(&self) -> u32;
pub fn scrollbar_size(&self) -> u32;
pub fn scrollbar_align(&self) -> Align;
pub fn line_start(&self, pos: u32) -> u32;
pub fn line_end(&self, start_pos: u32, is_line_start: bool) -> u32;
pub fn skip_lines(
        &mut self,
        start_pos: u32,
        lines: u32,
        is_line_start: bool
    ) -> u32;
pub fn rewind_lines(&mut self, start_pos: u32, lines: u32) -> u32;
pub fn next_word(&mut self);
pub fn previous_word(&mut self);
pub fn word_start(&self, pos: u32) -> u32;
pub fn word_end(&self, pos: u32) -> u32;
pub fn x_to_col(&self, x: f64) -> f64;
pub fn col_to_x(&self, col: f64) -> f64;
pub fn set_linenumber_width(&mut self, w: i32);
pub fn linenumber_width(&self) -> i32;
pub fn set_linenumber_font(&mut self, font: Font);
pub fn linenumber_font(&self) -> Font;
pub fn set_linenumber_size(&mut self, size: u32);
pub fn linenumber_size(&self) -> u32;
pub fn set_linenumber_fgcolor(&mut self, color: Color);
pub fn linenumber_fgcolor(&self) -> Color;
pub fn set_linenumber_bgcolor(&mut self, color: Color);
pub fn linenumber_bgcolor(&self) -> Color;
pub fn set_linenumber_align(&mut self, align: Align);
pub fn linenumber_align(&self) -> Align;
pub fn in_selection(&self, x: i32, y: i32) -> bool;
pub fn wrap_mode(&mut self, wrap: WrapMode, wrap_margin: i32);
pub fn wrapped_column(&self, row: i32, column: i32) -> i32;
pub fn wrapped_row(&self, row: i32) -> i32; }

Defines the methods implemented by TextDisplay and TextEditor

Required methods

pub fn buffer(&self) -> Option<TextBuffer>

Get the associated TextBuffer

pub fn set_buffer(&mut self, buffer: Option<TextBuffer>)

Sets the associated TextBuffer

pub fn style_buffer(&self) -> Option<TextBuffer>

Get the associated style TextBuffer

pub fn text_font(&self) -> Font

Return the text font

pub fn set_text_font(&mut self, font: Font)

Sets the text font

pub fn text_color(&self) -> Color

Return the text color

pub fn set_text_color(&mut self, color: Color)

Sets the text color

pub fn text_size(&self) -> u32

Return the text size

pub fn set_text_size(&mut self, sz: u32)

Sets the text size

pub fn scroll(&mut self, top_line_num: u32, horiz_offset: u32)

Scroll down the Display widget

pub fn insert(&self, text: &str)

Insert into Display widget

pub fn set_insert_position(&mut self, new_pos: u32)

Set the insert position

pub fn insert_position(&self) -> u32

Return the insert position

pub fn position_to_xy(&self, pos: u32) -> (u32, u32)

Gets the x and y positions of the cursor

pub fn count_lines(&self, start: u32, end: u32, is_line_start: bool) -> u32

Counts the lines from start to end

pub fn move_right(&mut self) -> Result<(), FltkError>

Moves the cursor right

pub fn move_left(&mut self) -> Result<(), FltkError>

Moves the cursor left

pub fn move_up(&mut self) -> Result<(), FltkError>

Moves the cursor up

pub fn move_down(&mut self) -> Result<(), FltkError>

Moves the cursor down

pub fn show_cursor(&mut self, val: bool)

Shows/hides the cursor

pub fn set_highlight_data(
    &mut self,
    style_buffer: TextBuffer,
    entries: Vec<StyleTableEntry>
)

Sets the style of the text widget

pub fn set_cursor_style(&mut self, style: TextCursor)

Sets the cursor style

pub fn set_cursor_color(&mut self, color: Color)

Sets the cursor color

pub fn set_scrollbar_width(&mut self, width: i32)

Sets the scrollbar width

pub fn set_scrollbar_size(&mut self, size: u32)

Sets the scrollbar size in pixels

pub fn set_scrollbar_align(&mut self, align: Align)

Sets the scrollbar alignment

pub fn cursor_style(&self) -> TextCursor

Returns the cursor style

pub fn cursor_color(&self) -> Color

Returns the cursor color

pub fn scrollbar_width(&self) -> u32

Returns the scrollback width

pub fn scrollbar_size(&self) -> u32

Returns the scrollbar size in pixels

pub fn scrollbar_align(&self) -> Align

Returns the scrollbar alignment

pub fn line_start(&self, pos: u32) -> u32

Returns the beginning of the line from the current position

pub fn line_end(&self, start_pos: u32, is_line_start: bool) -> u32

Returns the ending of the line from the current position

pub fn skip_lines(
    &mut self,
    start_pos: u32,
    lines: u32,
    is_line_start: bool
) -> u32

Skips lines from start_pos

pub fn rewind_lines(&mut self, start_pos: u32, lines: u32) -> u32

Rewinds the lines

pub fn next_word(&mut self)

Goes to the next word

pub fn previous_word(&mut self)

Goes to the previous word

pub fn word_start(&self, pos: u32) -> u32

Returns the position of the start of the word, relative to the current position

pub fn word_end(&self, pos: u32) -> u32

Returns the position of the end of the word, relative to the current position

pub fn x_to_col(&self, x: f64) -> f64

Convert an x pixel position into a column number.

pub fn col_to_x(&self, col: f64) -> f64

Convert a column number into an x pixel position

pub fn set_linenumber_width(&mut self, w: i32)

Sets the linenumber width

pub fn linenumber_width(&self) -> i32

Gets the linenumber width

pub fn set_linenumber_font(&mut self, font: Font)

Sets the linenumber font

pub fn linenumber_font(&self) -> Font

Gets the linenumber font

pub fn set_linenumber_size(&mut self, size: u32)

Sets the linenumber size

pub fn linenumber_size(&self) -> u32

Gets the linenumber size

pub fn set_linenumber_fgcolor(&mut self, color: Color)

Sets the linenumber foreground color

pub fn linenumber_fgcolor(&self) -> Color

Gets the linenumber foreground color

pub fn set_linenumber_bgcolor(&mut self, color: Color)

Sets the linenumber background color

pub fn linenumber_bgcolor(&self) -> Color

Gets the linenumber background color

pub fn set_linenumber_align(&mut self, align: Align)

Sets the linenumber alignment

pub fn linenumber_align(&self) -> Align

Gets the linenumber alignment

pub fn in_selection(&self, x: i32, y: i32) -> bool

Checks whether a pixel is within a text selection

pub 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: https://www.fltk.org/doc-1.4/classFl__Text__Display.html#ab9378d48b949f8fc7da04c6be4142c54

pub fn wrapped_column(&self, row: i32, column: i32) -> i32

Correct a column number based on an unconstrained position

pub fn wrapped_row(&self, row: i32) -> i32

Correct a row number from an unconstrained position

Loading content...

Implementors

impl DisplayExt for SimpleTerminal[src]

impl DisplayExt for TextDisplay[src]

impl DisplayExt for TextEditor[src]

Loading content...