- Delete is a method used to delete the list item specified in AItem. + Delete is a method used to delete the list item specified in AItem.
- In Delphi, Delete is called in reaction to Items.Delete. But if you call it directly, it will also do the actual deletion and then call the OnDeletion handler. We simply call Items.Delete and this will then call Delete again and in the second run we call the OnDeletion handler. Not 100% Delphi compatible, but more compatible then it was before. (BB) + In Delphi, Delete is called when Items.Delete is executed. The OnDeletion event handler is signalled each time the method is called, even when list items are freed from the Items container. +
++ The Lazarus implementation differs. It uses a flag value in AItem to determine if themethod has been called when the list item is freed, or when the Delete method in the list item has been called explicitly. +
++ Delete is called from the DoDeletion method if an overridden Delete method has been implemented. The OnDeletion event handler is signalled when Delete has been explicitly called, and when the Delete method has not been overridden. +
++ While not 100% Delphi compatible, it is more compatible than previous LCL versions.
+ DoDeletion ensures an overridden Delete method in a descendent class is always executed for the list item in AItem. If the method has been overridden, the OnDeletion event handler is signalled (when assigned). +
++ DoDeletion is called from ItemDeleted, and occurs after the value in LastSelected has been updated. +
++ DoInsert ensures an overridden Insert method in a descendent class is always executed for the list item in AItem. If the method has been overridden, the OnInsert event handler is signalled (when assigned). +
++ DoInsert is called from the ItemInserted method which occurs when the list item is stored in the Items property. +
+