码迷,mamicode.com
首页 > 编程语言 > 详细

FMX中一些delphi与C++ Builder语法的对比

时间:2015-09-15 01:37:43      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:

以前用过BCB6,现在新学开发工具C++ Bulder XE8,发现FireMonkey比较有特色,不过网上CB资料太少,找到几个不错的delphi写的FMX界面的Demo,学习改成了CB的,

语法有些不同,整理如下部分代码,以作对比参考:

Delphi C++ Builder

TButton(Sender).Enabled := false;
SwitchTo3D;
if Assigned(FContainer) then
begin
TAnimator.AnimateFloat(FContainer, ‘Position.Z‘, 300, 0.2);
TAnimator.AnimateFloatDelay(FContainer, ‘Position.Z‘, 0, 0.2, 1);
TAnimator.AnimateFloatWait(FContainer, ‘RotationAngle.Y‘, 360, 1.5, TAnimationType.&In, TInterpolationType.Linear);
end;
SwitchTo2D;
TButton(Sender).Enabled := true;

((TButton *)Sender)->Enabled = false;
SwitchTo3D();
if(FContainer!=NULL)
{
TAnimator::AnimateFloat(FContainer, "Position.Z", 300, 0.2);
TAnimator::AnimateFloatDelay(FContainer, "Position.Z", 0, 0.2, 1);
TAnimator::AnimateFloatWait(FContainer, "RotationAngle.Y", 360, 1.5, TAnimationType::InOut , TInterpolationType::Linear);
}
SwitchTo2D();
((TButton *)Sender)->Enabled = true;

 

FViewport := TViewport3D.Create(Self);
FViewport.Parent := Self;
FViewport.Align := TAlignLayout.Client;
FViewport.Color := claNull;
FContainer := TLayer3D.Create(Self);
FContainer.Parent := FViewport;
FContainer.Projection := TProjection.Screen;
FContainer.Transparency := true;
FContainer.Align := TAlignLayout.Client;
LImg := TImage.Create(Self);
//LImg.Align := TAlignLayout.Client;
LImg.Position.X := rcmain.Position.X;
LImg.Position.Y := rcmain.Position.Y;
LImg.Width := rcmain.Width;
LImg.Height := rcmain.Height;
LImg.Bitmap.Assign(rcmain.MakeScreenshot);
LImg.Margins := rcmain.Margins;
LImg.Parent := FContainer;
rcmain.Visible := False;

FViewport = new TViewport3D(this);
FViewport->Align = TAlignLayout::Client;
FViewport->Color = TAlphaColorRec::Null;
FViewport->Parent = this;
FContainer = new TLayer3D(this);
FContainer->Parent = FViewport;
FContainer->Projection = TProjection::Screen;
FContainer->Transparency = true;
FContainer->Align = TAlignLayout::Client;
LImg = new TImage(this);
// LImg->Align = TAlignLayout::Client;
LImg->Position->X = rcmain->Position->X;
LImg->Position->Y = rcmain->Position->Y;
LImg->Width = rcmain->Width;
LImg->Height = rcmain->Height;
LImg->Bitmap->Assign(rcmain->MakeScreenshot());
LImg->Margins = rcmain->Margins;
LImg->Parent = FContainer;
rcmain->Visible = false;

FreeAndNil(LImg);
FreeAndNil(FContainer);
FreeAndNil(FViewport);

delete LImg;
delete FContainer;
delete FViewport;

FMX中一些delphi与C++ Builder语法的对比

标签:

原文地址:http://www.cnblogs.com/wxfame/p/FMX-CB.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!