Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi: MainMenu and ToolBar. Alternative of CoolBar

I use a Toolbar as a MainMenu!

I embed a MainMenu into a ToolBar. But the text of the MainMenu (button's captions) is not in the center of ToolButtons.

I have: enter image description here

I need: enter image description here

I create a ToolBar, 4 ToolButtons and assign each menu for each button. Or I assign a MainMenu in "Menu" of a ToolBar. When I create a ToolBotton then it's caption is already at the bottom. Does nobody have the same?

After all these I will embed the ToolBar as the MainMenu into a CoolBar. Finally, I will have the same as in Windows Firewall.

Are there alternatives to have the same effect like the CoolBar of Windows Firewall (with the MainMenu + a break-line + ToolButtons of the ToolBar)? I use Delphi 2010.

How to do this? How to use properly a MainMenu in a ToolBar? Thanks!

P.S. Another example and it is not from Windows: enter image description here

and how to copy the last example...

like image 462
maxfax Avatar asked Nov 05 '22 19:11

maxfax


1 Answers

Here's what might help:

  1. Drop an empty TImageList on the form.

  2. Assign it to the ToolBar.

  3. Set ToolBar.List to True.

  4. Adjust ImageList.Height to your taste.

This will result in the buttons adjusting their heights to the ImageList.Height value and their captions getting centred vertically.

like image 65
Andriy M Avatar answered Nov 09 '22 05:11

Andriy M