Class Hierarchy
Flv_List
Include Files
#include <FL/Flv_List.H>
Description
The Flv_List widget is designed to display a list of items. These
items can be of any complexity. For instance, the Flv_Table widget is just
a list with a bunch of columns. Below is an example of the list using
dynamic styles for row backgrounds.
The Flv_List widget has the following features:
- Optional title
- Supports optional row headers and/or footers
- Optional horizontal and vertical scroll bars
- Dynamic row heights, global row heights, and individual row heights
- Trickle down style information (default, global and row)
including alignment, background color, font name, font size,
foreground color, frame style, height, width,
resizable, edit locked
- Optional row grids
- Optional selectable range
- Optional row resizing w/mouse in full grid
- Dynamic or settable rows per page
- No data stored in widget
- Supports ~2 billion rows
- Absolute row references
- For text values draw_row is trivial to implement
Methods
The constructor builds an Flv_List widget at a specific point within the
parent.
The add_selection_style function will add the current selection
style information to style s. R is the row that you are
retrieving the selection style for. C is ignored for an
Flv_List. Currently it sets the background color to the
selection color if the row is selected. It also enforces block
selection. You can override this to provide a different way to add
selection information. If you do override this you should only apply
the style if you determine row R is selected.
This function draws a basic row. You will
always need to override this to provide row content. The default
function provided will draw the cell border, clear the cell and set-up
the foreground drawing information such as color and font. In your
inherited version, if you call this, you will typically only need alignment
information to draw the row. An example row would be:
...::draw_row( int Offset, int X, int Y, int W, int H, int R )
{
Flv_Style s;
Flv_List::draw_row( Offset, X, Y, W, H, R );
get_style( s, R );
fl_draw(get_value(R), X-Offset, Y, W, H, s.align() );
}
Flv_Feature feature(void)
Flv_Feature feature(Flv_Feature v)
Flv_Feature feature_add(Flv_Feature v)
Flv_Feature feature_remove(Flv_Feature v)
bool feature_test(Flv_Feature v)
The feature functions are designed to manipulate visual
features of the widget. feature
will set the list a features specifically to whatever parameter v
is set to. feature_add will set the features in v
to on. If the feature is already on it is ignored. feature_remove
will set the features in v to off. feature_test
will test if the set of features v are all turned on.
There are numerous convenience functions that exist for testing if a
feature is on also.
The full_resize function is a feature convenience function that
test whether FLVF_FULL_RESIZE is on. Full resize allows
resizing anywhere in the widget at a row or column boundary. When full
resize is not set, resizing can only occur at the ends of columns, rows,
and titles. For an Flv_List you must turn this on
in addition to turning on the appropriate resizable properties.
The get_default_style function is a guaranteed full style
retrieval function. That means style s will have all information
defined. Furthermore it will be defined with whatever the default
values are.
The get_row function will return what row contains the
x and y coordinates.
The get_style function is a guaranteed full style retrieval
function. That means style s will have all information defined.
It is defined in the following manner: Default style, global style,
row R style. For an Flv_List class parameter C
is ignored.
This is the default event handling loop. You will need to override this
if you need to respond to events in a new way.
These functions are designed to get or set the
visibility of the
horizontal and vertical scrollbars.
This function is a convenience function that determines if the
FLVF_MULTI_SELECT feature has been set. This function returns true
if the feature is set and false if the feature is not set.
This function is a feature convenience function that determines if the
FLVF_PERSIST_SELECT feature has been set. The function returns true
if the feature is set and false if the feature is not set.
These functions return the current row. The second function will actually
set the row. Bounds checking is done automatically. There are three
special rows: row -1 is the row header, row -2 is the row footer, and
row -3 is the widget title.
These functions return the total number of rows. The second function will
actually set the number of rows before returning the value.
These functions return the number of rows the widget should advance
when paging through the rows. If n=0 the number of rows per
page is automatically calculated.
This is a feature convenience function that determines if row
dividers/grid lines have been turned on. It returns true if the lines
are visible.
This is a feature convenience function that determines if the row footers
have been turned on. It returns true if the row footers are visible.
This is a feature convenience function that determines if the row headers
have been turned on. It returns true if the row headers are visible.
These functions return the height of row n. The second function
will actually set the height of row n. By default this function
uses style information to track individual row heights. The value
returned will be the trickle down row height (i.e. default style,
global style, row style).
These functions return the current row offset. The second function
will actually set the row offset. The row offset determines the left
visible edge will be.
These functions return whether or not a row may be resized. This function
uses style information to track this information. The value returned
will be the trickle down values (i.e. default style, global style, row
style).
This function returns true if row n is selected.
This function returns the current width of the row. The second function
actually sets the value of the row width. If n is set to 0 the
row width will be automatic. Currently all table widgets will override
this value when the widgets are drawn.
These functions return the visible width of the scroll bars. The second
function will actually set the width before returning the value.
The default value is 17.
These functions return the first selected row. The second function will
actually set which row is first selected. The first selected row may be
before or after the current row.
This function return the number of the first visible row in the grid.
This style contains any global widget styles. For instance to make
all rows and/or columns resizable use: global_style.resizable(true);
For a complete list of style properties see the
Flv_Style reference.
This contains a list of styles that have been defined for any rows. In
practice you should use the find or skip_to functions to determine if
a row has a style defined. In general you will use get_style(style,row)
which will return the value being used for a row. For a complete list of
list properties and methods see the
Flv_Style_List reference. This is also where the list of cell styles
is maintained for table based widgets.