Wednesday, November 30, 2005

[Delphi] Avoid Auto Generated Accelerator Key in ActionList

To my greate pleasure, my coursework, a PL/x compiler, is basically completed. It can now compile/run a program prints all prime numbers within 1-100.

Then, I plan to build a proper IDE for it. I get two powerful tools -- SyncEdit and ActionManager. SyncEdit is an open-source VCL component, I guess whether such apps like Ultra-Edit use this component. ActionMananger is a better choice than ActionList + ToolBar + Menu. ActionManager behaves just the same as MS Office Toobars/Menus. All the stuffs are based on actions and item on display can be customized. For example, add/remove buttons on toolbar or menu, hide/show toolbar, re-arrange toolbars...

One problem I met with is the auto-generated accelerator-key provided by delphi. If I don't define a (&*) key in the caption property of an TAction object, Delphi will provide one in alphabit-reverse sequence. That's annoying sometimes.

However, I find out a way to get away from them: append a '&' char at the end of each action caption.