Development involves discovering, solving, and discovering problems...
The following is a bug in Firemonkey.
Description in the official document:
Using the FireMonkey TMenuBar's OSMenu Property to Place Your Main Menu for Windows and Mac.
But, the OSMenu attribute cannot be found in XE4.
After testing, we found that,
TMenuBar cannot implement Mac style in Mac;
TMainMenu can;
But the problem has not ended,
If no Item is added to the TMainMenu, everything is normal. However, once there is an Item, the division by zero error occurs when running in Win.
The reason is that the Coordinate Transformation of SetMartix causes LineLength: = 0;
However, the details have not been further explored. The addition of Item items affects the code process and causes this problem.
Note the following:
The Item of TMainMenu cannot be dynamically added to MacOS, but it works normally in Win.
To put it bluntly: cross-platform is a great dream, but today we are one step closer to it. Let's look forward to the arrival of XE5.