今天回过头来看,FireMonkey的类结构图整理得有点问题,貌似算法逻辑处理得不对。在我的小程序中,命名空间是作为路径来处理,或许这里会出些例外项。
不过,大体如此。
当然,再深入一些,发现FireMonkey所用的类远不止这些。比如:TDBGridLinkColumn类,在Fmx.Bind.DBLinks.hpp中定义为
class PASCALIMPLEMENTATION TDBGridLinkColumn : public Data::Bind::Dblinks::TBaseDBGridLinkColumn
我在拷贝出来的头文件中上下求索,都没有找到TBaseDBGridLinkColumn类定义,只好回到IDE中,通过Find Declaration来找,结果发现在C:\Program Files\Embarcadero\RAD Studio\9.0\include\windows\rtl\Data.Bind.DBLinks.hpp中。莫非FMX类库又用到了RTL?
看一下帮助
Three major libraries are provided by RAD Studio:
- FireMonkey (FMX) is a visual component library with sophisticated graphics, animation, and styling capabilities. You can create FireMonkey applications that target the Mac OS X, Win32, and Win64 platforms.
- Visual Component Library (VCL) is an object hierarchy of visual components that are supported on Windows only (in Win32 and Win64 applications).
- Run-Time Library (RTL) is a procedural library shared by Delphi and C++, and is supported in OS X applications as well as Win32 and Win64. The RTL is made up of the members of the System, System.SysUtils, System.IOUtils, and System.Classes units.
You can use the RTL in a FireMonkey application, but you cannot use the VCL in a FireMonkey application.
哦,在FireMonkey程序中可以使用RTL类库,但在FireMonkey程序中不能使用VCL类库,纠结啊。
纠结于两点:
一是要学FireMonkey,感觉内容又多了,还得了解一下RTL!
二是之前的VCL程序不能应用FireMonkey技术,如果要使用FireMonkey是否代价会很大?
难怪圣人说:人生绝大部分痛苦来源于不正确的比较。老子思想精髓在于无为而治、愚民政策,要是什么都不知道,只混个肚儿圆,那该多幸福哈。
不过,话说到这里,倒是想给官方一个小建议:既然FMX类库中的类都是用Fmx::表示,如class PASCALIMPLEMENTATION THueAdjustFilter : public Fmx::Filter::TShaderFilter,那么RTL类库中的类是否也用Rtl::来打头,这样更直观了哈,不过代价就是代码敲得多些。
OK,还是着眼重点吧,浅入深出,先会用再说。
下面简单来看看,在FireMonkey类库下,共有Data Fmx Fmxtee Idantifreezebase System Xml六个子目录,Xml应该是处理XML结构,这个比较熟悉,不过令人惊讶的是,在XML目录下,居然有739个类,它都处理什么了?占有一半多的类哈。我之前实现过简版的XML处理,其间只有两个类:TCbwXml与TCbwXmlNode,前者处理XML结构对象与文件,后者处理节点对象,类似于TreeView与TreeNode。嗯,XML这一块可以先略过,以后再看。
其次是Data,这应该是数据相关的,有25个类,先也不急着处理数据吧。
Fmxtee,看名字应该是TeeChart之类的,是输出图表所用,也可以往后放放。
而Idantifreezebase其下只有一个类TIdAntiFreeze,用过INDY的都知道这个类的作用,这里会改吗?
简单看一下定义:
class PASCALIMPLEMENTATION TIdAntiFreeze : public Idantifreezebase::TIdAntiFreezeBase
{
typedef Idantifreezebase::TIdAntiFreezeBase inherited;
public:
virtual void __fastcall Process(void);
public:
/* TIdAntiFreezeBase.Destroy */ inline __fastcall virtual ~TIdAntiFreeze(void) { }
public:
/* TIdBaseComponent.Create */ inline __fastcall TIdAntiFreeze(System::Classes::TComponent* AOwner)/* overload */ : Idantifreezebase::TIdAntiFreezeBase(AOwner) { }
};
应该没啥变化,这个可以不管了。
所以,需要首先着手学习的是Fmx与System两个目录。System目录下有174个类,而Fmx目录下有404个类。
从学习效率上来是,System应该要快些,况且是系统定义相关的东东,理解后对于Fmx的学习应有极大帮助。
所以,FireMonkey学习路线暂定为
System > Fmx > Xml > Fmxtee > Data > Idantifreezebase
现在就开始吧。