Search code examples
macosdelphimenuitemdelphi-xe2firemonkey

How to create subitems menus under the application name on OSX?


How to add TMenuItem under Project1 and above Quit on the screenshot below?

enter image description here

I have created a TMenuBar with property UseOSMenu checked. The first TMenuItem I added is the second one in the main bar...


Solution

  • You can do this by assigning a TMenuBar of IItemsContainer implementing class to the Application.ApplicationMenuItems property.

    Example:

    If there was a menu bar component on the form called MenuBar1, then you would just call the following in your forms constructor (or OnCreate).

    Application.ApplicationMenuItems := Menubar1;

    You can then have a second TMenuBar component to define the other menu items.

    I'd point you to the wiki topic on the ApplicationMenuItems property, but it has no additional help...

    http://docwiki.embarcadero.com/VCL/XE2/en/FMX.Forms.TApplication.ApplicationMenuItems