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

TListView

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

TListView - a window showing a list of Items which may or may not have associated icons.

Declaration

Source position: comctrls.pp line 1667

type TListView = class(TCustomListView)

published

  property Align: TAlign;

  

Specifies the placement of the control inside its Parent.

  property AllocBy: Integer;

  

Reduces allocation overhead in the widgetset class by increasing the internal buffer capacity by this block size.

  property Anchors: TAnchors;

  

The set of anchor definitions for this control.

  property AutoSort: Boolean;

  

Controls automatic updates to the sort column and order indicator for the control.

  property AutoSortIndicator: Boolean;

  

Indicates if the control automatically changes the column and/or order indicator when a column is clicked.

  property AutoWidthLastColumn: Boolean; [rw]

  

Resizes the last visible column to fill the remaining display area for the control.

  property BorderSpacing: TControlBorderSpacing;

  

Determines the inner and outer border spacing for this control.

  property BorderStyle: TBorderStyle;

  

Line style drawn as a border around the control.

  property BorderWidth: TBorderWidth;

  

Width of the Border around the control; default is zero.

  property Checkboxes: Boolean;

  

Displays a check box column for the list items on the control.

  property Color: TColor;

  

The background color of the control.

  property Columns: TListColumns;

  

Collection with the column definitions for the list view control (size, alignment, image index, etc.).

  property ColumnClick: Boolean;

  

Enables or disables OnColumnClick events for column headers on the control.

  property Constraints: TSizeConstraints;

  

The minimum and maximum Width and Height for the control.

  property DragCursor: TCursor;

  

The cursor shape shown while the control is dragged.

  property DragKind: TDragKind;

  

The operation when the control is dragged - Drag or Dock.

  property DragMode: TDragMode;

  

Allows the user to drag the control.

  property Enabled: Boolean;

  

Determines whether the control reacts on mouse or keyboard input.

  property Font: TFont;

  

The font to be used for text display in this control.

  property GridLines: Boolean;

  

Enables or disables grid lines between rows and columns on the control.

  property HideSelection: Boolean;

  

If control looses focus, don't paint selection background for selected item(s).

  property IconOptions: TIconOptions;

  

Options for layouts, which show icons. Sets arrangement of icons, text-wrapping state.

  property Items: TListItems;

  

Collection of list items displayed on the list view control.

  property LargeImages: TCustomImageList;

  

ImageList object, which contains "big" icons for one if ListView layouts.

  property LargeImagesWidth: Integer;

  

Contains the Width for the large images used in the list view.

  property MultiSelect: Boolean;

  

Allows simultaneous selection of one or more list items using Ctrl+Click, Shift+Click, Ctrl+Shift+Click, or using program code.

  property OwnerData: Boolean;

  

Enables or disables owner data (virtual) mode for the list view control.

  property OwnerDraw: Boolean;

  

Indicates if owner-draw mode is used for the control.

  property ParentColor: Boolean;

  

Uses the Color from the Parent control, when enabled.

  property ParentFont: Boolean;

  

If true, the Font of the control will be the same as the one from the Parent. Default is true.

  property ParentShowHint: Boolean;

  

If true, the value of ShowHint for the control will be the same as the one from the Parent. Default is true.

  property PopupMenu: TPopupMenu;

  

A context-sensitive menu that pops up when the right mouse button is clicked over this control.

  property ReadOnly: Boolean;

  

Disables editing of list items on the control when set to True.

  property RowSelect: Boolean;

  

In Report view, this highlights the entire selected row to the right edge of the list view control.

  property ScrollBars: TScrollStyle;

  

Specifies the scroll bars visible for the control.

  property ShowColumnHeaders: Boolean;

  

Show header area in ListView, which shows captions of columns.

  property ShowHint: Boolean;

  

Enables the Hint display.

  property SmallImages: TCustomImageList;

  

ImageList object, which contains "small" icons for one if ListView layouts.

  property SmallImagesWidth: Integer;

  

