
September 19th, 2012, 06:49 AM
|
|
Registered User
|
|
Join Date: Feb 2004
Location: South Africa
Posts: 29

Time spent in forums: 6 h 20 m 44 sec
Reputation Power: 0
|
|
|
Alt Keys / Hotkeys
Hi,
normal buttons don't seem to have an AutoHotKey option in Delphi 7. So I have a custom form class which would be able to adjust the captions of the buttons by inserting the & at the appropriate place (hence auto generating my own hotkeys based on available letters on the form).
My Question: Any suggestions for a efficient algorithm?
My initials thoughts:
1. Start with shortest captions and insert & starting with first available letters. (ie. Button1 and Button2 becomes &Button1 and B&utton2
2. Then, after running through all buttons, we will possibly have some that havent been assigned any & due to none-available letters. Suggest I then run through already assigned captions (starting with longest words) and see if I can find appropriate letter for usage within these already assigned words and (as a result) amend both to find a letter for my current button.
Perhaps this is a subclass of a familiar problem that I dont seem to figure :-)
|