Example Window can generate AV if Tabbing
- Lazarus/FPC Version: main
- Operating System: all
- CPU / Bitness: all
What happens
In the (new) Examples Window, if you tab into the ListView it does not select a row (although the first row is coloured but not as much as clicking does ???). It user presses Enter, the existing code assumes a row must be valid and AVs in this case.
What did you expect
Makes sense to assume that a user who tabs into ListView and sees a (sort of) highlight on first row wants that Example.
Steps to reproduce
Open (main's) Example Window, press tab key, focus moves to ListView, press Enter - bang. Attached is a patch, from Lazarus root that fixes the AV by forcing selection of first row (if exists, just ignores silly user input otherwise). It also improves handling of the Search Prompt in the EditSearch box so the (eg) "Search Here" is magically removed if user just starts typing. Its what users expect to happen. I have only tested on Linux but nothing there that should be OS dependent.
Patch removed, use one further down.
Davo