Command line option to display menu item names in Delphi 2006

If you’ve ever used the Delphi IDE’s OTA and added menu items to
the IDE’s main menu you’ve probably run into the problem of not knowing IDE menu
item component names which is important because you can use them to help locate
the correct position to place your new item. Well, here in R&D the OTA is
leveraged throughout the IDE and thus we have a similar problem although since
we have the source code it’s pretty easy to grok around a bit and find the name.

To help alleviate this problem I added a developer only (meaning internal to
Borland) feature to the IDE
that allowed you to display the menu item component names on the IDE’s main menu
itself. In D2006, there is a new command line option -showotamenunames which
will enable this feature and display the menu item component names right on the
menu items themselves. Have a look:

This was implemented by creating a descendant of TXPStyleMenuItem and adding
the component name information at the bottom of the item using Small Fonts.
Then, assigning the OnGetControlClass event of the IDE’s TActionMainMenuBar and
returning the new item class when the command line option is specified.

Tag: borland delphi
ide