c++builderfiremonkeyc++builder-10.1-berlin

How to put menu bar in Apple menu bar in Mac OS by C++ Builder?


I found an example using the TMenuBar.UseOSMenu property to place a main menu for Windows and Mac. But it seems it is only for Delphi. I can't find the same property in FMX's TMenuBar component in C++Builder.

Does anyone know how to put a menu bar in Apple's menu bar on Mac OSX in C++?

I'm using C++ Builder 10.1 Berlin Update 2.


Solution

  • There is no UseOSMenu property in 10.1 Berlin, in Delphi or C++. It was removed in XE3:

    New Units and Changes in FireMonkey XE3

    UseOSMenu has been removed. For multi-platform applications, you should use FMX.Menus.TMainMenu, a nonvisual component

    Also See:

    Using Menus in a FireMonkey Application

    Creating Menus for OS X and Windows

    Use the correct control for your target system (OS X vs. Windows).

    • For Windows applications, use the TMenuBar control:

      • The main menu is placed in the client area of the form (standard for Windows).
      • The menu items are not on the Mac OS X menu bar (nonstandard for OS X).
    • For Mac OS X applications, use the TMainMenu component:

      • The main menu is placed in the non-client area of the Windows form (nonstandard for Windows).
      • Menu items are placed on the Mac OS X menu bar (standard for OS X).