1

Is there a way to make the Captions in a Delphi TMainMenu display all the way left when there are no images? If there are no images a block of blank space is left in lieu of the image. A good screenshot of what I mean is here. I haven't seen a solution to this minor annoyance. I could of course swap to something like TJVMainMenu, which handles this cleanly, but I would rather not if I do not have to.

Thank you!

Community
  • 1
  • 1
sse
  • 987
  • 1
  • 11
  • 30
  • 3
    The space is not just for the image. The check marks need space too. If you let the system paint the menu then I believe that you have no control. So you'd have to owner draw the menu. It won't look native then. – David Heffernan Jul 05 '15 at 06:02
  • 1
    Take a look at owner drawing the menu items. Take a look here: http://edn.embarcadero.com/article/27128 – AdrianGW Jul 05 '15 at 07:51
  • The menu you show doesn't look very different from native menus of other applications. Look at Notepad, for example. – Rob Kennedy Jul 05 '15 at 13:11
  • @David, It would appear that the best answer would be to utilize OwnerDraw as you suggest. Could you make your comment into an answer? Thank you AdrianGW for the link. – sse Jul 07 '15 at 05:53

1 Answers1

2

The system menu painting always reserves space for a glyph or check. There's no way to avoid that. As a result the only option to have menus without that empty space is to owner draw the menus.

The downside of owner draw is that the menus will no longer appear to be platform native.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490