delphi xe2 的firemonkey 是跨平台的,暂时只准备看看他在windows下(32)的应用情况
狠心的东西,相信有了它,已有的界面将会更加灵活,漂亮,也会淘汰掉诸多皮肤,透明,图像等第三方控件,但不知和win8的winrt有无关联。
为了他,delphi xe2的诸多单元加了前缀,诸如 :
bd,data,datasnap,fmx,ib,macapi,macapi,posix,soap,system,system.bindings,system.generics,system.internal,system.mac,system.win,vcl,winapi,xml..
这样也好,单元类别一目了然,和firemonkey相关的单元有
fmx.ani.pas
fmx.ase.importer.pas
fmx.ase.lexer.pas
fmx.ase.model.pas
fmx.canvas.d2d.pas
fmx.canvas.gdip.pas
fmx.canvas.mac.pas
fmx.colors.pas
fmx.consts.pas
fmx.context.dx9.pas
fmx.context.mac.pas
fmx.controls.pas
fmx.dae.importer.pas
fmx.dae.model.pas
fmx.dae.schema.pas
fmx.dialogs.pas
fmx.edit.pas
fmx.effects.pas
fmx.extctrls.pas
fmx.filter.effects.pas
fmx.filter.pas
fmx.filtercatblur.pas
fmx.filtercatcolr.pas
fmx.filtercatcoloradjust.pas
fmx.filtercatcomposite.pas
fmx.filtercatdistortion.pas
fmx.filtercatgenerator.pas
fmx.filtercatgeometry.pas
fmx.filtercatstyle.pas
fmx.filtercat.tiles.pas
fmx.filtercattransition.pas
fmx.forms.pas
fmx.grid.pas
fmx.import.pas
fmx.layers3d.pas
fmx.layouts.pas
fmx.listbox.pas
fmx.memo.pas
fmx.menus.pas
fmx.obj.importer.pas
fmx.obj.model.pas
fmx.objects.pas
fmx.objects.pas
fmx.objects3d.pas
fmx.platform.mac.pas
fmx.platform.pas
fmx.platform.win.pas
fmx.printer.mac.pas
fmx.printer.pas
fmx.printer.win.pas
fmx.tabcontrol.pas
fmx.treeview.pas
fmx.types.pas
fmx.types3d.pas
fmx.video.mac.pas
fmx.video.pas
fmx.video.win.pas
firemonkey自成体系,有自己的tapplication,tcontrol等和vcl对应的大多数构件,但基本还是根植与早期的tcomponent,应该属于vcl的深度扩展
zaiwindows下创建firemonkey工程可建立firemonkey hd application(2d) 或
firemonkey 3d application,然后可以随意添加firemonkey hd form 或者 firemonkey 3d form,其窗体文件的后缀是fmx
例子:
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs;
type
TForm1 = class(TForm)
Button1: TButton; //现在的 TButton 来自 FMX.Controls 单元
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage('Hello FireMonkey!'); //现在 ShowMessage 方法来自 FMX.Dialogs 单元; 底层实现不同但用法一样, 太好了
end;
end.