Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are the standard looking iOS controls\styles in Delphi XE2?

We are currently in the process of evaluating Delphi XE2, and as you would expect I've started with FireMonkey as OS X and iOS development is of great interest. I've seen a couple of walkthrough's where people have created iOS apps using XE2 and I've managed to do the same, however the bread and butter of 'business applications' on an iPhone (which is how iOS support is being marketed) are buttons, lists, grids and connectivity (REST?).

Anyway, once you've created your iOS HD project the TButton initially looks green, whereas the TSpeedButton and TToolbar looks exactly like it should (blue gradient). The TToolbar doesnt have any way of adding buttons, presumably this is just a Panel, then?

Has anyone created styles for FM iOS HD apps, or do any of the wrappers allow direct creation of the standard iPhone controls?

I apologise if that sounds a little backwards given that I am attempting to evaluate using the trial version (which among other things doesnt provide the source, for obvious reasons!).

Thanks,

Ross

like image 646
Ross Harvey Avatar asked Sep 14 '11 10:09

Ross Harvey


1 Answers

FireMonkey does not have standard iOS or OS X components. It draws all the components on its own, using a complicated set of layered sub-components, which are all editable with the FMX style editor in the IDE (or with a text editor outside the IDE).

So you can mimic the iOS or OS X components with the styles you get with the product or with your own custom styles. But to use the original UIKit/Cocoa Touch components, you'll have to use the FreePascal translations and conversions of the original Apple headers, and not FMX.

There is no designer for such UIs, unless you want to use Xcode 4.x. I don't know if FreePascal can load and use .xib files, though (although, why not? Probably just not automatically). You can, of course, create and place such components in code, at runtime.

So you either:

  • use FMX and design your own styles or modify the existing styles to your need, or
  • use Xcode and .xib files. Not sure how to do that with FreePascal.

FWIW, you can place any FMX component on any other FMX component (e.g. also a textbox on a button on an arcdial on a list item in a listbox), so it should be possible to place buttons on a toolbar. You probably have to take care of their alignment and arrangement, though, and probably also for their behaviour. Use a TLayout, Padding, Margins and alignment for that.

like image 67
Rudy Velthuis Avatar answered Oct 31 '22 18:10

Rudy Velthuis