Width for the images in the SmallImages property.

  property SortColumn: Integer;

  

Ordinal position for the column used to sort the list items, or -1 when not assigned.

  property SortDirection: TSortDirection;

  

Sorting direction (order) for the current SortColumn.

  property SortType: TSortType;

  

Specifies the sorting mechanism used for the current SortColumn.

  property StateImages: TCustomImageList;

  

Image list with the state images for the items on the control.

  property StateImagesWidth: Integer;

  

Width of the images in the StateImages property.

  property TabStop: Boolean;

  

Allows the user to navigate to this control, by pressing the Tab key.

  property TabOrder: TTabOrder;

  

Determines the sequence of control navigation when the user presses the Tab key.

  property ToolTips: Boolean;

  

Indicates if a hint (tool tip) is automatically displayed for an item under the mouse cursor.

  property Visible: Boolean;

  

Allows the control, and all of its children, to be displayed or hidden.

  property ViewStyle: TViewStyle;

  

Sets one of ListView layouts: List (simple column), Report (few columns with full width), Icon (big icons), Small Icon (small icons, 16x16).

  property OnAdvancedCustomDraw: TLVAdvancedCustomDrawEvent;

  

Called for owner-draw mode.

  property OnAdvancedCustomDrawItem: TLVAdvancedCustomDrawItemEvent;

  

Called for owner-draw mode.

  property OnAdvancedCustomDrawSubItem: TLVAdvancedCustomDrawSubItemEvent;

  

Called for owner-draw mode.

  property OnChange: TLVChangeEvent;

  

Event handler signalled when the content for a list item is changed.

  property OnClick: TNotifyEvent;

  

Notification handler for mouse clicks.

  property OnColumnClick: TLVColumnClickEvent;

  

Event handler signalled when a column header for the control is clicked.

  property OnCompare: TLVCompareEvent;

  

Event handler signalled to compare list items in the CustomSort method.

  property OnContextPopup: TContextPopupEvent;

  

Invoked when a context-sensitive pop-up menu is requested.

  property OnCreateItemClass: TLVCreateItemClassEvent;

  

Event handler signalled to get the class reference used to create new list view items.

  property OnCustomDraw: TLVCustomDrawEvent;

  

Called for owner-draw mode.

  property OnCustomDrawItem: TLVCustomDrawItemEvent;

  

Called for owner-draw mode.

  property OnCustomDrawSubItem: TLVCustomDrawSubItemEvent;

  

Called for owner-draw mode.

  property OnData: TLVDataEvent;

  

Event handler signalled to the value(s) for a list item when OwnerData (virtual mode) has been enabled.

  property OnDataFind: TLVDataFindEvent;

  

Event handler signalled to locate list item data in OwnerData (virtual) mode.

  property OnDataHint: TLVDataHintEvent;

  

The event handler is not signalled in the current LCL implementation.

  property OnDataStateChange: TLVDataStateChangeEvent;

  

Not used in the current LCL version.

  property OnDblClick: TNotifyEvent;

  

Event Handler for double mouse clicks.

  property OnDeletion: TLVDeletedEvent;

  

Event handler signalled when a list item is deleted from the Items container.

  property OnDragDrop: TDragDropEvent;

  

This handler determines the action on an drop onto this control, in a drag-drop operation.

  property OnDragOver: TDragOverEvent;

  

Event handler for a control being dragged over this control.

  property OnDrawItem: TLVDrawItemEvent;

  

Event handler signalled to render an owner drawn item.

  property OnEdited: TLVEditedEvent;

  

Event handler signalled when editing has been completed for a list item in the control.

  property OnEditing: TLVEditingEvent;

  

Event handler signalled to determine if editing can be started for a list item in the control.

  property OnEndDock: TEndDragEvent;

  

Notification handler for the end of a docking operation.

  property OnEndDrag: TEndDragEvent;

  

