The gadget framework automatically generates hint text for TButtonGadget if its ID matches a menu command, provided there is no hint text in the string resources with the same ID.
It would be very cool if the generated hint text also included the keyboard shortcut (accelerator) for the command. And it would be even cooler, if it would synthesise the key sequence for the command using the ampersand mnemonics, if there is no explicit accelerator for the command. For example, "Open (Alt+F,O)" for main menu command "&File | &Open", and "Options (Alt+T,O)" for main menu command "&Tools | &Options".
Anonymous
Except for the key sequence synthesis based on mnemonics, I've now implemented a solution in Owlet (not yet committed, though). This only required updating TDecoratedFrame::GetHintText as follows below. Note that I've changed the functionality a bit as well; the string resource tip text is now preferentially used, if it exists, rather than the other way around in the old code. This allows the user to override the auto-generated tip text, simply by creating a string resource.
Here is code for synthesising key sequences, as proposed. Bing Chat helped me with this. In particular, to find the localised name of the Alt key, I didn't know about the Windows API function GetKeyNameText, which it suggested as a solution rather than creating another string resource (which may not have reflected the language of the user's keyboard).
This feature was implemented in Owlet [r6387].
Related
Commit: [r6387]