FireMonkey is a new multi-platform Delphi component library from Delphi XE2. It's VCL alternative. VCL will be still improved and maintained in future, but is fixed to Windows only. FireMonkey exists for Windows, Mac OSX and iOS, Linux and Android will be added in future (with other mobile platforms).
Unlike CLX (QT based), is FireMonkey created in Object Pascal (based on KSDEV) and use GPU hardware - on Windows Direct2D or GDI+, on MAC OpenGL (for Linux maybe too), for iOS OpenGL_ES (for Android in future probably too).
All is "CustomDraw" and Windows management operations (or mouse and so on) are handled with Platform instance and passed to OS. So about 90% of source code is OS independed.
FireMonkey HD is project for 2D app.
Style is basic
When compare FireMonkey and VCL: VCL is more complex, but during XE2 livetime is expected several updates (first one in end of September as Michael Swindell said).
FireMonkey is created with different idea - nothing is fixed. This means (for example) that difference between TButton and TCheckBox is in graphic representation (and setting some property) - both is painted, but differently. Of course - style can be changed.
For example: you can draw TCheckBox as button or something complete different (U admit that there is a problem for me to think this way, but I try to) - everything is vector based. All is dynamic - checkbox can be checkbox until mouse over, in this moment simple change "Style". Every control has property StyleLookup, which is can be used for alternate normal style. "Normal style" is different for different OS.
Please look at important extension to Align - there is drop down combo box on screenshot.
Style is important part of FireMonkey. For example this definition of TListBox item. Style is defined in TStyleBook component.
In designeru can be defined tree of item from screenshot (CustomItem). Please look at selected item - it is checkbox with special style. Style can be defined per control, eg. TCheckBox can look normal, but next checkbox can look completely different.
Definition of style for checkbox.
And how can look this at the runtime?
Create one item.
1procedure TfrmCustomList.Button2Click(Sender: TObject);
3 Item: TListBoxItem;
6 Item := TListBoxItem.Create(nil);
7 Item.Parent := ListBox1;
9 Item.OnApplyStyleLookup := DoApplyStyleLookup;
11 Item.StyleLookup := 'CustomItem';
14procedure TfrmCustomList.DoApplyStyleLookup(Sender: TObject);
16 B: TBitmap;
17 Item: TListboxItem;
19 Item := TListBoxItem(Sender);
21 B := TBitmap.Create(10 + random(50), 10 + random(50));
22 B.Clear($FF000000 or TAlphaColor(random($FFFFFF)));
24 Item.Binding['image'] := ObjectToVariant(B);
25 Item.Binding['text'] := 'item ' + IntToStr(Item.Index);
26 Item.Binding['resolution'] := IntToStr(B.Width) + 'x' + IntToStr(B.Height) + ' px';
27 Item.Binding['depth'] := '32 bit';
28 Item.Binding['visible'] := true;
29 Item.Binding['visible'] := EventToVariant(DoVisibleChange);
30 Item.Binding['info'] := EventToVariant(DoInfoClick);
35procedure TfrmCustomList.DoInfoClick(Sender: TObject);
37 InfoLabel.Text := 'Info Button click on ' + IntToStr(ListBox1.ItemIndex) + ' listbox item';
40procedure TfrmCustomList.DoVisibleChange(Sender: TObject);
42 InfoLabel.Text := 'Checkbox changed ' + IntToStr(ListBox1.ItemIndex) + ' listbox item to ' + BoolToStr(Listbox1.Selected.Binding['visible'], true);
With this as FireMonkey conceived, can be quite easily compose components on form.
There is in one button another button with checkbox. User (for example) can click on outer button or inner button, position of inner button is relative to bounds. This works exactly for another components.
In FMX.Types is defined
// On low-end hardware or mobile bitmap effects are slowly
GlobalDisableFocusEffect: Boolean = False;
// Use Direct2D in Windows Vista or Windows 7 by default
GlobalUseDirect2D: Boolean = True;
// Use Direct2D in Windows Vista or Windows 7 in software mode
GlobalUseDirect2DSoftware: Boolean = False;
// Use HW accelerated effect if possible
GlobalUseHWEffects: Boolean = True;
VCL and FMX
You can show FMX dialog from VCL app (another direction can be a problem). From another IDE instance create new FMX form and from VCL project simple add this unit (please warning ignore).
Last remark: There is big EXE size difference between debug and release version of your program (10MB x 3MB).