Link to home
Start Free TrialLog in
Avatar of Edo082297
Edo082297

asked on

Word-style menus

Hello

I would like to know the best way to create the new Word style menus. I refer to the ones that have toolbars with buttons containing menu captions. When the menu caption is pressed, a popup menu appears below it with the menu items. When you scroll your mouse across the other options, the popups all appear below.

I ask this question because I want to ensure that there is not a control requiring a few distinct property settings to accomplish this behaviour, before I write my own component to do this.

Cheers,
Edo
Avatar of Lischke
Lischke

Hi Edo,

fortunately there's already all in Delphi you need for this kind of menu (it is actually the same as the IDE uses, right?). The only thing you won't get is the menu animation, but all other is easy:

1) place a TMainMenu on the form and fill it with items
2) place a toolbar on the same form and create a few buttons
3) select each button and set its MenuItem property to an item of your choice
4) mark each item as grouped to allow for automatic open and close of the submenus when moving the mouse over different main items


Ciao, Mike
Listening
Avatar of Edo082297

ASKER

Hi Mike

Thanks. Do you have any suggestions as to how I could now make the buttons flat (TSpeedButton)? Will I have to write my own TToolButton?

Post as answer, you have met the requirements.

Cheers,
Edo
ASKER CERTIFIED SOLUTION
Avatar of Lischke
Lischke

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I just found it, one just has to set the Flat property to true of the containing toolbar.

I'm not terribly happy with the all or nothing sizes of the buttons, however. Anyway, it's a pretty moot point.

Cheers,
Edo
Ha-ha, our answers crossed.
:-)