The TListViewCtrl class creates a list view that displays items in four ways: large (regular) icons, small icons, as a list, or as a report.
In-place editing of item names is supported. The right pane of the Windows 95 Explorer uses this type of window.
The native control for Windows 95 is the List View common control.
Using the List View Control
- #include <owl/listviewctrl.h> for declarations of TListViewCtrl, TListWindItem, and TListWindColumn classes.
- Create the control.
- Set the style for the control.
- Optionally associate an image list with the control. If you are using an image list, do not forget to #include <owl/imagelst.h>.
ListWind->SetImageList(*ImageList, TListViewCtrl::State);
- Depending on the style of the control, add the appropriate columns.
TListWindColumn
column(
"Column", 100);
- Add the items into the control.
for (
int i = 0;
i < ImageList->GetImageCount();
i++) {
TListWindItem item(Buffer);
}
- The parent window of the control may respond to events sent by the control.