Sign in Join
FPDoc Onlineexperiment

TCustomListView.CanChange function

Member of TCustomListViewprotectedIn unit ComCtrls

Indicates whether a change notification can be applied for an item on the list view control.

Declaration

pascal
function CanChange(AItem: TListItem; AChange: Integer): Boolean

Arguments

AItem

List item with the modified value examined in the method.

AChange

Indicates which value in the list item has been modified. Corresponds to the ordinal values in the TItemChange enumeration.

Function result

Returns True if the modified value in the list item is accepted.

Description

CanChange is a Boolean function used to determine whether a change notification message for an item in a list view control can be accepted and applied. CanChange is called from the widgetset class instance, and occurs when change notification messages are handled for the list view control.

CanChange signals the OnChanging event handler (when assigned) to determine the return value for the method. The return value is True if the changed value in AItem is accepted and can be applied to the list item. The return value is False if the modification is rejected in the OnChanging event handler.

Interestingly, the return value is True if AChange contains an Integer value that is not represented in the TItemChange enumeration. In this case, the OnChanging event is not signalled.

In the current LCL implementation, CanChange and OnChanging apply to the Windows widgetset only. Other platforms do not currently generate change notifications for item values.

Added in LCL version 4.0.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.