手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>程序设计>delphi>列表

Delphi7建模利器ModelMaker教程 (English,Many Pictures)

来源:互联网 作者:西部数码 时间:2008-04-09
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

Figure 1 — the empty Units View.
There are multiple ways to import a file, but the quickest way is via drag & drop.
In ModelMaker, select the Units View by pressing F4 or by selecting its tab.
Find the unit you wish to import in Windows Explorer and then position ModelMaker so that you can drag the file into MM’s main window.
Drop the unit into the Units View — if you’re in a new project that is empty, the Units View should look like figure 1.

Figure 2 — Units View with imported unit.
Once you have dropped the unit, it will be reverse-engineered. The unit and any classes it contains will be added to the Unit List, which should now look something like Figure 2.
Don’t worry if your icons look a little different — I’ve got some ModelMaker extensions installed that can change the appearance of my screens.
The top-level node in the Unit View treeview represents the unit you’ve just imported. Any child nodes are the classes, interfaces or event types that reside in that unit. You can double-click these nodes to bring up their editors.

Figure 3 — the Member List.
Note that if you select a class in the Unit View, all of its members (properties, methods, etc.) will be displayed in the Member List, which looks something like figure 3.
We’ll cover the Member List in Tutorial 5; for now it’s enough to notice that your class’ members are enumerated here.
Press F3 to switch to the Classes View. You should notice here a hierarchical representation of the classes you’ve imported. Figure 4 is an example.

Figure 4 — the Classes View.
Notice that TObject, IInterface and IUnknown are always present. Note also the appearance of my TtsCustomSplitter class in Figure 4 — this is the ancestor of TtsShutter, which I’ve imported. However because I did not (yet) import the unit containing TtsCustomSplitter, this class must be represented as a “placeholder” (note the dotted lines around the class icon which denote placeholder status.) ModelMaker knows that TtsShutter descends from TtsCustomSplitter, but that’s all it knows. If I wish to be able to use ModelMaker’s features involving inheritance, I’d have to import TtsCustomSplitter’s unit.
ModelMaker is also capable of importing your in-source comments and attaching them to their associated entities, but only if the comments and/or ModelMaker are properly set up to do so. If MM’s Unit Code Editor (F7) shows a mass of unassociated code comments, fear not — we’ll cover importing comments in Tutorial 7.
This is an extremely abbreviated example of how to import existing code. You can also perform imports using one of the two import buttons on the main toolbar.
– this button will import your code into a new model.
– this button will import your code into the existing model.
In both cases, the buttons will give you the option of importing from a specific path or from a Source Path Alias (which we have not covered here). See Source Path Aliases in the ModelMaker help file for more information.
Obviously our ultimate goal is to create code which can be compiled in Delphi. ModelMaker uses its internal code model and applies the various formatting options you’ve selected to generate the specified units.