In my blogs database program, I added at the beginning of the month some functionality to the 'show entries' form, to remove (i.e. stop displaying) an entry and to show the tags connected to an entry; these were implemented by means of a popup menu, something that I've done many times before.
Over the past few weeks, whilst entering old blogs from 2012/3, I realised that using this functionality requires two clicks (one right click to bring up the menu, one left click to choose the option). I wondered whether I could achieve the same result with one key press. In the 'manager' program, there's some arcane code using accelerator tables, used probably because I wanted this code to be in an ancestor form, from which other forms inherit these definitions. I tried to copy what I did then but couldn't get the code to work.
Then I googled 'delphi accelerator' and discovered that there was a simple solution under my fingertips. All I had to do was set the 'short cut' property of the menu item (i.e. mnRemove, mnShowtags) to a key such as F8 or F9. Once I did this, not only did this key name attach itself to the menu caption, but pressing it activated the menu option.
I might have known this once but if so, I must have forgotten years ago. Another belated discovery.
Blog # | Date | Title | Tags |
---|---|---|---|
222 | Dollhouse 2 | TV series, Olivia Williams, Dollhouse | |
663 | 27/12/2013 | Song festival - the producer speaks | MIDI, Kibbutz, Song writing |
789 | 27/12/2014 | Sebaceous cyst and other health issues | Health |
996 | 27/12/2016 | Puzzle | Puzzles |
No comments:
Post a Comment