Duplicate the menubar (for OS X) and move all AppleMenuItems to the Help menu item - in the order you want them to appear on the application menu on OS X. In the App.Open event replace the menubar in a #if TargetCocoa clause. Of course you would have to update the duplicate if the menubar is updated in the IDE.
Create and add the items dynamically in the order you want them in the application menu on OS X and insert them at the correct place in the menubar programmatically.
On Windows, the “About” is located in a “?”-Menu which is always the last one
On Windows the Update-Check is often located in the File-Menu
And then you have a menu order like File Edit ?
And the result is “Check for Updates” comes first, “About” second. And that’s very inflexible and not useful when developing for different platforms[/quote]
You can have several menu bars and select them in each window with
Self.MenuBar = New MainMenuBar
So you can design the menu bar for Windows, the one for Linux and the one for Mac, then switch automatically in your app with
#If TargetWin32 then
Self.MenuBar = WinMenuBar
#Elsif TargetMacOSX then
Self.MenuBar = MacMenuBar
#Elseif TargetLinux then
Self.MenuBar = LinuxMenuBar
#Endif
You end up having to do ALL of the menu bar enabling dynamically
You cannot use the name of the menu items as though it is / was a globally available item
Just try :
create a new desktop project
remove the menu bar assignment from app & window1 (set them both to none)
add a new menu bar (menubar1) with some new top level and menu items (mine are cleverly UntiledMenu then UntitledItem)
in window1.open put
me.menubar - menubar1 // it won’t matter which here
in window1.enablemenuitems try
untitledItem.enabled = true
[quote=106249:@Norman Palardy]2) remove the menu bar assignment from app & window1 (set them both to none)
[/quote]
Why remove the default bar ?
And, while your demonstration indeed generates an error, my suggestion was not to have different menu items in the menu bars, but the very same ones, only placed in different menus. Just to make sure for instance About goes into Help on Windows and into the Apple Menu on Mac.
[quote=106290:@Michel Bujardet]Why remove the default bar ?
And, while your demonstration indeed generates an error, my suggestion was not to have different menu items in the menu bars, but the very same ones, only placed in different menus. Just to make sure for instance About goes into Help on Windows and into the Apple Menu on Mac.
Keep it simple is key :)[/quote]
You’ll still have issues
Really