A list view control is a window that displays a collection of items, each item
consisting of an optional icon and a label. List view controls provide several
ways of arranging items and displaying individual items. For example,
additional information about each item can be displayed in columns to the right
of the icon and label. This arrangement is called a report view. Microsoft
Explorer uses a list view control in order to display directory information.
width and height provide the dimensions of the control in
num_items is an integer constant giving the number of rows in the
report view + 1 (for the header). Blank rows are not displayed in the control.
This means that the number of rows that are displayed can be changed under
program control. The first blank row terminates the input.
items is an array of num_items character strings the first
describing the column headers and widths, then one string describing each row
in turn (see the example below).
sel is an integer array whose elements are set to 1 if the item is
selected otherwise to zero.
view is an integer variable in the range 0..3 that represents the type
of view. 0=Icon view; 1=Report view; 2=Small icon view; 3=List view. These are
available even when no icons are provided.
If a grave accent is provided, icon_str is a character string giving a
list of icon resources in the form 'icon1,icon2'.
%lv can take a pivot (%pv - Pivot). Also the right mouse button can be used to trigger
a popup menu (%pm - Popup Menu) defined in the parent window.
Here we have 3 rows with 2 columns. items(1) provides data for the
column headings and widths. The first character defines the separator between
the data for each column. In this example, the first column has the caption
"Header". A trailing underscore followed by an integer provides the pixel width
of the column. If this is omitted then the length of the text defines the
width (a plus sign placed before the integer makes the
heading centred whilst a minus sign makes it right justified). In this
example the second column header is blank and the second column width is 50
pixels. The number of characters (80 in this case) must be sufficient to allow
ClearWin+ to add the column width to each heading (4 characters per column).
items(2) provides data for the first row of a report. Again the first
character defines the separator. The second character defines the icon as an
index (A,B,C...) into the list of icons 'icon1,icon2' (when a grave accent is
used). Next comes the label and then the data for column two etc..