[−][src]Struct fltk::text::TextBuffer
Wraps a text buffer, Cloning a text buffer invalidates the underlying pointer, thus the no derive(Clone)
Implementations
impl TextBuffer
[src]
pub fn default() -> Self
[src]
Initialized a default text buffer
pub unsafe fn delete(&mut self)
[src]
Deletes the TextBuffer
pub unsafe fn from_ptr(ptr: *mut Fl_Text_Buffer) -> Self
[src]
Initialized a text buffer from a pointer
pub fn as_ptr(&self) -> *mut Fl_Text_Buffer
[src]
Returns the inner pointer from a text buffer
pub fn set_text(&mut self, txt: &str)
[src]
Sets the text of the buffer
pub fn text(&self) -> String
[src]
Returns the text of the buffer
pub fn append(&mut self, text: &str)
[src]
Appends to the buffer
pub fn length(&self) -> u32
[src]
Get the length of the buffer
pub fn remove(&mut self, start: u32, end: u32)
[src]
Removes from the buffer
pub fn text_range(&self, start: u32, end: u32) -> Option<String>
[src]
Returns the text within the range
pub fn insert(&mut self, pos: u32, text: &str)
[src]
Inserts text into a position
pub fn replace(&mut self, start: u32, end: u32, text: &str)
[src]
Replaces text from position start
to end
pub fn copy(&mut self, source_buf: &TextBuffer, start: u32, end: u32, to: u32)
[src]
Copies text from a source buffer into the current buffer
pub fn undo(&mut self) -> Result<(), FltkError>
[src]
Performs an undo operation on the buffer
pub fn can_undo(&mut self, flag: bool)
[src]
Sets whether the buffer can undo
pub fn load_file(&mut self, path: &Path) -> Result<(), FltkError>
[src]
Loads a file into the buffer
pub fn tab_distance(&self) -> u32
[src]
Returns the tab distance for the buffer
pub fn set_tab_distance(&mut self, tab_dist: u32)
[src]
Sets the tab distance
pub fn select(&mut self, start: u32, end: u32)
[src]
Selects the text from start to end
pub fn selected(&self) -> bool
[src]
Returns whether text is selected
pub fn unselect(&mut self)
[src]
Unselects text
pub fn selection_position(&mut self) -> Option<(u32, u32)>
[src]
Returns the selection position
pub fn selection_text(&mut self) -> String
[src]
Returns the selection text
pub fn remove_selection(&mut self)
[src]
Removes the selection
pub fn replace_selection(&mut self, text: &str)
[src]
Replaces selection
pub fn highlight(&mut self, start: u32, end: u32)
[src]
Highlights selection
pub fn is_highlighted(&mut self) -> bool
[src]
Returns whether text is highlighted
pub fn unhighlight(&mut self)
[src]
Unhighlights text
pub fn highlight_position(&mut self) -> Option<(u32, u32)>
[src]
Returns the highlight position
pub fn highlight_text(&mut self) -> String
[src]
Returns the highlighted text
pub fn line_text(&self, pos: u32) -> String
[src]
Returns the line at pos
pub fn line_start(&self, pos: u32) -> u32
[src]
Returns the index of the line's start position at pos
pub fn word_start(&self, pos: u32) -> u32
[src]
Returns the index of the first character of a word at pos
pub fn word_end(&self, pos: u32) -> u32
[src]
Returns the index of the last character of a word at pos
pub fn count_lines(&self, start: u32, end: u32) -> u32
[src]
Counts the lines from start to end
pub fn call_modify_callbacks(&mut self)
[src]
Calls the modify callbacks
pub fn add_modify_callback(
&mut self,
cb: Box<dyn FnMut(u32, u32, u32, u32, &str)>
)
[src]
&mut self,
cb: Box<dyn FnMut(u32, u32, u32, u32, &str)>
)
Adds a modify callback
pub fn remove_modify_callback(
&mut self,
cb: Box<dyn FnMut(u32, u32, u32, u32, &str)>
)
[src]
&mut self,
cb: Box<dyn FnMut(u32, u32, u32, u32, &str)>
)
Removes a modify callback
Trait Implementations
impl Clone for TextBuffer
[src]
fn clone(&self) -> TextBuffer
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TextBuffer
[src]
impl Send for TextBuffer
[src]
impl Sync for TextBuffer
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,