Trait fltk::prelude::BrowserExt [−][src]
pub unsafe trait BrowserExt: WidgetExt {}Show methods
fn remove(&mut self, line: i32); fn add(&mut self, item: &str); fn insert(&mut self, line: i32, item: &str); fn move_item(&mut self, to: i32, from: i32); fn swap(&mut self, a: i32, b: i32); fn clear(&mut self); fn size(&self) -> i32; fn select(&mut self, line: i32); fn selected(&self, line: i32) -> bool; fn text(&self, line: i32) -> Option<String>; fn selected_text(&self) -> Option<String>; fn set_text(&mut self, line: i32, txt: &str); fn load<P: AsRef<Path>>(&mut self, path: P) -> Result<(), FltkError>; fn text_size(&self) -> i32; fn set_text_size(&mut self, sz: i32); fn set_icon<Img: ImageExt>(&mut self, line: i32, image: Option<Img>); fn icon(&self, line: i32) -> Option<Box<dyn ImageExt>>; fn remove_icon(&mut self, line: i32); fn top_line(&mut self, line: i32); fn bottom_line(&mut self, line: i32); fn middle_line(&mut self, line: i32); fn format_char(&self) -> char; fn set_format_char(&mut self, c: char); fn column_char(&self) -> char; fn set_column_char(&mut self, c: char); fn column_widths(&self) -> Vec<i32>; fn set_column_widths(&mut self, arr: &'static [i32]); fn displayed(&self, line: i32) -> bool; fn make_visible(&mut self, line: i32); fn position(&self) -> i32; fn set_position(&mut self, pos: i32); fn hposition(&self) -> i32; fn set_hposition(&mut self, pos: i32); fn has_scrollbar(&self) -> BrowserScrollbar; fn set_has_scrollbar(&mut self, mode: BrowserScrollbar); fn scrollbar_size(&self) -> i32; fn set_scrollbar_size(&mut self, new_size: i32); fn sort(&mut self); fn scrollbar(&self) -> Box<dyn ValuatorExt>; fn hscrollbar(&self) -> Box<dyn ValuatorExt>; fn value(&self) -> i32;
Defines the methods implemented by all browser types
Required methods
fn remove(&mut self, line: i32)
[src]
Removes the specified line. Lines start at 1
fn add(&mut self, item: &str)
[src]
Adds an item
fn insert(&mut self, line: i32, item: &str)
[src]
Inserts an item at an index. Lines start at 1
fn move_item(&mut self, to: i32, from: i32)
[src]
Moves an item. Lines start at 1
fn swap(&mut self, a: i32, b: i32)
[src]
Swaps 2 items. Lines start at 1
fn clear(&mut self)
[src]
Clears the browser widget
fn size(&self) -> i32
[src]
Returns the number of items
fn select(&mut self, line: i32)
[src]
Select an item at the specified line. Lines start at 1
fn selected(&self, line: i32) -> bool
[src]
Returns whether the item is selected Lines start at 1
fn text(&self, line: i32) -> Option<String>
[src]
Returns the text of the item at line
.
Lines start at 1
fn selected_text(&self) -> Option<String>
[src]
Returns the text of the selected item. Lines start at 1
fn set_text(&mut self, line: i32, txt: &str)
[src]
Sets the text of the selected item. Lines start at 1
fn load<P: AsRef<Path>>(&mut self, path: P) -> Result<(), FltkError>
[src]
Load a file
fn text_size(&self) -> i32
[src]
Return the text size
fn set_text_size(&mut self, sz: i32)
[src]
Sets the text size. Lines start at 1
fn set_icon<Img: ImageExt>(&mut self, line: i32, image: Option<Img>)
[src]
Sets the icon for browser elements. Lines start at 1
fn icon(&self, line: i32) -> Option<Box<dyn ImageExt>>
[src]
Returns the icon of a browser element. Lines start at 1
fn remove_icon(&mut self, line: i32)
[src]
Removes the icon of a browser element. Lines start at 1
fn top_line(&mut self, line: i32)
[src]
Scrolls the browser so the top item in the browser is showing the specified line. Lines start at 1
fn bottom_line(&mut self, line: i32)
[src]
Scrolls the browser so the bottom item in the browser is showing the specified line. Lines start at 1
fn middle_line(&mut self, line: i32)
[src]
Scrolls the browser so the middle item in the browser is showing the specified line. Lines start at 1
fn format_char(&self) -> char
[src]
Gets the current format code prefix character, which by default is ‘@’. More info here
fn set_format_char(&mut self, c: char)
[src]
Sets the current format code prefix character to \p c. The default prefix is ‘@’. c should be ascii
fn column_char(&self) -> char
[src]
Gets the current column separator character. The default is ‘\t’
fn set_column_char(&mut self, c: char)
[src]
Sets the column separator to c. This will only have an effect if you also use set_column_widths(). c should be ascii
fn column_widths(&self) -> Vec<i32>
[src]
Gets the current column width array
fn set_column_widths(&mut self, arr: &'static [i32])
[src]
Sets the current column width array
fn displayed(&self, line: i32) -> bool
[src]
Returns whether a certain line is displayed
fn make_visible(&mut self, line: i32)
[src]
Makes a specified line visible
fn position(&self) -> i32
[src]
Gets the vertical scroll position of the list as a pixel position
fn set_position(&mut self, pos: i32)
[src]
Sets the vertical scroll position of the list as a pixel position
fn hposition(&self) -> i32
[src]
Gets the horizontal scroll position of the list as a pixel position
fn set_hposition(&mut self, pos: i32)
[src]
Sets the horizontal scroll position of the list as a pixel position
fn has_scrollbar(&self) -> BrowserScrollbar
[src]
Returns the type of scrollbar associated with the browser
fn set_has_scrollbar(&mut self, mode: BrowserScrollbar)
[src]
Sets the type of scrollbar associated with the browser
fn scrollbar_size(&self) -> i32
[src]
Gets the scrollbar size
fn set_scrollbar_size(&mut self, new_size: i32)
[src]
Sets the scrollbar size
fn sort(&mut self)
[src]
Sorts the items of the browser
fn scrollbar(&self) -> Box<dyn ValuatorExt>
[src]
Returns the vertical scrollbar
fn hscrollbar(&self) -> Box<dyn ValuatorExt>
[src]
Returns the horizontal scrollbar
fn value(&self) -> i32
[src]
Returns the selected line, returns 0 if no line is selected