Notification handler for the end of a dragging operation.

  property OnEnter: TNotifyEvent;

  

Handler for control receiving the focus.

  property OnExit: TNotifyEvent;

  

Handler for control loosing the focus; This is a good place for checking the finished user input.

  property OnInsert: TLVInsertEvent;

  

Called when a list item is inserted in program code.

  property OnItemChecked: TLVCheckedItemEvent;

  

Event handler signalled when the Checked property for a list item has been changed.

  property OnKeyDown: TKeyEvent;

  

Handler for keyboard key pressed.

  property OnKeyPress: TKeyPressEvent;

  

Handler for a character entered by the user.

  property OnKeyUp: TKeyEvent;

  

Handler for keyboard key released.

  property OnMouseDown: TMouseEvent;

  

Event handler for mouse button going down.

  property OnMouseEnter: TNotifyEvent;

  

Event handler for mouse entering the area of the control.

  property OnMouseLeave: TNotifyEvent;

  

Event handler for mouse leaving the area of the control.

  property OnMouseMove: TMouseMoveEvent;

  

Event handler for mouse movement within the control.

  property OnMouseUp: TMouseEvent;

  

Event handler for mouse button going up.

  property OnMouseWheel: TMouseWheelEvent;

  

Event handler for mouse wheel turned.

  property OnMouseWheelDown: TMouseWheelUpDownEvent;

  

Event handler for downward movement of mouse wheel.

  property OnMouseWheelUp: TMouseWheelUpDownEvent;

  

Event handler for upward movement of the mouse wheel.

  property OnMouseWheelHorz: TMouseWheelEvent;

  

Event handler for horizontal movements of the mouse wheel.

  property OnMouseWheelLeft: TMouseWheelUpDownEvent;

  

Event handler for left movements of the mouse wheel.

  property OnMouseWheelRight: TMouseWheelUpDownEvent;

  

Event handler for right movements of the mouse wheel.

  property OnResize: TNotifyEvent;

  

Notification handler for a resize of the control.

  property OnSelectItem: TLVSelectItemEvent;

  

Event handler signalled when the selected list item for the control is changed.

  property OnShowHint: TControlShowHintEvent;

  

Event handler signalled when a hint window is displayed for the control.

  property OnStartDock: TStartDockEvent;

  

Event handler for the start of a docking operation.

  property OnStartDrag: TStartDragEvent;

  

Event handler for the start of a dragging operation.

  property OnUTF8KeyPress: TUTF8KeyPressEvent;

  

Handler for a character entered by the user.

end;

Inheritance

TListView

  

TListView - a window showing a list of Items which may or may not have associated icons.

|

TCustomListView

  

TCustomListView is the base class for TListView.

|

TWinControl

  

The base class for controls which can contain other (child) controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components which have an associated widget.

|

TComponent

?

TObject

Description

TListView - a window showing a list of items which may or may not have associated icons.

At first this control looks very like TListBox but it has a much higher degree of complexity. It is capable of displaying Items in Columns of Rows and it can have images associated with the list Items.

The important information is held in Items, a string-list that can be created using the string-list editor obtained by right-clicking on the ListView in the Form Editor or by clicking on the ellipsis (...) next to the Items entry in the Object Inspector.

A typical application might have two ImageLists: one of LargeImages and one of SmallImages, containing two versions of the same collection of images, in large and small format; the index numbers of the first list would correspond with those in the second list.

SmallImages (if assigned to a string-list) can be displayed beside the text strings in the list view and the programmer would supply code to ensure that when an item with its associated Small Image was selected, the corresponding Large Image would be displayed in another window.

One or more TImageList controls need to be added to the Form Designer and the ImageList Editor can be opened from the pop-up menu obtained by right-clicking on TImageList icon in the Form Designer. The image list can be populated by reading from files. Then in the StringList editor for Items the correct ImageIndex must be assigned to each entry in the list.

See also

TCustomListView

  

TCustomListView is the base class for TListView.

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