Sign in Join
FPDoc Onlineexperiment

TCustomImageList.EndUpdate procedure

Member of TCustomImageListpublicIn unit ImgList

Finishes an update to the image list, and calls Change.

Declaration

pascal
procedure EndUpdate

Description

EndUpdate is used to finish an update to images in the list. EndUpdate is used, along with BeginUpdate, to speed up image list updates by blocking execution of the OnChange event handler.

BeginUpdate increments an internal counter in the class instance each time the method is called. EndUpdate decrements the internal counter when called. If the modified counter contains a positive non-zero value, the OnChange event handler is not executed when the image list is changed. When the counter reaches zero (0), the Change method is called to perform OnChange notifications.

EndUpdate cannot be called more often than the BeginUpdate method. If the method would cause the internal counter to contain a negative value, the RaiseGDBException method is called to raise an exception for the condition.

EndUpdate calls the DoBeforeUpdateEnded method to perform any actions needed when the internal update counter is set to 1. The value in the internal counter is decremented, and the Change method is called prior to exit. Change notifications and the OnChange event handler occur when there are no other nested BeginUpdate calls active.

Modified in LCL version 3.0 to call the DoBeforeUpdateEnded method.

See also

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