[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TCustomListView

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TCustomListView - the base class for TListView

## Declaration

Source position: comctrls.pp line 1003

`type TCustomListView = class(TWinControl)`
`protected`
`procedure ItemDeleted();` |  | ItemDeleted - the specified listitem is removed from the list
`procedure ItemInserted();` |  | ItemInserted - the specified item is inserted into the list
`protected`
`class procedure WSRegisterClass; override;` |  | WSRegisterClass - Register this Class for the current Widget Set
`class function GetControlClassDefaultSize; override;`
`protected`
`procedure InitializeWnd; override;` |  | InitializeWnd - calls inherited method, then sets various local properties
`procedure FinalizeWnd; override;` |  | FinalizeWnd stores the list origin then calls inherited method
`procedure DestroyWnd; override;` |  | DestroyWnd - destroy the window for this control
`procedure BeginAutoDrag; override;` |  | Start the AutoDrag process.
`procedure Change(); virtual;` |  | Change - Internal procedure to simulate the OnChange event
`procedure ColClick(); virtual;` |  | ColClick - procedure to simulate the OnColumnClick event.
`procedure Delete();` |  | Delete an Item from the List
`procedure DoDeletion(); virtual;` |  | DoDeletion - performs the actual deletion
`procedure DoInsert(); virtual;` |  | Performs the insertion
`procedure DoItemChecked();`
`procedure DoSelectItem(); virtual;` |  | DoSelectItem - perform item selection
`procedure InsertItem();` |  | Insert an Item into the List
`procedure ImageChanged();` |  | ImageChanged - procedure to signal that an image has chnaged
`procedure Loaded; override;` |  | Loaded makes a number of checks, using client size if specified, and copying appropriate flags, fonts, text etc, makes list of child controls to notify them of any changes, then calls inherited Loaded
`function IsCustomDrawn(); virtual;` |  | IsCustomDrawn - returns True if a target has been custom drawn
`function CustomDraw(); virtual;` |  | CustomDraw - performs custom drawing in the given rectangle, and returns True if successful
`function CustomDrawItem(); virtual;` |  | CustomDrawItem - custom draws the specified item, and returns True if successful
`function CustomDrawSubItem(); virtual;` |  | CustomDrawSubItem - custom draws the specified subitem, returning True if successful
`function IntfCustomDraw();` |  | IntfCustomDraw - uses the interface to perform custom drawing and returns a result of drawing
`function GetUpdateCount;`
`procedure DoGetOwnerData(); virtual;`
`property AllocBy: Integer; [rw]` |  | AllocBy - allocate the list by a value
`property ColumnClick: Boolean; [rw]` |  | ColumnClick - determines if the OnColumnClick event will be executed.
`property Columns: TListColumns; [rw]` |  | Columns - define and change the columns of a ListView
`property DefaultItemHeight: Integer; [rw]` |  | DefaultItemHeight - sets or reads the default height for an item on the list
`property HideSelection: Boolean; [rw]` |  | HideSelection - if True, the selected item is to be hidden
`property HoverTime: Integer; [rw]` |  | HoverTime - the time for which the mouse must hover over the item before its help message is displayed
`property LargeImages: TCustomImageList; [rw]` |  | LargeImages - an ImageList to be used in association with the list of Items
`property OwnerDraw: Boolean; [rw]` |  | OwnerDraw - if True, the Owner's Draw method is to be used
`property ScrollBars: TScrollStyle; [rw]` |  | ScrollBars - the kind of scrollbars to be used: none, auto, horizontal or vertical
`property ShowColumnHeaders: Boolean; [rw]` |  | ShowColumnHeaders - whether headers for columns are to be displayed
`property ShowWorkAreas: Boolean; [rw]` |  | ShowWorkAreas - if True, the work areas are to be displayed
`property SmallImages: TCustomImageList; [rw]` |  | SmallImages - an ImageList of small images (icons) to be used in association with the list of Items
`property SortType: TSortType; [rw]` |  | SortType - whether to sort by text, by data, both or not at all
`property SortColumn: Integer; [rw]` |  | SortColumn - the column that is being sorted
`property StateImages: TCustomImageList; [rw]` |  | StateImages - an imagelist of icons to demonstrate the state of a process or event
`property ToolTips: Boolean; [rw]` |  | ToolTips - whether Popup tool tips are to be shown
`property ViewStyle: TViewStyle; [rw]` |  | ViewStyle - whether to view as a simple list, a list with large or small icons, or as a report
`property OnChange: TLVChangeEvent; [rw]` |  | OnChange - event handler for a change in the list
`property OnColumnClick: TLVColumnClickEvent; [rw]` |  | OnColumnClick - event handler for clicking on a coulmn
`property OnCompare: TLVCompareEvent; [rw]` |  | OnCompare - event handler for comparing list items
`property OnData: TLVDataEvent; [rw]`
`property OnDeletion: TLVDeletedEvent; [rw]` |  | OnDeletion - event handler for deleting a list item
`property OnInsert: TLVInsertEvent; [rw]` |  | OnInsert - event handler for inserting list item
`property OnItemChecked: TLVCheckedItemEvent; [rw]`
`property OnSelectItem: TLVSelectItemEvent; [rw]` |  | OnSelectItem - event handler for list item selection
`property OnCustomDraw: TLVCustomDrawEvent; [rw]` |  | OnCustomDraw - event handler for custom drawing
`property OnCustomDrawItem: TLVCustomDrawItemEvent; [rw]` |  | OnCustomDrawItem - event handler for custom drawing an item
`property OnCustomDrawSubItem: TLVCustomDrawSubItemEvent; [rw]` |  | OnCustomDrawSubItem - event handler for custom drawing a subitem
`property OnAdvancedCustomDraw: TLVAdvancedCustomDrawEvent; [rw]` |  | OnAdvancedCustomDraw - event handler for advanced custom drawing
`property OnAdvancedCustomDrawItem: TLVAdvancedCustomDrawItemEvent; [rw]` |  | OnAdvancedCustomDrawItem - event handler for advanced custom drawing item
`property OnAdvancedCustomDrawSubItem: TLVAdvancedCustomDrawSubItemEvent; [rw]` |  | OnAdvancedCustomDrawSubItem - event handler for advanced custom drawing subitem
`public`
`constructor Create(); override;` |  | Create - constructor for TCustomListView: calls inherited Create then initialises columns, the list of items, the canvas and properties and some formats and styles
`destructor Destroy; override;` |  | Destroy - destructor for TCustomListView: frees Canvas, calls inherited Destroy and frees columns, links and list items
`procedure BeginUpdate;` |  | BeginUpdate - start updating the list view
`procedure Clear;` |  | Clear - the stringlist
`procedure EndUpdate;` |  | EndUpdate - finish updating the list view
`function FindCaption();` |  | FindCaption- search for and return the list item that contains the nominated caption
`function GetHitTestInfoAt();`
`function GetItemAt();` |  | GetItemAt - find and return the list item at the specified coordinates
`property BoundingRect: TRect; [r]` |  | BoundingRect - the coordinates of the rectangle containing the ListView
`property BorderStyle;` |  | BorderStyle - none, or single
`property Canvas: TCanvas; [r]` |  | Canvas - defines the area on which all graphic material is drawn (Read-only)
`property Checkboxes: Boolean; [rw]` |  | CheckBoxes - determines if the ListView shows checkboxes beside the items on the list
`property Column: TListColumn; [r]` |  | Column - reads the column information of the listview.
`property ColumnCount: Integer; [r]`
`property DropTarget: TListItem; [rw]` |  | DropTarget - location where an item from the list is to be dropped
`property FlatScrollBars: Boolean; [rw]` |  | FlatScrollBars - whether the scroll bars are to be displayed flat (default False)
`property FullDrag: Boolean; [rw]` |  | FullDrag - if True, the full object is dragged
`property GridLines: Boolean; [rw]` |  | Whether GridLines are to be shown
`property HotTrack: Boolean; [rw]` |  | HotTrack - the property whereby the item under the mouse pointer becomes emphasised
`property HotTrackStyles: TListHotTrackStyles; [rw]` |  | The HotTrackStyles available for this control
`property IconOptions: TIconOptions; [rw]`
`property ItemFocused: TListItem; [rw]` |  | ItemFocused - the item currently receiving focus
`property ItemIndex: Integer; [rw]`
`property Items: TListItems; [rw]` |  | Items - the list of entries in the list. Held as a linked list with a cached index of the last accessed item
`property MultiSelect: Boolean; [rw]` |  | MultiSelect - enables the selection of more than one entry from Items - by pressing SHIFT or CTRL keys while selecting
`property OwnerData: Boolean; [rw]` |  | OwnerData - if True, the Owner's data are to be displayed
`property ReadOnly: Boolean; [rw]` |  | ReadOnly - determines if the list can only be read, and not written or deleted.
`property RowSelect: Boolean; [rw]` |  | RowSelect - whether the user can select rows of items (across columns). Default false
`property SelCount: Integer; [r]` |  | SelCount - the number of items selected
`property Selected: TListItem; [rw]` |  | Selected - the current list item that has been selected
`property TabStop;` |  | Is the control in the sequence of controls accessed by successive presses of the Tab key?
`property TopItem: TListItem; [r]` |  | TopItem - the first item on the list
`property ViewOrigin: TPoint; [rw]` |  | ViewOrigin - the top left coordinate for the current view
`property VisibleRowCount: Integer; [r]` |  | VisibleRowCount - the number of rows visible in the current view (some items might have scrolled outside the window)
`end;`

## Inheritance

`TCustomListView` |  | TCustomListView - the base class for TListView
`TWinControl`
`TControl`
`TLCLComponent` |  | TLCLComponent - base class for LCL components
`TComponent,IUnknown,IInterfaceComponentReference`
`TPersistent`
`TObject`

## Description

TCustomListView is the base class for TListView. If you want to define your own ListView class, you should derive it from this class.

The latest version of this document can be found at lazarus-ccr.sourceforge.net .