Question

Testing the different options of platform targets i have found this information on the delphi xe5 help:

Note: You cannot set OS X as the target platform for a Metropolis UI application.

FireMonkey Metropolis UI Application

I have searched for more answers on that and could not find what is the real reason it is not permited.

I would like to have the same looking of the application on windows and android tablet. (I know that I can use a "regular" FMX app and make that other way, however I have no idea what are the restrictions, since I believed FMX should be always crossplatform, considering just plain FMX app)

EDIT: My final objective for my current project is to create an application with the look and feel of Win Metro, but not WinRT compatible, and use this app on Win32(XP/7/8) and Android Tablets. I dont want to follow ANY platform specific rules, only have the closest possible working behavior as the Delphi generated win32 application.

Était-ce utile?

La solution 2

Metropolis UI is a hybrid system that uses IPC with a WinRT process. The WinRT process is used to display tiles and whatever else is needed over in WinRT land. This can only exist on a system that runs WinRT. Which means Windows 8 and not Mac or the mobile platforms.

It is true that you can build and run Metropolis UI apps on Windows 7 so clearly they can exist without the WinRT part. But the entire purpose on Metropolis UI is to be able to launch fake WinRT lookalike Delphi apps from the WinRT subsystem. So they don't really make sense anywhere else. I don't see any reason why Embarcadero would have invested effort making Metropolis UI apps work anywhere that does not have WinRT.


What you could do is use the style part of an FMX Metropolis UI project. That would give you the visual look that you are after. It would not be a Metropolis UI project, but would look as you wish. So you make a standard FMX desktop application targeting OSX. Then apply your chosen Metropolis style. This certainly works for desktop applications and I see no reason why it won't work for an Android tablet application.

Autres conseils

Different platforms use different backend frameworks and have different UI requirements. That is why you cannot add OSX to a Metro project (OSX is not a Metro platform), just like you cannot add OSX to a Mobile project (OSX is not a mobile platform) or a Mobile platform (iOS/Android) to a Desktop project (they are not desktop platforms). Do not try to create a single application project that supports every UI platform that Delphi supports (a package project is a different matter - you can create multi-platform packages). You will need to create separate projects - a Metro project for Metro UIs, a desktop project for desktop UIs, and a mobile project for mobile UIs. You can share source files between them, but you should not share UI Forms between them. Use platform-appropriate UIs instead.

Just open the style(*.style) file in a text editor. And you will see some thing like :

PlatformTarget = '[MSWINDOWS][MODERN][DEFINEFONTSTYLES]' 

And then just add the Platform you need.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top