Struct termimad::ListView [−][src]
Expand description
A filterable list whose columns can be automatically resized.
Notes:
- another version will allow more than one style per cell (i.e. make the cells composites rather than compounds). Shout out if you need that now.
- this version doesn’t allow cell wrapping
Fields
area: Area
skin: &'t MadSkin
Implementations
Create a new list view with the passed columns.
The columns can’t be changed afterwards but the area can be modified. When two columns have the same title, those titles are merged (but the columns below stay separated).
return the height which is available for rows
return an option which when filled contains a tupple with the top and bottom of the vertical scrollbar. Return none when the content fits the available space.
remove all rows (and selection).
Keep the columns and the sort function, if any.
return both the number of displayed rows and the total number
recompute the widths of all columns. This should be called when the area size is modified
write the list view on the given writer
return true if the last line of the list is visible
ensure the last line is visible
set the scroll amount. lines_count can be negative
set the scroll amount. pages_count can be negative
try to select the next visible line
select the first visible line (unless there’s nothing).
select the last visible line (unless there’s nothing).
scroll to ensure the selected line (if any) is visible.
This is automatically called by try_scroll and try select functions