Sign in Join
Wiki copytemporary

Lazarus For Delphi Users/ja: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11この記事は、Lazarusに興味があり、すでにDelphiは知っている、という人々向けのものです。 この二つの違いについて記述しています。
22
33## DelphiからLazarusへ
44
55Lazarusは Delphiと同じく、RAD(Rapid Application Development、手早くアプリケーションを開発できる)ツールの一つです。ビジュアルなコンポーネントライブラリと、IDEがあります。Lazarusのコンポーネントライブラリ(LCL)はDelphiのVCLととても似ています。ほとんどのユニットと、クラスと、プロパティは、同じ名前と機能をもっています。これは、移植を簡単にします。しかし、Lazarusは'オープンソースのDelphiクローン'ではありません。ですから、100%の互換性を期待しないでください。
66
77### 最大の相違点は?
88
99Lazarusは完全にオープンソースで、プラットホームに対し独立しており、強力な[[Free Pascal|Free Pascalコンパイラ]](FPC)を使っています。FPCは15以上のプラットホームで動作します。しかし、すべてのパッケージやライブラリが移植されているわけではありません。ですから、Lazarusは現在のところLinux,FreeBSD,MaxOSX、そしてWin32上で動作します。(訳注:いくつかのPDAでも暫定的な動作はします。日本語に関する処理の改善に、これから皆さんの力を必要としています。)
1010
1111**Lazarusは、この文章がまたそうであるように、常に未完です。私たちはいつでも、新しい開発者、パッケージ管理者、移植者、ドキュメントの執筆者を募っています。**
1212
1313### Delphi のプロジェクトを Lazarus 用に変換するためにまず必要なこと
1414
1515Lazarus を起動し、 **Tools** メニューから **Convert Delphi Project to Lazarus Project** を選んで下さい。これで全てが解決する訳ではありませんが、大変役立つはずです。Lazarus IDE の変換ツールは一般に一方通行であり、逆の変換はできないことに注意して下さい。プロジェクトを Delphi でも Lazarus でもコンパイルできるように Delphi との互換性を維持する必要がある場合は、Lazarus IDEではなく [XDev Toolkit](http://wiki.lazarus.freepascal.org/XDev_Toolkit) の利用を考えて下さい。
1616
1717### ユニコードのサポート
1818
19192007バージョンまでの Delphi はユニコードをサポートせず、Windows が利用していた ANSI エンコーディングを採用していました。2008バージョン以降の Delphi はユニコードをサポートするようになり、UTF-16 を用いて文字列をエンコードしています。
2020
2121一方、Lazarus は UTF-8 を用いたユニコードサポートを始めました。詳しくは [[LCL Unicode Support]] を御読みください。.
2222
2323## Delphi IDE から Lazarus IDE へ
2424
2525### プロジェクト
2626
2727Delphiアプリケーションのメインのファイルは .dprファイルです。Lazarusにおいては、.lpiファイルです(=Lazarus Project Information)。 .dprファイルはメインのソースプログラムであり、DelphiのIDEはコンパイラスイッチやユニットなどの情報の一部を入れます(訳注:すべてではない。オプションファイルなどがある)。Lazarusのアプリケーションもメインのソースファイルを.lprファイルに入れます。しかし、そのほかのすべての情報をも入れます。ですから、.lpiファイルはとても重要です。
2828
2929例: Delphiはユニットへのパスを.dprファイルに入れます。たとえば、unit1 in 'path/Unit1.pas'というふうにいれます。このinでパスを指定する方法はDelphi独特であり(Pascalの文法ではないので)、Lazarus IDEは読むことができないので、こういう方法をつかわないでください。かわりに、コンパイラオプションで、ユニットパスを指定してください。
3030
3131Delphiはコンパイラオプションを.dprファイルに埋め込みます。たとえば、{\$APPTYPE CONSOLE}.というふうにいれます。Lazarus IDEでは、これらは無視されますので、使わないで下さい。かわりに、コンパイラオプションを使ってください。
3232
3333(訳注:DelphiのdprファイルはPascalの仕様+独自の部分が結構多いですが、Free Pascal Compiler上のLazarusとしては、Free Pascalに特殊な言語拡張をなるべく行わず、純粋にFree Pascal上に実現できるような方法がとられています。Delphiのようにコンパイラオプションを至る所に定義できるのは、便利でもある一方、スキャンしていかないと、有効か無効かが分からず、バグや全体のみとおしが悪くなる両刃の剣といえますので、訳者は良い仕様だと思います。)
3434
3535ひとつ重要なルールがあります。それは、*常に*プロジェクトは存在するということです(訳注:IDEが起動している最中に、ということでしょう)。 現在のプロジェクトを"close"する方法は、lazarusを終了するか、他のプロジェクトを開くしかありません。 これは、lazarusのプロジェクトはセッションとしての役割があるからです。これは、現在のエディタの設定が、.lpiファイルに記録され、そのプロジェクトを開いたときに再開できるようになっています。たとえば、あなたがアプリケーションをデバッグしていて、多くのブレークポイントやブックマークを開いていたとしましょう。あなたは、いつでもプロジェクトを保存することができ、lazarusを終了したり、他のプロジェクトを開くことができます。その、デバッグ中に保存したプロジェクトを開くと(たとえ他のコンピュータで開いたとしても)、ブレークポイント、ブックマーク、開いていたファイル、カーソル位置、ジャンプヒストリ、などといったものが、復元できます。
3636
3737### ソースエディタ
3838
3939ほとんどすべてのキーとショートカットが、enviroment -\> editor options-\>key mappingsで定義可能です。 LazarusのIDEには、ソースのための沢山のツールがあります。それらの多くは、Delphiと見た目も似ており、よくにた働きをします。しかし、一つの重要な相違点があります。すなわち、Lazarusはコード情報を取るために、コンパイラを利用しない、ということです。ソースコードを直接解析します。こうすることで、沢山の重要な利点があります。
4040
4141ソースエディタは、"comments"と一緒に動作します。Delphiにおいては、ソース中のコメントは、コードの間の場所にあるものにすぎません。自動でコードが挿入されても、特別な働きはしないので、すでに入れたコメントは迷子になってしまうかもしれません。Lazarusでは、コメントの中のコードでさえ、宣言を見つけることができます。 これは、完璧に信頼できるものではないかもしれませんが、よく役に立ってます。新しいコードが挿入されると、IDEは発見的な方法を使ってコメントとコードを結び付けます。たとえば、"c: char; // comment"という行は分割されることはありません。
4242
4343Delphiの"コード補完"(Ctrl+Space)機能は、Lazarusでは、"Identifier Completion"と呼ばれます。Lazarusにおいて、コード補完は、"自動的なクラス補完"(Delphiとおなじです)、"ローカル変数補完"、"イベント割り当て補完"のあわせた機能です。これらのすべては、Ctrl+Shift+Cで呼び出され、IDEは、カーソルの位置から、何をなすべきか決定します。
4444
4545#### ローカル変数補完の例
4646
4747ちょうど新しいメソッドを作り、"i:=3;"という命令を書いたとしましょう。
4848
4949`procedure TForm1.DoSomething;`\
5050`begin`\
5151`  i := 3;`\
5252`end;`
5353
5454識別子"i"の上にカーソルをおいて、Ctrl+Shift+Cを押すと、次のようになります。
5555
5656`procedure TForm1.DoSomething;`\
5757`var`\
5858`  i: Integer;`\
5959`begin`\
6060`  i := 3;`\
6161`end;`
6262
6363#### イベント割当補完の例
6464
6565オブジェクトインスペクタの良い機能のひとつに、自動的にメソッドを作ること、があります。ソースエディタでやってみてください。
6666
6767たとえば:
6868
6969`Button1.OnClick:=`
7070
7171代入演算子":="の後で、Ctrl+Shift+Cを押してみてください。
7272
7373#### 手続呼出補完の例
7474
7575今 "DoSomething(Width);" という文を書き終えた所だとします:
7676
7777``` pascal
7878procedure SomeProcedure;
7979var
8080 Width: integer;
8181begin
8282 Width:=3;
8383 DoSomething(Width);
8484end;
8585```
8686
8787識別子 "DoSomething" の上にカーソルを置いて、Ctrl+Shift+C を押すと、こうなります:
8888
8989``` pascal
9090procedure DoSomething(aWidth: LongInt);
9191begin
9292
9393end;
9494
9595procedure SomeProcedure;
9696var
9797 Width: integer;
9898begin
9999 Width:=3;
100100 DoSomething(Width);
101101end;
102102```
103103
104104#### 語彙補完 Ctrl+W
105105
106106識別子補完と似ていますが、パスカルの識別子に対してではなく、すべての語彙に対して補完します。あなたが開いているすべてのファイルの中から、あなたがタイプし始めた文字が同じものの語彙をリストアップし、選択できます。
107107
108108#### インクルードファイルのサポート
109109
110110Delphiではインクルードファイルをサポートしていませんので(訳注:\$iがあるので、補完機能が、ということだろう)、多分、みなさんは多くのインクルードファイルを今までに作っていないかもしれません。しかし、インクルードファイルには、大きな利点があります。それは、IFDEFでソースコードを汚さずに、プラットホーム独立なコードを書けるということです。 Lazarusでは、メソッドジャンプ、クラス補完、宣言を見つける、など、すべての機能は、インクルードファイルに対しても働きます。 また、コーディング機能にいろんなオプションがあります。
111111
112112### デザイナ
113113
114114\- ガイドライン
115115
116116#### オブジェクト・インスペクタ
117117
118118DelphiとLazarusのIDEでは、オブジェクトインスペクタはコンポーネントプロパティを編集したり、イベントを設定したりするのに使われます。使い方に、いくつかの小さな違いがあります。
119119
1201201. Delphi5を起動すると、オブジェクトインスペクタのなかで、階層にしたがって伝統的なドロップダウンリストでオブジェクトを選択できるオブジェクトツリービューがあります。Lazarusでは、これは、オブジェクトインスペクタの一部にすぎません。デフォルトのドロップダウンリストのかわりに、右クリックで表示される"Show Component Tree"メニューを使うこともできます。
1211212. Delphiでは、空のイベントでダブルクリックすると、自動的にイベントを作成し、ソースエディターがその位置を開きます。Lazarusは右側にボタンがあり、ドロップダウンでイベントを作成することができます。
1221223. Delphiでは、つけられたイベント名は手で消さなくてはなりませんが、Lazarusでは、"(None)"をドロップダウンで選ぶことができます。
1231234. Eventと同じように、booleanのような標準的なプロパティをダブルクリックすることでは、値は変化しません。値を変えるには、ドロップダウンで選択する必要があります。そして、エディターフォームで結び付けられているものを開くには、editやdrop-downの右側にある'...'ボタンをクリックする必要があります。
124124
125125#### パッケージ
126126
127127LazarusはDelphiのパッケージをインストールして使うことはできますか?
128128
129129いいえ、なぜなら、それには、Delphiのコンパイラマジック(訳注:Pascalではない部分の特殊な文法)が必要だからです。
130130
131131私たちは、Lazarus向けに特別にパッケージを作りたいのですが?
132132
133133はい。新しくパッケージをつくり、パッケージソースディレクトリに保存してください。 通常は dpkファイルと同じディレクトリです。そして、LCLを必要とするパッケージとして加えて、最後に.pasファイルを加えてください。それを今すぐインストールしたり、プロジェクトで使うことができます。 LazarusとDelphiのパッケージで、いくつかの違いがありますので、lazarusのソース内のdocs/Packages.txtを読んでください。
134134
135135### VCL から LCL へ
136136
137137VCLとLCLは、ともに、高速なアプリケーション開発向けの、オブジェクト指向の階層的なコンポーネントのライブラリです。しかし、それらは同じではありません。 たとえば、VCLは多くの非ビジュアルなコンポーネントを含みます。一方、LCLは、[[Free Pascal|Free Pascalによって]]、多くの「ビジュアルでない」コンポーネント(データベースアクセスなど)が提供されていますので、ビジュアルなコンポーネントのみ、を提供しようとしています。 (訳注:データベースの表示については、ビジュアルである。そのなかで使われるデータベースアクセス自体はLCLコンポーネント内に統合されていると思われる)
138138
139139加えていうと、VCL等にある多くのコントロールが、LCLには存在しないかもしれませんし、同じようなコントロールが両方に存在する場合でも、それらはクローンではありません。 ですから、もし移植をするなら、アプリケーション、コンポーネント、およびコントロールのそれぞれで変更が必要です。
140140
141141次のことはDelphiユーザのために、DelphiとLazarusの主要な違いや、互換性のない所を、包み隠さずに明らかにしようとするものです。これは、主にD4でのVCL(D5,D6,D7も同様です)と、現在のCVSに、あるがままのLCLの違いをカバーしました。あなたがいつも使っているDelphiやLCLのバージョンに完全に一致しないかもしれません。もし、これらの記述が正確でないとすれば、他の皆さんの理解のために、ご自由に記述を加えたり、変更してください。
142142
143143#### TControl.Font/TControl.ParentFontについて
144144
145145VCLでは、コントロールにフォントのプロパティとして、ボールドやイタリック、特定のフォント名と等を使用し、通常はこの値がいつも子へと引き継がれていきます。 さらに、コントロールがいつもParentのフォントを確実にする継承するために、TControl.ParentFontプロパティを提供しています。 OSにウインドウの見え方の設定があるのですが、コントロールのプロパティが常時優先されるということを暗に決めてつけてしまっています。
146146
147147(訳注:Windowsで画面で大きい文字などが選択できるが、他のデスクトップではもっと多くのことが指定できるものがあるので、Delphiにおいてもシステムフォントを取得することが望ましい、とされる場合もあるが、きっちりデザインが難しくなる。)
148148
149149このフォントについての機能、解釈はLCLでは、異なっています。 現実にクロスプラットフォーム/クロスインタフェースであるLCLは、バランスのとれた手法を好んで採用しようとしています。LCLは、いつでも、どんなウィジェットでのネイティブのDesktop/ツールキットのApearance、Theme設定も使用しようとします。 例えば、テーマが、ボタンのための特定の字体を供給するGTKインタフェース、およびgtkを使用することがありますが、LCLボタンはいつもこのテーマに沿った字体を使用します。
150150
151151このことは、ほとんどのLCLコントロールはVCLで当たり前になっている、設計上のフォントなどの管理機能は持っていない、ということです。 しかし、もし、この仕様を変更したければ、使用されるインターフェースにかかわらず、この様に統一的に割り当てられたインタフェースに代わり、Canvasに独自で描画するカスタムコントロールを使うことができます。
152152
153153例えば太字や、特別な色の字体のLabelが必要な場合、代わりにTStaticTextを使用しなければなりません。 なぜなら、TLabelは特定のコントロールのインタフェースであり、すべてのインタフェースのネイティブなバージョンを供給するのであるならば、その大部分は、すべての環境が考慮されないかもしれない、デフォルトの設定が利用されるでしょう。
154154
155155#### ドラッグとドッキングの制御
156156
157157VCLでは、実行中に、例えば1個のパネルからコントロールをドラッグして、別のパネルにドッキングできるように、ほとんどのTWinControlからの派生コントロールは、ドラッグ、ドッキングを制御する機能が組み込まれています。
158158
159159この機能はLCLでは、現在、未完成であり、実装されていません。現在、設計の初期段階です。このタイプのふるまいが、同じような方法で、同等のレベルの互換性を維持するように、最終的には、サポートしてくれると思います。
160160
161161これは、現在、どんなControlも以下のTControlの機能、プロシージャ、プロパティを継承していない、使っていない、ということを意味します。
162162
163163``` pascal
164164Protected
165165 function GetDockEdge(MousePos: TPoint): TAlign;
166166 function GetDragImages: TDragImageList;
167167 function GetFloating: Boolean;
168168 function GetFloatingDockSiteClass: TWinControlClass;
169169 procedure DoEndDrag(Target:TObject); X, Y: Integer);
170170 procedure DockTrackNoTarget(Source: TDragDockObject; X, Y: Integer);
171171 procedure DoEndDock(Target: TObject; X, Y: Integer);
172172 procedure DoDock(NewDockSite: TWinControl; var ARect: TRect);
173173 procedure DoStartDock(var DragObject: TDragObject);
174174 procedure DragCanceled;
175175 procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState;
176176 var Accept: Boolean);
177177 procedure DoEndDrag(Target: TObject; X, Y: Integer);
178178 procedure DoStartDrag(var DragObject: TDragObject);
179179 procedure DrawDragDockImage(DragDockObject: TDragDockObject);
180180 procedure EraseDragDockImage(DragDockObject: TDragDockObject);
181181 procedure PositionDockRect(DragDockObject: TDragDockObject);
182182 procedure SetDragMode(Value: TDragMode);
183183 property DragKind: TDragKind;
184184 property DragCursor: TCursor;
185185 property DragMode: TDragMode;
186186 property OnDragDrop: TDragDropEvent;
187187 property OnDragOver: TDragOverEvent;
188188 property OnEndDock: TEndDragEvent;
189189 property OnEndDrag: TEndDragEvent;
190190 property OnStartDock: TStartDockEvent;
191191 property OnStartDrag: TStartDragEvent;
192192public
193193 function Dragging: Boolean;
194194 function ManualDock(NewDockSite: TWinControl; DropControl: TControl;
195195 ControlSide: TAlign): Boolean;
196196 function ManualFloat(ScreenPos: TRect): Boolean;
197197 function ReplaceDockedControl(Control: TControl; NewDockSite: TWinControl;
198198 DropControl: TControl; ControlSide: TAlign): Boolean;
199199 procedure BeginDrag(Immediate: Boolean; Threshold: Integer);
200200 procedure Dock(NewDockSite: TWinControl; ARect: TRect);
201201 procedure DragDrop(Source: TObject; X, Y: Integer);
202202 procedure EndDrag(Drop: Boolean);
203203 property DockOrientation: TDockOrientation;
204204 property Floating: Boolean;
205205 property FloatingDockSiteClass: TWinControlClass;
206206 property HostDockSite: TWinControl;
207207 property LRDockWidth: Integer;
208208 property TBDockHeight: Integer;
209209 property UndockHeight: Integer;
210210 property UndockWidth: Integer;
211211```
212212
213213that the following classes do not exist/are unusable -
214214
215215``` pascal
216216TDragImageList = class(TCustomImageList)
217217TDockZone = class
218218TDockTree = class(TInterfacedObject, IDockManager)
219219TDragObject = class(TObject)
220220TBaseDragControlObject = class(TDragObject)
221221TDragControlObject = class(TBaseDragControlObject)
222222TDragDockObject = class(TBaseDragControlObject)
223223```
224224
225225下記の関数も、利用できないか、互換性がありません。
226226
227227``` pascal
228228function FindDragTarget(const Pos: TPoint;
229229 AllowDisabled: Boolean) : TControl;
230230procedure CancelDrag;
231231function IsDragObject(sender: TObject): Boolean;
232232```
233233
234234#### TEdit、および、TCustomEditについて
235235
236236Editコントロールは、LCLもVCLと同等の機能をもっていますが、移植中に、いくつかの気をつけるべき点があります。
237237
2382381. GUIインターフェースでの制限で、TEdit.PasswordCharはすべてのインタフェースでは、まだ正常に機能しません。入力テキストを隠するために必要とする場合は、代わりに、TCustomEdit.EchoMode emPasswordを使用します。
2392392. ドラッグ、ドッキングイベントはまだ実装されていません。詳しくは、Control Dragging/Docking.
2402403. フォントプロパティは、GUIの統一性のためにたいてい無視されます。詳しくは、TControl.Font/TControl.ParentFont
241241
242242### (optional) TSplitter -\> TPairSplitter
243243
244244**Please Improve Me**
245245
246246There is now a TSplitter control in the LCL, so no need to convert it.
247247
248248Nevertheless, if you want, here it is explained:
249249
250250The following is loosely based on questions by Vincent Snijders on the mailing list, and responses by [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson):
251251
252252In the VCL, "Splitting" controls, that is a handle which can be dragged between two components to give one more or less space then the other, is accomplished by a TSplitter. This is often seen, for instance in the Delphi IDE between the docked Code Explorer and Source Viewer.
253253
254254The LCL provides its own Control called a TPairSplitter, which serves the same type of purpose, however it is not compatible, so "repairing" broken VCL code or Delphi DFM's will be necesary in the event of porting code, even though much is shared in common between the two.
255255
256256So what exactly are the differences?
257257
258258Well the biggest differences are a VCL TSplitter has no children, instead it is placed between two controls aligned properly, and allows resizing between them at runtime, regardless its own size. It must have two controls aligned on each size to do anything. A simple example would be form with a Left Aligned Panel, a left aligned Splitter, and a second client aligned panel. On run time you could then realign the size given each panel by dragging on the handle provided by this Splitter control.
259259
260260On the LCL hand however, a TPairSplitter is a special kind of control, with two panels, and it can only be usefull if the controls to split are on these panels, but it will still perform a split between those panel whether or not anything is on them. So following the prior example, you would have a form with a TPairSplitter aligned client, and a panel aligned client on its left side, and a panel aligned client on its right side.
261261
262262The other important difference is that in the VCl, since the TSplitter is its own TControl, then the position is kept relative to the other controls on resize, so for instance a client panel will grow while the other panels will not, thus the split position is relative to the alignment of the split controls,
263263
264264In the LCL since the side panels are separate then the TPairSplitter has a Position property which is absolute relative to top or left. so on resize the actual position does not change according to contents, so a callback must be set to ensure the ratio is kept on resize if this is important.
265265
266266For example if the Right side of a vertical split needs to have alClient like behaviour, you need to add a form resize callback which does something like :
267267
268268`PairSplitter.Position := PairSplitter.Width - PairSplitter.Position; `
269269
270270So how can I convert existing code using TSplitter to the TPairSplitter?
271271
272272If the splitter and controls are created within an actual function(like form oncreate), conversion shouldn't be too difficult, primarily reorganize the code to create the controls in order of new hierarchy and set the parents of the child controls to split to the left/top and right/bottom portions of the PairSplitter. An example of the changes being -
273273
274-<table>
275-<tbody>
276-<tr>
277-<td class="header"><p><strong>VCL</strong></p></td>
278-<td class="header"><p><strong>LCL</strong></p></td>
279-</tr>
280-<tr>
281-<td class="code"><div class="sourceCode" id="cb1"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span> </span>
282-<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> BottomPanel: TPanel;</span>
283-<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a> VerticalSplitter: TSplitter;</span>
284-<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a> LeftPanel: TPanel;</span>
285-<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a> HorizontalSplitter: TSplitter;</span>
286-<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a> MainPanel: TPanel;</span>
287-<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a></span>
288-<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="kw">begin</span></span>
289-<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a> BottomPanel:= TPanel.Create(<span class="kw">Self</span>);</span>
290-<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a> <span class="kw">with</span> (BottomPanel) <span class="kw">do</span></span>
291-<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a> <span class="kw">begin</span></span>
292-<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a> Parent:= <span class="kw">Self</span>;</span>
293-<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a> Height:= <span class="dv">75</span>;</span>
294-<span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a> Align:= alBottom;</span>
295-<span id="cb1-15"><a href="#cb1-15" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span>;</span>
296-<span id="cb1-16"><a href="#cb1-16" aria-hidden="true" tabindex="-1"></a></span>
297-<span id="cb1-17"><a href="#cb1-17" aria-hidden="true" tabindex="-1"></a> VerticalSplitter:= TSplitter.Create(<span class="kw">Self</span>);</span>
298-<span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a> <span class="kw">with</span> (VerticalSplitter) <span class="kw">do</span></span>
299-<span id="cb1-19"><a href="#cb1-19" aria-hidden="true" tabindex="-1"></a> <span class="kw">begin</span></span>
300-<span id="cb1-20"><a href="#cb1-20" aria-hidden="true" tabindex="-1"></a> Parent:= <span class="kw">Self</span>;</span>
301-<span id="cb1-21"><a href="#cb1-21" aria-hidden="true" tabindex="-1"></a> Align:= alBottom;</span>
302-<span id="cb1-22"><a href="#cb1-22" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span>;</span>
303-<span id="cb1-23"><a href="#cb1-23" aria-hidden="true" tabindex="-1"></a></span>
304-<span id="cb1-24"><a href="#cb1-24" aria-hidden="true" tabindex="-1"></a> HorizontalSplitter:= TSplitter.Create(<span class="kw">Self</span>);</span>
305-<span id="cb1-25"><a href="#cb1-25" aria-hidden="true" tabindex="-1"></a> <span class="kw">with</span> (HorizontalSplitter) <span class="kw">do</span></span>
306-<span id="cb1-26"><a href="#cb1-26" aria-hidden="true" tabindex="-1"></a> <span class="kw">begin</span></span>
307-<span id="cb1-27"><a href="#cb1-27" aria-hidden="true" tabindex="-1"></a> Parent:= <span class="kw">Self</span>;</span>
308-<span id="cb1-28"><a href="#cb1-28" aria-hidden="true" tabindex="-1"></a> align:= alLeft;</span>
309-<span id="cb1-29"><a href="#cb1-29" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span>;</span>
310-<span id="cb1-30"><a href="#cb1-30" aria-hidden="true" tabindex="-1"></a></span>
311-<span id="cb1-31"><a href="#cb1-31" aria-hidden="true" tabindex="-1"></a> LeftPanel:= TPanel.Create(<span class="kw">Self</span>);</span>
312-<span id="cb1-32"><a href="#cb1-32" aria-hidden="true" tabindex="-1"></a> <span class="kw">with</span> (LeftPanel) <span class="kw">do</span></span>
313-<span id="cb1-33"><a href="#cb1-33" aria-hidden="true" tabindex="-1"></a> <span class="kw">begin</span></span>
314-<span id="cb1-34"><a href="#cb1-34" aria-hidden="true" tabindex="-1"></a> Parent:= <span class="kw">Self</span>;</span>
315-<span id="cb1-35"><a href="#cb1-35" aria-hidden="true" tabindex="-1"></a> Width:= <span class="dv">125</span>;</span>
316-<span id="cb1-36"><a href="#cb1-36" aria-hidden="true" tabindex="-1"></a> Align:= alLeft;</span>
317-<span id="cb1-37"><a href="#cb1-37" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span>;</span>
318-<span id="cb1-38"><a href="#cb1-38" aria-hidden="true" tabindex="-1"></a></span>
319-<span id="cb1-39"><a href="#cb1-39" aria-hidden="true" tabindex="-1"></a> MainPanel:= TPanel.Create(<span class="kw">Self</span>);</span>
320-<span id="cb1-40"><a href="#cb1-40" aria-hidden="true" tabindex="-1"></a> <span class="kw">with</span> (MainPanel) <span class="kw">do</span></span>
321-<span id="cb1-41"><a href="#cb1-41" aria-hidden="true" tabindex="-1"></a> <span class="kw">begin</span></span>
322-<span id="cb1-42"><a href="#cb1-42" aria-hidden="true" tabindex="-1"></a> Parent:= <span class="kw">Self</span>;</span>
323-<span id="cb1-43"><a href="#cb1-43" aria-hidden="true" tabindex="-1"></a> Align:= alClient;</span>
324-<span id="cb1-44"><a href="#cb1-44" aria-hidden="true" tabindex="-1"></a> Caption:= <span class="st">&#39;Hello&#39;</span>;</span>
325-<span id="cb1-45"><a href="#cb1-45" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span>;</span>
326-<span id="cb1-46"><a href="#cb1-46" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span>; </span></code></pre></div></td>
327-<td class="code"><div class="sourceCode" id="cb2"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="kw">var</span></span>
328-<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> BottomPanel: TPanel;</span>
329-<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> VerticalSplitter: TPairSplitter;</span>
330-<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a> LeftPanel: TPanel;</span>
331-<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a> HorizontalSplitter: TPairSplitter;</span>
332-<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a> MainPanel: TPanel;</span>
333-<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a></span>
334-<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a><span class="kw">begin</span></span>
335-<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a> VerticalSplitter:= TPairSplitter.Create(<span class="kw">Self</span>);</span>
336-<span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a> <span class="kw">with</span> (VerticalSplitter) <span class="kw">do</span></span>
337-<span id="cb2-11"><a href="#cb2-11" aria-hidden="true" tabindex="-1"></a> <span class="kw">begin</span></span>
338-<span id="cb2-12"><a href="#cb2-12" aria-hidden="true" tabindex="-1"></a> Parent:= <span class="kw">Self</span>;</span>
339-<span id="cb2-13"><a href="#cb2-13" aria-hidden="true" tabindex="-1"></a> Align:= alClient;</span>
340-<span id="cb2-14"><a href="#cb2-14" aria-hidden="true" tabindex="-1"></a> Width:= <span class="kw">Self</span>.Width;</span>
341-<span id="cb2-15"><a href="#cb2-15" aria-hidden="true" tabindex="-1"></a> Height:= <span class="kw">Self</span>.Height;</span>
342-<span id="cb2-16"><a href="#cb2-16" aria-hidden="true" tabindex="-1"></a> SplitterType:= pstVertical;</span>
343-<span id="cb2-17"><a href="#cb2-17" aria-hidden="true" tabindex="-1"></a> Position:= Height - <span class="dv">75</span>;</span>
344-<span id="cb2-18"><a href="#cb2-18" aria-hidden="true" tabindex="-1"></a> Sides[<span class="dv">0</span>].Width:= Width;</span>
345-<span id="cb2-19"><a href="#cb2-19" aria-hidden="true" tabindex="-1"></a> Sides[<span class="dv">0</span>].Height:= Position;</span>
346-<span id="cb2-20"><a href="#cb2-20" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span>;</span>
347-<span id="cb2-21"><a href="#cb2-21" aria-hidden="true" tabindex="-1"></a></span>
348-<span id="cb2-22"><a href="#cb2-22" aria-hidden="true" tabindex="-1"></a> HorizontalSplitter:= TPairSplitter.Create(<span class="kw">Self</span>);</span>
349-<span id="cb2-23"><a href="#cb2-23" aria-hidden="true" tabindex="-1"></a> <span class="kw">with</span> (HorizontalSplitter) <span class="kw">do</span></span>
350-<span id="cb2-24"><a href="#cb2-24" aria-hidden="true" tabindex="-1"></a> <span class="kw">begin</span></span>
351-<span id="cb2-25"><a href="#cb2-25" aria-hidden="true" tabindex="-1"></a> Parent:= VerticalSplitter.Sides[<span class="dv">0</span>];</span>
352-<span id="cb2-26"><a href="#cb2-26" aria-hidden="true" tabindex="-1"></a> Width:= <span class="kw">Self</span>.Width;</span>
353-<span id="cb2-27"><a href="#cb2-27" aria-hidden="true" tabindex="-1"></a> Height:= VerticalSplitter.Position;</span>
354-<span id="cb2-28"><a href="#cb2-28" aria-hidden="true" tabindex="-1"></a> align:= alClient;</span>
355-<span id="cb2-29"><a href="#cb2-29" aria-hidden="true" tabindex="-1"></a> SplitterType:= pstHorizontal;</span>
356-<span id="cb2-30"><a href="#cb2-30" aria-hidden="true" tabindex="-1"></a> Position:= <span class="dv">125</span>;</span>
357-<span id="cb2-31"><a href="#cb2-31" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span>;</span>
358-<span id="cb2-32"><a href="#cb2-32" aria-hidden="true" tabindex="-1"></a></span>
359-<span id="cb2-33"><a href="#cb2-33" aria-hidden="true" tabindex="-1"></a> LeftPanel:= TPanel.Create(<span class="kw">Self</span>);</span>
360-<span id="cb2-34"><a href="#cb2-34" aria-hidden="true" tabindex="-1"></a> <span class="kw">with</span> (LeftPanel) <span class="kw">do</span></span>
361-<span id="cb2-35"><a href="#cb2-35" aria-hidden="true" tabindex="-1"></a> <span class="kw">begin</span></span>
362-<span id="cb2-36"><a href="#cb2-36" aria-hidden="true" tabindex="-1"></a> Parent:= HorizontalSplitter.Sides[<span class="dv">0</span>];</span>
363-<span id="cb2-37"><a href="#cb2-37" aria-hidden="true" tabindex="-1"></a> Align:= alClient;</span>
364-<span id="cb2-38"><a href="#cb2-38" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span>;</span>
365-<span id="cb2-39"><a href="#cb2-39" aria-hidden="true" tabindex="-1"></a></span>
366-<span id="cb2-40"><a href="#cb2-40" aria-hidden="true" tabindex="-1"></a> MainPanel:= TPanel.Create(<span class="kw">Self</span>);</span>
367-<span id="cb2-41"><a href="#cb2-41" aria-hidden="true" tabindex="-1"></a> <span class="kw">with</span> (MainPanel) <span class="kw">do</span></span>
368-<span id="cb2-42"><a href="#cb2-42" aria-hidden="true" tabindex="-1"></a> <span class="kw">begin</span></span>
369-<span id="cb2-43"><a href="#cb2-43" aria-hidden="true" tabindex="-1"></a> Parent:= HorizontalSplitter.Sides[<span class="dv">1</span>];</span>
370-<span id="cb2-44"><a href="#cb2-44" aria-hidden="true" tabindex="-1"></a> Align:= alClient;</span>
371-<span id="cb2-45"><a href="#cb2-45" aria-hidden="true" tabindex="-1"></a> Caption:= <span class="st">&#39;Hello&#39;</span>;</span>
372-<span id="cb2-46"><a href="#cb2-46" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span>;</span>
373-<span id="cb2-47"><a href="#cb2-47" aria-hidden="true" tabindex="-1"></a></span>
374-<span id="cb2-48"><a href="#cb2-48" aria-hidden="true" tabindex="-1"></a> BottomPanel:= TPanel.Create(<span class="kw">Self</span>);</span>
375-<span id="cb2-49"><a href="#cb2-49" aria-hidden="true" tabindex="-1"></a> <span class="kw">with</span> (BottomPanel) <span class="kw">do</span></span>
376-<span id="cb2-50"><a href="#cb2-50" aria-hidden="true" tabindex="-1"></a> <span class="kw">begin</span></span>
377-<span id="cb2-51"><a href="#cb2-51" aria-hidden="true" tabindex="-1"></a> Parent:= VerticalSplitter.Sides[<span class="dv">1</span>];</span>
378-<span id="cb2-52"><a href="#cb2-52" aria-hidden="true" tabindex="-1"></a> Align:= alClient;</span>
379-<span id="cb2-53"><a href="#cb2-53" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span>;</span>
380-<span id="cb2-54"><a href="#cb2-54" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span>;</span></code></pre></div></td>
381-</tr>
382-</tbody>
383-</table>
274+**VCL**
384275
276+**LCL**
277+
278+``` pascal
279+var
280+ BottomPanel: TPanel;
281+ VerticalSplitter: TSplitter;
282+ LeftPanel: TPanel;
283+ HorizontalSplitter: TSplitter;
284+ MainPanel: TPanel;
285+
286+begin
287+ BottomPanel:= TPanel.Create(Self);
288+ with (BottomPanel) do
289+ begin
290+ Parent:= Self;
291+ Height:= 75;
292+ Align:= alBottom;
293+ end;
294+
295+ VerticalSplitter:= TSplitter.Create(Self);
296+ with (VerticalSplitter) do
297+ begin
298+ Parent:= Self;
299+ Align:= alBottom;
300+ end;
301+
302+ HorizontalSplitter:= TSplitter.Create(Self);
303+ with (HorizontalSplitter) do
304+ begin
305+ Parent:= Self;
306+ align:= alLeft;
307+ end;
308+
309+ LeftPanel:= TPanel.Create(Self);
310+ with (LeftPanel) do
311+ begin
312+ Parent:= Self;
313+ Width:= 125;
314+ Align:= alLeft;
315+ end;
316+
317+ MainPanel:= TPanel.Create(Self);
318+ with (MainPanel) do
319+ begin
320+ Parent:= Self;
321+ Align:= alClient;
322+ Caption:= 'Hello';
323+ end;
324+end;
325+```
326+
327+``` pascal
328+var
329+ BottomPanel: TPanel;
330+ VerticalSplitter: TPairSplitter;
331+ LeftPanel: TPanel;
332+ HorizontalSplitter: TPairSplitter;
333+ MainPanel: TPanel;
334+
335+begin
336+ VerticalSplitter:= TPairSplitter.Create(Self);
337+ with (VerticalSplitter) do
338+ begin
339+ Parent:= Self;
340+ Align:= alClient;
341+ Width:= Self.Width;
342+ Height:= Self.Height;
343+ SplitterType:= pstVertical;
344+ Position:= Height - 75;
345+ Sides[0].Width:= Width;
346+ Sides[0].Height:= Position;
347+ end;
348+
349+ HorizontalSplitter:= TPairSplitter.Create(Self);
350+ with (HorizontalSplitter) do
351+ begin
352+ Parent:= VerticalSplitter.Sides[0];
353+ Width:= Self.Width;
354+ Height:= VerticalSplitter.Position;
355+ align:= alClient;
356+ SplitterType:= pstHorizontal;
357+ Position:= 125;
358+ end;
359+
360+ LeftPanel:= TPanel.Create(Self);
361+ with (LeftPanel) do
362+ begin
363+ Parent:= HorizontalSplitter.Sides[0];
364+ Align:= alClient;
365+ end;
366+
367+ MainPanel:= TPanel.Create(Self);
368+ with (MainPanel) do
369+ begin
370+ Parent:= HorizontalSplitter.Sides[1];
371+ Align:= alClient;
372+ Caption:= 'Hello';
373+ end;
374+
375+ BottomPanel:= TPanel.Create(Self);
376+ with (BottomPanel) do
377+ begin
378+ Parent:= VerticalSplitter.Sides[1];
379+ Align:= alClient;
380+ end;
381+end;
382+```
383+
385384So as you can see, farely consistant with most control hierarchy. And if you are familiar with DFM's, the changes needed for DFM-\>LFM conversion should be farely obvious from the above, as they are the same sort of changes in Parent/Owner etc.
386385
387386So the above example would be something like -
388387
389-<table>
390-<tbody>
391-<tr>
392-<td class="header"><p><strong>Delphi DFM</strong></p>
393-<div style="font-weight: normal">
394-<p><strong>(extraneous values removed)</strong></p></td>
395-<td class="header"><p><strong>Lazarus LFM</strong></p>
396-<div style="font-weight: normal">
397-<p><strong>(most width, height, etc. removed)</strong></p></td>
398-</tr>
399-<tr>
400-<td class="code"><div class="sourceCode" id="cb1"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="kw">object</span> VerticalSplitter: TSplitter</span>
401-<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> Height = <span class="dv">3</span></span>
402-<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a> Cursor = crVSplit</span>
403-<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a> Align = alBottom</span>
404-<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span></span>
405-<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="kw">object</span> HorizontalSplitter: TSplitter</span>
406-<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a> Width = <span class="dv">3</span></span>
407-<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a> Align = alLeft</span>
408-<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span></span>
409-<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a><span class="kw">object</span> BottomPanel: TPanel</span>
410-<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a> Height = <span class="dv">75</span></span>
411-<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a> Align = alBottom</span>
412-<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span></span>
413-<span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a><span class="kw">object</span> LeftPanel: TPanel</span>
414-<span id="cb1-15"><a href="#cb1-15" aria-hidden="true" tabindex="-1"></a> Width = <span class="dv">125</span></span>
415-<span id="cb1-16"><a href="#cb1-16" aria-hidden="true" tabindex="-1"></a> Align = alLeft</span>
416-<span id="cb1-17"><a href="#cb1-17" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span></span>
417-<span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a><span class="kw">object</span> MainPanel: TPanel</span>
418-<span id="cb1-19"><a href="#cb1-19" aria-hidden="true" tabindex="-1"></a> Align = alClient</span>
419-<span id="cb1-20"><a href="#cb1-20" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span> </span></code></pre></div></td>
420-<td class="code"><div class="sourceCode" id="cb2"><pre class="sourceCode pascal"><code class="sourceCode pascal"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="kw">object</span> VerticalSplitter: TPairSplitter</span>
421-<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> Align = alClient</span>
422-<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> SplitterType = pstVertical</span>
423-<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a> Position = <span class="dv">225</span></span>
424-<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a> Height = <span class="dv">300</span></span>
425-<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a> Width = <span class="dv">400</span></span>
426-<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a> <span class="kw">object</span> Pairsplitterside1: TPairSplitterIde</span>
427-<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a> <span class="kw">object</span> HorizontalSplitter: TPairSplitter</span>
428-<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a> Align = alClient</span>
429-<span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a> Position = <span class="dv">125</span></span>
430-<span id="cb2-11"><a href="#cb2-11" aria-hidden="true" tabindex="-1"></a> <span class="kw">object</span> Pairsplitterside3: TPairSplitterIde</span>
431-<span id="cb2-12"><a href="#cb2-12" aria-hidden="true" tabindex="-1"></a> Width = <span class="dv">125</span></span>
432-<span id="cb2-13"><a href="#cb2-13" aria-hidden="true" tabindex="-1"></a> <span class="kw">object</span> LeftPanel: TPanel</span>
433-<span id="cb2-14"><a href="#cb2-14" aria-hidden="true" tabindex="-1"></a> Align = alClient</span>
434-<span id="cb2-15"><a href="#cb2-15" aria-hidden="true" tabindex="-1"></a> Width = <span class="dv">125</span></span>
435-<span id="cb2-16"><a href="#cb2-16" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span></span>
436-<span id="cb2-17"><a href="#cb2-17" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span></span>
437-<span id="cb2-18"><a href="#cb2-18" aria-hidden="true" tabindex="-1"></a> <span class="kw">object</span> Pairsplitterside4: TPairSplitterIde</span>
438-<span id="cb2-19"><a href="#cb2-19" aria-hidden="true" tabindex="-1"></a> <span class="kw">object</span> MainPanel: TPanel</span>
439-<span id="cb2-20"><a href="#cb2-20" aria-hidden="true" tabindex="-1"></a> Align = alClient</span>
440-<span id="cb2-21"><a href="#cb2-21" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span></span>
441-<span id="cb2-22"><a href="#cb2-22" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span></span>
442-<span id="cb2-23"><a href="#cb2-23" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span></span>
443-<span id="cb2-24"><a href="#cb2-24" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span></span>
444-<span id="cb2-25"><a href="#cb2-25" aria-hidden="true" tabindex="-1"></a> <span class="kw">object</span> Pairsplitterside2: TPairSplitterIde</span>
445-<span id="cb2-26"><a href="#cb2-26" aria-hidden="true" tabindex="-1"></a> <span class="kw">object</span> BottomPanel: TPanel</span>
446-<span id="cb2-27"><a href="#cb2-27" aria-hidden="true" tabindex="-1"></a> Align = alClient</span>
447-<span id="cb2-28"><a href="#cb2-28" aria-hidden="true" tabindex="-1"></a> Height = <span class="dv">75</span></span>
448-<span id="cb2-29"><a href="#cb2-29" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span></span>
449-<span id="cb2-30"><a href="#cb2-30" aria-hidden="true" tabindex="-1"></a> <span class="kw">end</span></span>
450-<span id="cb2-31"><a href="#cb2-31" aria-hidden="true" tabindex="-1"></a><span class="kw">end</span></span></code></pre></div></td>
451-</tr>
452-</tbody>
453-</table>
388+**Delphi DFM**
389+
390+**(extraneous values removed)**
391+
392+**Lazarus LFM**
393+
394+**(most width, height, etc. removed)**
395+
396+``` pascal
397+object VerticalSplitter: TSplitter
398+ Height = 3
399+ Cursor = crVSplit
400+ Align = alBottom
401+end
402+object HorizontalSplitter: TSplitter
403+ Width = 3
404+ Align = alLeft
405+end
406+object BottomPanel: TPanel
407+ Height = 75
408+ Align = alBottom
409+end
410+object LeftPanel: TPanel
411+ Width = 125
412+ Align = alLeft
413+end
414+object MainPanel: TPanel
415+ Align = alClient
416+end
417+```
418+
419+``` pascal
420+object VerticalSplitter: TPairSplitter
421+ Align = alClient
422+ SplitterType = pstVertical
423+ Position = 225
424+ Height = 300
425+ Width = 400
426+ object Pairsplitterside1: TPairSplitterIde
427+ object HorizontalSplitter: TPairSplitter
428+ Align = alClient
429+ Position = 125
430+ object Pairsplitterside3: TPairSplitterIde
431+ Width = 125
432+ object LeftPanel: TPanel
433+ Align = alClient
434+ Width = 125
435+ end
436+ end
437+ object Pairsplitterside4: TPairSplitterIde
438+ object MainPanel: TPanel
439+ Align = alClient
440+ end
441+ end
442+ end
443+ end
444+ object Pairsplitterside2: TPairSplitterIde
445+ object BottomPanel: TPanel
446+ Align = alClient
447+ Height = 75
448+ end
449+ end
450+end
451+```
454452
455453### TCustomTreeView、およびTTreeViewについて
456454
457455VCLにもLCLにも、TCustomTreeView/TTreeViewのコンポーネントがあります。 ツリー構造化されたデータのリストで、複数のノードや、高度なセレクション、イメージリストなどの機能があります。 多くの機能は同等ですが、すべてのプロパティがまったくおなじではありません。主な相違点は以下です。
458456
459457**Incomplete list, also update to include TCustomTreeView Mark functions and protected methods**
460458
4614591. LCLには、 TCustomTreeView.Optionsがあります。これは、コントロールが変更されたときのふるまいと見かけのオプションです。これらのオプションは次の通りです。:
462460 - tvoAllowMultiselect - 複数のノードを選択できるモードです。eDelphi6のVCLのTCustomTreeView.MultiSelectと同等です。
463461 - tvoAutoExpand - ノードを自動展開します。TCustomTreeView.AutoExpandと同様です。
464462 - tvoAutoInsertMark - マウスが上を動くとドラッグのプレビューを更新します。
465463 - tvoAutoItemHeight - Itemの高さを自動的に調節します。
466464 - tvoHideSelection - 選択したItemをマークしません。
467465 - tvoHotTrack - ホットトラッキングをおこないます。TCustomTreeview.HotTrackを有効にするのと同等です。
468466 - tvoKeepCollapsedNodes - ノードを折畳んだりしたときに、子ノードを維持します。
469467 - tvoReadOnly - TreeviewをReadOnlyにします。TCustomTreeviewのReadOnlyを有効にするのと同等です。
470468 - tvoRightClickSelect - ノードをマウスの右クリックで選択状態にできるようにします。TCustomTreeView.RightClickSelectを有効にするのと同等です。
471469 - tvoRowSelect - 行選択を可能にします。TCustomTreeView.RowSelectを有効にするのと同等です。
472470 - tvoShowButtons - ボタンを表示します。TCustomTreeView.ShowButtonsを有効にするのと同等です。
473471 - tvoShowLines - ノードへの線を表示します。TCustomTreeView.ShowLinesを有効にするのと同等です。
474472 - tvoShowRoot - ルートノードを表示します。TCustomTreeView.ShowRootを有効にするのと同等です。
475473 - tvoShowSeparators - セパレータを表示します。
476474 - tvoToolTips - 個々のノードに、ツールチップを表示します。
4774752. LCLは次のプロパティを追加しました:
478476 - TCustomTreeView.OnSelectionChange イベント
479477 - TCustomTreeView.DefaultItems, アイテムのデフォルト設定のためのものです。
480478 - TCustomTreeView.ExpandSignType ノードの展開、折りたたみの際のサインを決定します。
4814793. LCLにあるほとんどのドラッグ、ドッキングイベントは動作しません。これについてのより詳細な情報は、前の「ドラッグとドッキングの制御」を見てください。
482480
483481### Messages / Events
484482
485483The order and frequency of messages and events (OnShow, OnActivate, OnEnter, ...) differ from the VCL and depend on the widgetset. The LCL provides a subset of WinAPI like messages to make porting of Delphi components easier, but almost all LCL messages work a little bit different than the VCL/WinAPI counterpart. The biggest part of Delphi code using WinAPI messages uses them, because the VCL lacks a feature or for speed reasons. Such things will seldom work the same under the LCL, so they must be checked manually. That's why LCL messages are called for example LM_SIZE instead of WM_SIZE (unit lmessages).
486484
487485**Note on handling of custom messages!** As of version 0.9.26 (December 2008), way of handling custom WinApi messages (e.g. WM_HOTKEY, WM_SYSCOMMAND) differs from the way of handling these messages in Delphi. At the moment you cannot handle them via **message** directive or via overriding of *WndProc* method of the form. The only way to handle them in the form is to hook Windows *windowproc* by yourself. Read more here: [[Win32/64 Interface|Processing non-user messages in your window]]
488486
489487## Original Contributors and changes
490488
491489This page has been converted from the epikwiki [version](http://lazarus-ccr.sourceforge.net/index.php?wiki=LazarusForDelphiUsers).
492490
493491- Initial import and formatting - VlxAdmin 9/26/2003
494492- Begin VCL -\> LCL with a section on TSplitter -\> TPairSplitter - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 9/30/2003
495493- Add TControl.Font/TControl.ParentFont to VCL -\> LCL - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 9/30/2003
496494- Update TEdit/TCustomEdit section in VCL -\> LCL - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 10/1/2003
497495- Add Control Dragging/Docking to VCL -\> LCL - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 10/1/2003
498496- Added "Object Inspector" to Delphi IDE -\> Lazarus IDE - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 10/1/2003
499497- Added initial "TCustomTreeView/TTreeView" to VCL -\> LCL - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 10/1/2003
500498- Added introduction to VCL -\> LCL - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 10/1/2003
501499- Fixed some typos - Vincent 10/2/2003
502500- Fixed Typo User:Kirkpatc 20 May 2004
503501
504502## See Also
505503
506504[[Code Conversion Guide|Code Conversion Guide (from Delphi &amp; Kylix)]]
507505
508506[[Compile With Delphi]]
509507
510508---
511509*From the Free Pascal wiki, page "Lazarus For Delphi Users/ja", as it stood on 2020-02-18 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history