As we have talked about buttons on list view items, you may now ask how event handling should be dealt with, for example, to react to the user clicking or tapping on an item's text button.
Generally speaking, you are always clicking on the item, even if you are aiming to click on a specific part (a specific drawable) of it. The TListView class provides you with some convenient events you can handle in order to implement the desired behavior:
- OnClick / OnDblClick: These are very standard events to capture the click/double-click on the whole TListView component. No specific information is provided within the event handler, so you can only rely on properties such as TListView.Selected, but beware of timing (at the point when you are clicking on an item, the Selected property will still refer to the previously selected one).
- OnItemClick: The event handler for this event will be supplied with a reference...