Sign in Join
Wiki copytemporary

Lazarus For Delphi Users/ja: what changed

Revision 3 to 4. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-この記事は、Lazarusに興味があり、すでにDelphiは知っている、という人々向けのものです。 この二つの違いについて記述しています。
1+**日本語版メニュー**
2+---
3+[[Main Page/ja|メインページ]] \- [[Lazarus Documentation/ja|Lazarus Documentation日本語版]] \- [[Japanese Localization Notes|翻訳ノート]] \- [[Bug Tracking/ja|日本語障害情報]]
4+
5+この記事は、Lazarusに興味があり、すでにDelphiは知っている、という人々向けのものです。 この二つの違いについて記述しています。
26
37## DelphiからLazarusへ
48
5-Lazarusは Delphiと同じく、RAD(Rapid Application Development、手早くアプリケーションを開発できる)ツールの一つです。ビジュアルなコンポーネントライブラリと、IDEがあります。Lazarusのコンポーネントライブラリ(LCL)はDelphiのVCLととても似ています。ほとんどのユニットと、クラスと、プロパティは、同じ名前と機能をもっています。これは、移植を簡単にします。しかし、Lazarusは'オープンソースのDelphiクローン'ではありません。ですから、100%の互換性を期待しないでください。
9+Lazarusは Delphiと同じく、RAD(Rapid Application Development、手早くアプリケーションを開発できる)ツールの一つです。ビジュアルなコンポーネントライブラリと、IDEがあります。Lazarusのコンポーネントライブラリ(LCL)はDelphiのVCLととても似ています。ほとんどのユニットと、クラスと、プロパティは、同じ名前と機能をもっています。これは、移植を簡単にします。しかし、Lazarusは'オープンソースのDelphiクローン'ではありません。ですから、100%の互換性を期待しないでください。
610
711### 最大の相違点は?
812
9-Lazarusは完全にオープンソースで、プラットホームに対し独立しており、強力な[[Free Pascal|Free Pascalコンパイラ]](FPC)を使っています。FPCは15以上のプラットホームで動作します。しかし、すべてのパッケージやライブラリが移植されているわけではありません。ですから、Lazarusは現在のところLinux,FreeBSD,MaxOSX、そしてWin32上で動作します。(訳注:いくつかのPDAでも暫定的な動作はします。日本語に関する処理の改善に、これから皆さんの力を必要としています。)
13+Lazarusは完全にオープンソースで、プラットホームに対し独立しており、強力な[[Free Pascal]]コンパイラ(FPC)を使っています。FPCは15以上のプラットホームで動作します。しかし、すべてのパッケージやライブラリが移植されているわけではありません。ですから、Lazarusは現在のところLinux,FreeBSD,MaxOSX、そしてWin32上で動作します。(訳注:いくつかのPDAでも暫定的な動作はします。日本語に関する処理の改善に、これから皆さんの力を必要としています。)
1014
1115**Lazarusは、この文章がまたそうであるように、常に未完です。私たちはいつでも、新しい開発者、パッケージ管理者、移植者、ドキュメントの執筆者を募っています。**
1216
1317### Delphi のプロジェクトを Lazarus 用に変換するためにまず必要なこと
1418
15-Lazarus を起動し、 **Tools** メニューから **Convert Delphi Project to Lazarus Project** を選んで下さい。これで全てが解決する訳ではありませんが、大変役立つはずです。Lazarus IDE の変換ツールは一般に一方通行であり、逆の変換はできないことに注意して下さい。プロジェクトを Delphi でも Lazarus でもコンパイルできるように Delphi との互換性を維持する必要がある場合は、Lazarus IDEではなく [XDev Toolkit](http://wiki.lazarus.freepascal.org/XDev_Toolkit) の利用を考えて下さい。
19+Lazarus を起動し、 **Tools** メニューから **Convert Delphi Project to Lazarus Project** を選んで下さい。これで全てが解決する訳ではありませんが、大変役立つはずです。Lazarus IDE の変換ツールは一般に一方通行であり、逆の変換はできないことに注意して下さい。プロジェクトを Delphi でも Lazarus でもコンパイルできるように Delphi との互換性を維持する必要がある場合は、Lazarus IDEではなく [[XDev Toolkit]] の利用を考えて下さい。
1620
1721### ユニコードのサポート
1822
19-2007バージョンまでの Delphi はユニコードをサポートせず、Windows が利用していた ANSI エンコーディングを採用していました。2008バージョン以降の Delphi はユニコードをサポートするようになり、UTF-16 を用いて文字列をエンコードしています。
23+2007バージョンまでの Delphi はユニコードをサポートせず、Windows が利用していた ANSI エンコーディングを採用していました。2008バージョン以降の Delphi はユニコードをサポートするようになり、UTF-16 を用いて文字列をエンコードしています。
2024
21-一方、Lazarus は UTF-8 を用いたユニコードサポートを始めました。詳しくは [[LCL Unicode Support]] を御読みください。.
25+一方、Lazarus は UTF-8 を用いたユニコードサポートを始めました。詳しくは [[LCL Unicode Support]] を御読みください。.
2226
23-## Delphi IDE から Lazarus IDE へ
27+## Delphi IDE から Lazarus IDE へ
2428
2529### プロジェクト
2630
27-Delphiアプリケーションのメインのファイルは .dprファイルです。Lazarusにおいては、.lpiファイルです(=Lazarus Project Information)。 .dprファイルはメインのソースプログラムであり、DelphiのIDEはコンパイラスイッチやユニットなどの情報の一部を入れます(訳注:すべてではない。オプションファイルなどがある)。Lazarusのアプリケーションもメインのソースファイルを.lprファイルに入れます。しかし、そのほかのすべての情報をも入れます。ですから、.lpiファイルはとても重要です。
31+Delphiアプリケーションのメインのファイルは .dprファイルです。Lazarusにおいては、.lpiファイルです(=Lazarus Project Information)。 .dprファイルはメインのソースプログラムであり、DelphiのIDEはコンパイラスイッチやユニットなどの情報の一部を入れます(訳注:すべてではない。オプションファイルなどがある)。Lazarusのアプリケーションもメインのソースファイルを.lprファイルに入れます。しかし、そのほかのすべての情報をも入れます。ですから、.lpiファイルはとても重要です。
2832
29-例: Delphiはユニットへのパスを.dprファイルに入れます。たとえば、unit1 in 'path/Unit1.pas'というふうにいれます。このinでパスを指定する方法はDelphi独特であり(Pascalの文法ではないので)、Lazarus IDEは読むことができないので、こういう方法をつかわないでください。かわりに、コンパイラオプションで、ユニットパスを指定してください。
33+例: Delphiはユニットへのパスを.dprファイルに入れます。たとえば、unit1 in 'path/Unit1.pas'というふうにいれます。このinでパスを指定する方法はDelphi独特であり(Pascalの文法ではないので)、Lazarus IDEは読むことができないので、こういう方法をつかわないでください。かわりに、コンパイラオプションで、ユニットパスを指定してください。
3034
31-Delphiはコンパイラオプションを.dprファイルに埋め込みます。たとえば、{\$APPTYPE CONSOLE}.というふうにいれます。Lazarus IDEでは、これらは無視されますので、使わないで下さい。かわりに、コンパイラオプションを使ってください。
35+Delphiはコンパイラオプションを.dprファイルに埋め込みます。たとえば、{$APPTYPE CONSOLE}.というふうにいれます。Lazarus IDEでは、これらは無視されますので、使わないで下さい。かわりに、コンパイラオプションを使ってください。
3236
33-(訳注:DelphiのdprファイルはPascalの仕様+独自の部分が結構多いですが、Free Pascal Compiler上のLazarusとしては、Free Pascalに特殊な言語拡張をなるべく行わず、純粋にFree Pascal上に実現できるような方法がとられています。Delphiのようにコンパイラオプションを至る所に定義できるのは、便利でもある一方、スキャンしていかないと、有効か無効かが分からず、バグや全体のみとおしが悪くなる両刃の剣といえますので、訳者は良い仕様だと思います。)
37+(訳注:DelphiのdprファイルはPascalの仕様+独自の部分が結構多いですが、Free Pascal Compiler上のLazarusとしては、Free Pascalに特殊な言語拡張をなるべく行わず、純粋にFree Pascal上に実現できるような方法がとられています。Delphiのようにコンパイラオプションを至る所に定義できるのは、便利でもある一方、スキャンしていかないと、有効か無効かが分からず、バグや全体のみとおしが悪くなる両刃の剣といえますので、訳者は良い仕様だと思います。)
3438
35-ひとつ重要なルールがあります。それは、*常に*プロジェクトは存在するということです(訳注:IDEが起動している最中に、ということでしょう)。 現在のプロジェクトを"close"する方法は、lazarusを終了するか、他のプロジェクトを開くしかありません。 これは、lazarusのプロジェクトはセッションとしての役割があるからです。これは、現在のエディタの設定が、.lpiファイルに記録され、そのプロジェクトを開いたときに再開できるようになっています。たとえば、あなたがアプリケーションをデバッグしていて、多くのブレークポイントやブックマークを開いていたとしましょう。あなたは、いつでもプロジェクトを保存することができ、lazarusを終了したり、他のプロジェクトを開くことができます。その、デバッグ中に保存したプロジェクトを開くと(たとえ他のコンピュータで開いたとしても)、ブレークポイント、ブックマーク、開いていたファイル、カーソル位置、ジャンプヒストリ、などといったものが、復元できます。
39+
40+ひとつ重要なルールがあります。それは、 _常に_ プロジェクトは存在するということです(訳注:IDEが起動している最中に、ということでしょう)。 現在のプロジェクトを"close"する方法は、lazarusを終了するか、他のプロジェクトを開くしかありません。 これは、lazarusのプロジェクトはセッションとしての役割があるからです。これは、現在のエディタの設定が、.lpiファイルに記録され、そのプロジェクトを開いたときに再開できるようになっています。たとえば、あなたがアプリケーションをデバッグしていて、多くのブレークポイントやブックマークを開いていたとしましょう。あなたは、いつでもプロジェクトを保存することができ、lazarusを終了したり、他のプロジェクトを開くことができます。その、デバッグ中に保存したプロジェクトを開くと(たとえ他のコンピュータで開いたとしても)、ブレークポイント、ブックマーク、開いていたファイル、カーソル位置、ジャンプヒストリ、などといったものが、復元できます。
3641
3742### ソースエディタ
3843
39-ほとんどすべてのキーとショートカットが、enviroment -\> editor options-\>key mappingsで定義可能です。 LazarusのIDEには、ソースのための沢山のツールがあります。それらの多くは、Delphiと見た目も似ており、よくにた働きをします。しかし、一つの重要な相違点があります。すなわち、Lazarusはコード情報を取るために、コンパイラを利用しない、ということです。ソースコードを直接解析します。こうすることで、沢山の重要な利点があります。
44+ほとんどすべてのキーとショートカットが、enviroment -> editor options->key mappingsで定義可能です。 LazarusのIDEには、ソースのための沢山のツールがあります。それらの多くは、Delphiと見た目も似ており、よくにた働きをします。しかし、一つの重要な相違点があります。すなわち、Lazarusはコード情報を取るために、コンパイラを利用しない、ということです。ソースコードを直接解析します。こうすることで、沢山の重要な利点があります。
4045
41-ソースエディタは、"comments"と一緒に動作します。Delphiにおいては、ソース中のコメントは、コードの間の場所にあるものにすぎません。自動でコードが挿入されても、特別な働きはしないので、すでに入れたコメントは迷子になってしまうかもしれません。Lazarusでは、コメントの中のコードでさえ、宣言を見つけることができます。 これは、完璧に信頼できるものではないかもしれませんが、よく役に立ってます。新しいコードが挿入されると、IDEは発見的な方法を使ってコメントとコードを結び付けます。たとえば、"c: char; // comment"という行は分割されることはありません。
46+ソースエディタは、"comments"と一緒に動作します。Delphiにおいては、ソース中のコメントは、コードの間の場所にあるものにすぎません。自動でコードが挿入されても、特別な働きはしないので、すでに入れたコメントは迷子になってしまうかもしれません。Lazarusでは、コメントの中のコードでさえ、宣言を見つけることができます。 これは、完璧に信頼できるものではないかもしれませんが、よく役に立ってます。新しいコードが挿入されると、IDEは発見的な方法を使ってコメントとコードを結び付けます。たとえば、"c: char; // comment"という行は分割されることはありません。
4247
43-Delphiの"コード補完"(Ctrl+Space)機能は、Lazarusでは、"Identifier Completion"と呼ばれます。Lazarusにおいて、コード補完は、"自動的なクラス補完"(Delphiとおなじです)、"ローカル変数補完"、"イベント割り当て補完"のあわせた機能です。これらのすべては、Ctrl+Shift+Cで呼び出され、IDEは、カーソルの位置から、何をなすべきか決定します。
48+Delphiの"コード補完"(Ctrl+Space)機能は、Lazarusでは、"Identifier Completion"と呼ばれます。Lazarusにおいて、コード補完は、"自動的なクラス補完"(Delphiとおなじです)、"ローカル変数補完"、"イベント割り当て補完"のあわせた機能です。これらのすべては、Ctrl+Shift+Cで呼び出され、IDEは、カーソルの位置から、何をなすべきか決定します。
4449
4550#### ローカル変数補完の例
4651
47-ちょうど新しいメソッドを作り、"i:=3;"という命令を書いたとしましょう。
48-
49-``` pascal
52+ちょうど新しいメソッドを作り、"i:=3;"という命令を書いたとしましょう。
53+```
5054procedure TForm1.DoSomething;
51-begin
52- i := 3;
53-end;
55+ begin
56+ i := 3;
57+ end;
5458```
5559
56-識別子"i"の上にカーソルをおいて、Ctrl+Shift+Cを押すと、次のようになります。
57-
58-``` pascal
60+識別子"i"の上にカーソルをおいて、Ctrl+Shift+Cを押すと、次のようになります。
61+```
5962procedure TForm1.DoSomething;
60-var
61- i: Integer;
62-begin
63- i := 3;
64-end;
63+ var
64+ i: Integer;
65+ begin
66+ i := 3;
67+ end;
6568```
6669
6770#### イベント割当補完の例
6871
69-オブジェクトインスペクタの良い機能のひとつに、自動的にメソッドを作ること、があります。ソースエディタでやってみてください。
70-
71-たとえば:
72+オブジェクトインスペクタの良い機能のひとつに、自動的にメソッドを作ること、があります。ソースエディタでやってみてください。
7273
73-``` pascal
74+たとえば:
75+```
7476Button1.OnClick:=
7577```
7678
77-代入演算子":="の後で、Ctrl+Shift+Cを押してみてください。
79+代入演算子":="の後で、Ctrl+Shift+Cを押してみてください。
7880
7981#### 手続呼出補完の例
8082
81-今 "DoSomething(Width);" という文を書き終えた所だとします:
82-
83-``` pascal
83+今 "DoSomething(Width);" という文を書き終えた所だとします:
84+```
8485procedure SomeProcedure;
85-var
86- Width: integer;
87-begin
88- Width:=3;
89- DoSomething(Width);
90-end;
86+ var
87+ Width: integer;
88+ begin
89+ Width:=3;
90+ DoSomething(Width);
91+ end;
9192```
9293
93-識別子 "DoSomething" の上にカーソルを置いて、Ctrl+Shift+C を押すと、こうなります:
94-
95-``` pascal
94+識別子 "DoSomething" の上にカーソルを置いて、Ctrl+Shift+C を押すと、こうなります:
95+```
9696procedure DoSomething(aWidth: LongInt);
97-begin
98-
99-end;
100-
101-procedure SomeProcedure;
102-var
103- Width: integer;
104-begin
105- Width:=3;
106- DoSomething(Width);
107-end;
97+ begin
98+
99+ end;
100+
101+ procedure SomeProcedure;
102+ var
103+ Width: integer;
104+ begin
105+ Width:=3;
106+ DoSomething(Width);
107+ end;
108108```
109109
110110#### 語彙補完 Ctrl+W
111111
112-識別子補完と似ていますが、パスカルの識別子に対してではなく、すべての語彙に対して補完します。あなたが開いているすべてのファイルの中から、あなたがタイプし始めた文字が同じものの語彙をリストアップし、選択できます。
112+識別子補完と似ていますが、パスカルの識別子に対してではなく、すべての語彙に対して補完します。あなたが開いているすべてのファイルの中から、あなたがタイプし始めた文字が同じものの語彙をリストアップし、選択できます。
113113
114114#### インクルードファイルのサポート
115115
116-Delphiではインクルードファイルをサポートしていませんので(訳注:\$iがあるので、補完機能が、ということだろう)、多分、みなさんは多くのインクルードファイルを今までに作っていないかもしれません。しかし、インクルードファイルには、大きな利点があります。それは、IFDEFでソースコードを汚さずに、プラットホーム独立なコードを書けるということです。 Lazarusでは、メソッドジャンプ、クラス補完、宣言を見つける、など、すべての機能は、インクルードファイルに対しても働きます。 また、コーディング機能にいろんなオプションがあります。
116+Delphiではインクルードファイルをサポートしていませんので(訳注:$iがあるので、補完機能が、ということだろう)、多分、みなさんは多くのインクルードファイルを今までに作っていないかもしれません。しかし、インクルードファイルには、大きな利点があります。それは、IFDEFでソースコードを汚さずに、プラットホーム独立なコードを書けるということです。 Lazarusでは、メソッドジャンプ、クラス補完、宣言を見つける、など、すべての機能は、インクルードファイルに対しても働きます。 また、コーディング機能にいろんなオプションがあります。
117117
118118### デザイナ
119119
120-\- ガイドライン
120+\- ガイドライン
121121
122122#### オブジェクト・インスペクタ
123123
124-DelphiとLazarusのIDEでは、オブジェクトインスペクタはコンポーネントプロパティを編集したり、イベントを設定したりするのに使われます。使い方に、いくつかの小さな違いがあります。
124+DelphiとLazarusのIDEでは、オブジェクトインスペクタはコンポーネントプロパティを編集したり、イベントを設定したりするのに使われます。使い方に、いくつかの小さな違いがあります。
125125
126-1. Delphi5を起動すると、オブジェクトインスペクタのなかで、階層にしたがって伝統的なドロップダウンリストでオブジェクトを選択できるオブジェクトツリービューがあります。Lazarusでは、これは、オブジェクトインスペクタの一部にすぎません。デフォルトのドロップダウンリストのかわりに、右クリックで表示される"Show Component Tree"メニューを使うこともできます。
127-2. Delphiでは、空のイベントでダブルクリックすると、自動的にイベントを作成し、ソースエディターがその位置を開きます。Lazarusは右側にボタンがあり、ドロップダウンでイベントを作成することができます。
128-3. Delphiでは、つけられたイベント名は手で消さなくてはなりませんが、Lazarusでは、"(None)"をドロップダウンで選ぶことができます。
129-4. Eventと同じように、booleanのような標準的なプロパティをダブルクリックすることでは、値は変化しません。値を変えるには、ドロップダウンで選択する必要があります。そして、エディターフォームで結び付けられているものを開くには、editやdrop-downの右側にある'...'ボタンをクリックする必要があります。
126+ 1. Delphi5を起動すると、オブジェクトインスペクタのなかで、階層にしたがって伝統的なドロップダウンリストでオブジェクトを選択できるオブジェクトツリービューがあります。Lazarusでは、これは、オブジェクトインスペクタの一部にすぎません。デフォルトのドロップダウンリストのかわりに、右クリックで表示される"Show Component Tree"メニューを使うこともできます。
127+ 2. Delphiでは、空のイベントでダブルクリックすると、自動的にイベントを作成し、ソースエディターがその位置を開きます。Lazarusは右側にボタンがあり、ドロップダウンでイベントを作成することができます。
128+ 3. Delphiでは、つけられたイベント名は手で消さなくてはなりませんが、Lazarusでは、"(None)"をドロップダウンで選ぶことができます。
129+ 4. Eventと同じように、booleanのような標準的なプロパティをダブルクリックすることでは、値は変化しません。値を変えるには、ドロップダウンで選択する必要があります。そして、エディターフォームで結び付けられているものを開くには、editやdrop-downの右側にある'...'ボタンをクリックする必要があります。
130130
131131#### パッケージ
132132
133-LazarusはDelphiのパッケージをインストールして使うことはできますか?
133+LazarusはDelphiのパッケージをインストールして使うことはできますか?
134134
135-いいえ、なぜなら、それには、Delphiのコンパイラマジック(訳注:Pascalではない部分の特殊な文法)が必要だからです。
135+いいえ、なぜなら、それには、Delphiのコンパイラマジック(訳注:Pascalではない部分の特殊な文法)が必要だからです。
136136
137-私たちは、Lazarus向けに特別にパッケージを作りたいのですが?
137+私たちは、Lazarus向けに特別にパッケージを作りたいのですが?
138138
139-はい。新しくパッケージをつくり、パッケージソースディレクトリに保存してください。 通常は dpkファイルと同じディレクトリです。そして、LCLを必要とするパッケージとして加えて、最後に.pasファイルを加えてください。それを今すぐインストールしたり、プロジェクトで使うことができます。 LazarusとDelphiのパッケージで、いくつかの違いがありますので、lazarusのソース内のdocs/Packages.txtを読んでください。
139+はい。新しくパッケージをつくり、パッケージソースディレクトリに保存してください。 通常は dpkファイルと同じディレクトリです。そして、LCLを必要とするパッケージとして加えて、最後に.pasファイルを加えてください。それを今すぐインストールしたり、プロジェクトで使うことができます。 LazarusとDelphiのパッケージで、いくつかの違いがありますので、lazarusのソース内のdocs/Packages.txtを読んでください。
140140
141+
142+
143+
144+
141145### VCL から LCL へ
142146
143-VCLとLCLは、ともに、高速なアプリケーション開発向けの、オブジェクト指向の階層的なコンポーネントのライブラリです。しかし、それらは同じではありません。 たとえば、VCLは多くの非ビジュアルなコンポーネントを含みます。一方、LCLは、[[Free Pascal|Free Pascalによって]]、多くの「ビジュアルでない」コンポーネント(データベースアクセスなど)が提供されていますので、ビジュアルなコンポーネントのみ、を提供しようとしています。 (訳注:データベースの表示については、ビジュアルである。そのなかで使われるデータベースアクセス自体はLCLコンポーネント内に統合されていると思われる)
147+VCLとLCLは、ともに、高速なアプリケーション開発向けの、オブジェクト指向の階層的なコンポーネントのライブラリです。しかし、それらは同じではありません。 たとえば、VCLは多くの非ビジュアルなコンポーネントを含みます。一方、LCLは、[[Free Pascal]]によって、多くの「ビジュアルでない」コンポーネント(データベースアクセスなど)が提供されていますので、ビジュアルなコンポーネントのみ、を提供しようとしています。 (訳注:データベースの表示については、ビジュアルである。そのなかで使われるデータベースアクセス自体はLCLコンポーネント内に統合されていると思われる)
144148
145-加えていうと、VCL等にある多くのコントロールが、LCLには存在しないかもしれませんし、同じようなコントロールが両方に存在する場合でも、それらはクローンではありません。 ですから、もし移植をするなら、アプリケーション、コンポーネント、およびコントロールのそれぞれで変更が必要です。
149+
150+加えていうと、VCL等にある多くのコントロールが、LCLには存在しないかもしれませんし、同じようなコントロールが両方に存在する場合でも、それらはクローンではありません。 ですから、もし移植をするなら、アプリケーション、コンポーネント、およびコントロールのそれぞれで変更が必要です。
146151
147-次のことはDelphiユーザのために、DelphiとLazarusの主要な違いや、互換性のない所を、包み隠さずに明らかにしようとするものです。これは、主にD4でのVCL(D5,D6,D7も同様です)と、現在のCVSに、あるがままのLCLの違いをカバーしました。あなたがいつも使っているDelphiやLCLのバージョンに完全に一致しないかもしれません。もし、これらの記述が正確でないとすれば、他の皆さんの理解のために、ご自由に記述を加えたり、変更してください。
152+次のことはDelphiユーザのために、DelphiとLazarusの主要な違いや、互換性のない所を、包み隠さずに明らかにしようとするものです。これは、主にD4でのVCL(D5,D6,D7も同様です)と、現在のCVSに、あるがままのLCLの違いをカバーしました。あなたがいつも使っているDelphiやLCLのバージョンに完全に一致しないかもしれません。もし、これらの記述が正確でないとすれば、他の皆さんの理解のために、ご自由に記述を加えたり、変更してください。
148153
149154#### TControl.Font/TControl.ParentFontについて
150155
151-VCLでは、コントロールにフォントのプロパティとして、ボールドやイタリック、特定のフォント名と等を使用し、通常はこの値がいつも子へと引き継がれていきます。 さらに、コントロールがいつもParentのフォントを確実にする継承するために、TControl.ParentFontプロパティを提供しています。 OSにウインドウの見え方の設定があるのですが、コントロールのプロパティが常時優先されるということを暗に決めてつけてしまっています。
156+VCLでは、コントロールにフォントのプロパティとして、ボールドやイタリック、特定のフォント名と等を使用し、通常はこの値がいつも子へと引き継がれていきます。 さらに、コントロールがいつもParentのフォントを確実にする継承するために、TControl.ParentFontプロパティを提供しています。 OSにウインドウの見え方の設定があるのですが、コントロールのプロパティが常時優先されるということを暗に決めてつけてしまっています。
152157
153-(訳注:Windowsで画面で大きい文字などが選択できるが、他のデスクトップではもっと多くのことが指定できるものがあるので、Delphiにおいてもシステムフォントを取得することが望ましい、とされる場合もあるが、きっちりデザインが難しくなる。)
158+(訳注:Windowsで画面で大きい文字などが選択できるが、他のデスクトップではもっと多くのことが指定できるものがあるので、Delphiにおいてもシステムフォントを取得することが望ましい、とされる場合もあるが、きっちりデザインが難しくなる。)
154159
155-このフォントについての機能、解釈はLCLでは、異なっています。 現実にクロスプラットフォーム/クロスインタフェースであるLCLは、バランスのとれた手法を好んで採用しようとしています。LCLは、いつでも、どんなウィジェットでのネイティブのDesktop/ツールキットのApearance、Theme設定も使用しようとします。 例えば、テーマが、ボタンのための特定の字体を供給するGTKインタフェース、およびgtkを使用することがありますが、LCLボタンはいつもこのテーマに沿った字体を使用します。
160+このフォントについての機能、解釈はLCLでは、異なっています。 現実にクロスプラットフォーム/クロスインタフェースであるLCLは、バランスのとれた手法を好んで採用しようとしています。LCLは、いつでも、どんなウィジェットでのネイティブのDesktop/ツールキットのApearance、Theme設定も使用しようとします。 例えば、テーマが、ボタンのための特定の字体を供給するGTKインタフェース、およびgtkを使用することがありますが、LCLボタンはいつもこのテーマに沿った字体を使用します。
156161
157-このことは、ほとんどのLCLコントロールはVCLで当たり前になっている、設計上のフォントなどの管理機能は持っていない、ということです。 しかし、もし、この仕様を変更したければ、使用されるインターフェースにかかわらず、この様に統一的に割り当てられたインタフェースに代わり、Canvasに独自で描画するカスタムコントロールを使うことができます。
162+このことは、ほとんどのLCLコントロールはVCLで当たり前になっている、設計上のフォントなどの管理機能は持っていない、ということです。 しかし、もし、この仕様を変更したければ、使用されるインターフェースにかかわらず、この様に統一的に割り当てられたインタフェースに代わり、Canvasに独自で描画するカスタムコントロールを使うことができます。
158163
159-例えば太字や、特別な色の字体のLabelが必要な場合、代わりにTStaticTextを使用しなければなりません。 なぜなら、TLabelは特定のコントロールのインタフェースであり、すべてのインタフェースのネイティブなバージョンを供給するのであるならば、その大部分は、すべての環境が考慮されないかもしれない、デフォルトの設定が利用されるでしょう。
164+例えば太字や、特別な色の字体のLabelが必要な場合、代わりにTStaticTextを使用しなければなりません。 なぜなら、TLabelは特定のコントロールのインタフェースであり、すべてのインタフェースのネイティブなバージョンを供給するのであるならば、その大部分は、すべての環境が考慮されないかもしれない、デフォルトの設定が利用されるでしょう。
160165
161166#### ドラッグとドッキングの制御
162167
163-VCLでは、実行中に、例えば1個のパネルからコントロールをドラッグして、別のパネルにドッキングできるように、ほとんどのTWinControlからの派生コントロールは、ドラッグ、ドッキングを制御する機能が組み込まれています。
164-
165-この機能はLCLでは、現在、未完成であり、実装されていません。現在、設計の初期段階です。このタイプのふるまいが、同じような方法で、同等のレベルの互換性を維持するように、最終的には、サポートしてくれると思います。
168+VCLでは、実行中に、例えば1個のパネルからコントロールをドラッグして、別のパネルにドッキングできるように、ほとんどのTWinControlからの派生コントロールは、ドラッグ、ドッキングを制御する機能が組み込まれています。
166169
167-これは、現在、どんなControlも以下のTControlの機能、プロシージャ、プロパティを継承していない、使っていない、ということを意味します。
170+この機能はLCLでは、現在、未完成であり、実装されていません。現在、設計の初期段階です。このタイプのふるまいが、同じような方法で、同等のレベルの互換性を維持するように、最終的には、サポートしてくれると思います。
168171
169-``` pascal
172+これは、現在、どんなControlも以下のTControlの機能、プロシージャ、プロパティを継承していない、使っていない、ということを意味します。
173+```
170174Protected
171- function GetDockEdge(MousePos: TPoint): TAlign;
172- function GetDragImages: TDragImageList;
173- function GetFloating: Boolean;
174- function GetFloatingDockSiteClass: TWinControlClass;
175- procedure DoEndDrag(Target:TObject); X, Y: Integer);
176- procedure DockTrackNoTarget(Source: TDragDockObject; X, Y: Integer);
177- procedure DoEndDock(Target: TObject; X, Y: Integer);
178- procedure DoDock(NewDockSite: TWinControl; var ARect: TRect);
179- procedure DoStartDock(var DragObject: TDragObject);
180- procedure DragCanceled;
181- procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState;
182- var Accept: Boolean);
183- procedure DoEndDrag(Target: TObject; X, Y: Integer);
184- procedure DoStartDrag(var DragObject: TDragObject);
185- procedure DrawDragDockImage(DragDockObject: TDragDockObject);
186- procedure EraseDragDockImage(DragDockObject: TDragDockObject);
187- procedure PositionDockRect(DragDockObject: TDragDockObject);
188- procedure SetDragMode(Value: TDragMode);
189- property DragKind: TDragKind;
190- property DragCursor: TCursor;
191- property DragMode: TDragMode;
192- property OnDragDrop: TDragDropEvent;
193- property OnDragOver: TDragOverEvent;
194- property OnEndDock: TEndDragEvent;
195- property OnEndDrag: TEndDragEvent;
196- property OnStartDock: TStartDockEvent;
197- property OnStartDrag: TStartDragEvent;
198-public
199- function Dragging: Boolean;
200- function ManualDock(NewDockSite: TWinControl; DropControl: TControl;
201- ControlSide: TAlign): Boolean;
202- function ManualFloat(ScreenPos: TRect): Boolean;
203- function ReplaceDockedControl(Control: TControl; NewDockSite: TWinControl;
204- DropControl: TControl; ControlSide: TAlign): Boolean;
205- procedure BeginDrag(Immediate: Boolean; Threshold: Integer);
206- procedure Dock(NewDockSite: TWinControl; ARect: TRect);
207- procedure DragDrop(Source: TObject; X, Y: Integer);
208- procedure EndDrag(Drop: Boolean);
209- property DockOrientation: TDockOrientation;
210- property Floating: Boolean;
211- property FloatingDockSiteClass: TWinControlClass;
212- property HostDockSite: TWinControl;
213- property LRDockWidth: Integer;
214- property TBDockHeight: Integer;
215- property UndockHeight: Integer;
216- property UndockWidth: Integer;
175+ function GetDockEdge(MousePos: TPoint): TAlign;
176+ function GetDragImages: TDragImageList;
177+ function GetFloating: Boolean;
178+ function GetFloatingDockSiteClass: TWinControlClass;
179+ procedure DoEndDrag(Target:TObject); X, Y: Integer);
180+ procedure DockTrackNoTarget(Source: TDragDockObject; X, Y: Integer);
181+ procedure DoEndDock(Target: TObject; X, Y: Integer);
182+ procedure DoDock(NewDockSite: TWinControl; var ARect: TRect);
183+ procedure DoStartDock(var DragObject: TDragObject);
184+ procedure DragCanceled;
185+ procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState;
186+ var Accept: Boolean);
187+ procedure DoEndDrag(Target: TObject; X, Y: Integer);
188+ procedure DoStartDrag(var DragObject: TDragObject);
189+ procedure DrawDragDockImage(DragDockObject: TDragDockObject);
190+ procedure EraseDragDockImage(DragDockObject: TDragDockObject);
191+ procedure PositionDockRect(DragDockObject: TDragDockObject);
192+ procedure SetDragMode(Value: TDragMode);
193+ property DragKind: TDragKind;
194+ property DragCursor: TCursor;
195+ property DragMode: TDragMode;
196+ property OnDragDrop: TDragDropEvent;
197+ property OnDragOver: TDragOverEvent;
198+ property OnEndDock: TEndDragEvent;
199+ property OnEndDrag: TEndDragEvent;
200+ property OnStartDock: TStartDockEvent;
201+ property OnStartDrag: TStartDragEvent;
202+ public
203+ function Dragging: Boolean;
204+ function ManualDock(NewDockSite: TWinControl; DropControl: TControl;
205+ ControlSide: TAlign): Boolean;
206+ function ManualFloat(ScreenPos: TRect): Boolean;
207+ function ReplaceDockedControl(Control: TControl; NewDockSite: TWinControl;
208+ DropControl: TControl; ControlSide: TAlign): Boolean;
209+ procedure BeginDrag(Immediate: Boolean; Threshold: Integer);
210+ procedure Dock(NewDockSite: TWinControl; ARect: TRect);
211+ procedure DragDrop(Source: TObject; X, Y: Integer);
212+ procedure EndDrag(Drop: Boolean);
213+ property DockOrientation: TDockOrientation;
214+ property Floating: Boolean;
215+ property FloatingDockSiteClass: TWinControlClass;
216+ property HostDockSite: TWinControl;
217+ property LRDockWidth: Integer;
218+ property TBDockHeight: Integer;
219+ property UndockHeight: Integer;
220+ property UndockWidth: Integer;
217221```
218222
219-that the following classes do not exist/are unusable -
220-
221-``` pascal
223+that the following classes do not exist/are unusable -
224+```
222225TDragImageList = class(TCustomImageList)
223-TDockZone = class
224-TDockTree = class(TInterfacedObject, IDockManager)
225-TDragObject = class(TObject)
226-TBaseDragControlObject = class(TDragObject)
227-TDragControlObject = class(TBaseDragControlObject)
228-TDragDockObject = class(TBaseDragControlObject)
226+ TDockZone = class
227+ TDockTree = class(TInterfacedObject, IDockManager)
228+ TDragObject = class(TObject)
229+ TBaseDragControlObject = class(TDragObject)
230+ TDragControlObject = class(TBaseDragControlObject)
231+ TDragDockObject = class(TBaseDragControlObject)
229232```
230233
231-下記の関数も、利用できないか、互換性がありません。
232-
233-``` pascal
234+下記の関数も、利用できないか、互換性がありません。
235+```
234236function FindDragTarget(const Pos: TPoint;
235- AllowDisabled: Boolean) : TControl;
236-procedure CancelDrag;
237-function IsDragObject(sender: TObject): Boolean;
237+ AllowDisabled: Boolean) : TControl;
238+ procedure CancelDrag;
239+ function IsDragObject(sender: TObject): Boolean;
238240```
239241
240242#### TEdit、および、TCustomEditについて
241243
242-Editコントロールは、LCLもVCLと同等の機能をもっていますが、移植中に、いくつかの気をつけるべき点があります。
244+Editコントロールは、LCLもVCLと同等の機能をもっていますが、移植中に、いくつかの気をつけるべき点があります。
243245
244-1. GUIインターフェースでの制限で、TEdit.PasswordCharはすべてのインタフェースでは、まだ正常に機能しません。入力テキストを隠するために必要とする場合は、代わりに、TCustomEdit.EchoMode emPasswordを使用します。
245-2. ドラッグ、ドッキングイベントはまだ実装されていません。詳しくは、Control Dragging/Docking.
246-3. フォントプロパティは、GUIの統一性のためにたいてい無視されます。詳しくは、TControl.Font/TControl.ParentFont
246+ 1. GUIインターフェースでの制限で、TEdit.PasswordCharはすべてのインタフェースでは、まだ正常に機能しません。入力テキストを隠するために必要とする場合は、代わりに、TCustomEdit.EchoMode emPasswordを使用します。
247+ 2. ドラッグ、ドッキングイベントはまだ実装されていません。詳しくは、 Control Dragging/Docking.
248+ 3. フォントプロパティは、GUIの統一性のためにたいてい無視されます。詳しくは、 TControl.Font/TControl.ParentFont
247249
248-### (optional) TSplitter -\> TPairSplitter
250+### (optional) TSplitter -> TPairSplitter
249251
250252**Please Improve Me**
251253
252-There is now a TSplitter control in the LCL, so no need to convert it.
253-
254-Nevertheless, if you want, here it is explained:
255-
256-The 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):
257-
258-In 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.
259-
260-The 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.
261-
262-So what exactly are the differences?
263-
264-Well 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.
265-
266-On 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.
267-
268-The 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,
269-
270-In 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.
271-
272-For 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 :
273-
274-``` pascal
275-PairSplitter.Position := PairSplitter.Width - PairSplitter.Position;
276-```
254+There is now a TSplitter control in the LCL, so no need to convert it.
277255
278-So how can I convert existing code using TSplitter to the TPairSplitter?
256+Nevertheless, if you want, here it is explained:
279257
280-If 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 -
258+The following is loosely based on questions by [ Vincent Snijders](</User:Vincent> "User:Vincent") on the mailing list, and responses by [Andrew Johnson](<http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson>):
281259
282-**VCL**
260+In 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.
283261
284-**LCL**
262+The 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.
285263
286-``` pascal
287-var
288- BottomPanel: TPanel;
289- VerticalSplitter: TSplitter;
290- LeftPanel: TPanel;
291- HorizontalSplitter: TSplitter;
292- MainPanel: TPanel;
264+**So what exactly are the differences?**
293265
294-begin
295- BottomPanel:= TPanel.Create(Self);
296- with (BottomPanel) do
297- begin
298- Parent:= Self;
299- Height:= 75;
300- Align:= alBottom;
301- end;
266+Well 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.
302267
303- VerticalSplitter:= TSplitter.Create(Self);
304- with (VerticalSplitter) do
305- begin
306- Parent:= Self;
307- Align:= alBottom;
308- end;
268+On 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.
309269
310- HorizontalSplitter:= TSplitter.Create(Self);
311- with (HorizontalSplitter) do
312- begin
313- Parent:= Self;
314- align:= alLeft;
315- end;
270+The 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,
316271
317- LeftPanel:= TPanel.Create(Self);
318- with (LeftPanel) do
319- begin
320- Parent:= Self;
321- Width:= 125;
322- Align:= alLeft;
323- end;
272+In 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.
324273
325- MainPanel:= TPanel.Create(Self);
326- with (MainPanel) do
327- begin
328- Parent:= Self;
329- Align:= alClient;
330- Caption:= 'Hello';
331- end;
332-end;
274+For 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 :
333275```
334-
335-``` pascal
336-var
337- BottomPanel: TPanel;
338- VerticalSplitter: TPairSplitter;
339- LeftPanel: TPanel;
340- HorizontalSplitter: TPairSplitter;
341- MainPanel: TPanel;
342-
343-begin
344- VerticalSplitter:= TPairSplitter.Create(Self);
345- with (VerticalSplitter) do
346- begin
347- Parent:= Self;
348- Align:= alClient;
349- Width:= Self.Width;
350- Height:= Self.Height;
351- SplitterType:= pstVertical;
352- Position:= Height - 75;
353- Sides[0].Width:= Width;
354- Sides[0].Height:= Position;
355- end;
356-
357- HorizontalSplitter:= TPairSplitter.Create(Self);
358- with (HorizontalSplitter) do
359- begin
360- Parent:= VerticalSplitter.Sides[0];
361- Width:= Self.Width;
362- Height:= VerticalSplitter.Position;
363- align:= alClient;
364- SplitterType:= pstHorizontal;
365- Position:= 125;
366- end;
367-
368- LeftPanel:= TPanel.Create(Self);
369- with (LeftPanel) do
370- begin
371- Parent:= HorizontalSplitter.Sides[0];
372- Align:= alClient;
373- end;
374-
375- MainPanel:= TPanel.Create(Self);
376- with (MainPanel) do
377- begin
378- Parent:= HorizontalSplitter.Sides[1];
379- Align:= alClient;
380- Caption:= 'Hello';
381- end;
382-
383- BottomPanel:= TPanel.Create(Self);
384- with (BottomPanel) do
385- begin
386- Parent:= VerticalSplitter.Sides[1];
387- Align:= alClient;
388- end;
389-end;
276+PairSplitter.Position := PairSplitter.Width - PairSplitter.Position;
390277```
391278
392-So 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.
393-
394-So the above example would be something like -
395-
396-**Delphi DFM**
397-
398-**(extraneous values removed)**
399-
400-**Lazarus LFM**
279+**So how can I convert existing code using TSplitter to the TPairSplitter?**
401280
402-**(most width, height, etc. removed)**
281+If 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 -
403282
404-``` lfm
405-object VerticalSplitter: TSplitter
406- Height = 3
407- Cursor = crVSplit
408- Align = alBottom
409-end
410-object HorizontalSplitter: TSplitter
411- Width = 3
412- Align = alLeft
413-end
414-object BottomPanel: TPanel
415- Height = 75
416- Align = alBottom
417-end
418-object LeftPanel: TPanel
419- Width = 125
420- Align = alLeft
421-end
422-object MainPanel: TPanel
423- Align = alClient
424-end
425-```
283+**VCL** | **LCL**
284+---|---
285+var BottomPanel: TPanel; VerticalSplitter: TSplitter; LeftPanel: TPanel; HorizontalSplitter: TSplitter; MainPanel: TPanel; begin BottomPanel:= TPanel.Create(Self); with (BottomPanel) do begin Parent:= Self; Height:= 75; Align:= alBottom; end; VerticalSplitter:= TSplitter.Create(Self); with (VerticalSplitter) do begin Parent:= Self; Align:= alBottom; end; HorizontalSplitter:= TSplitter.Create(Self); with (HorizontalSplitter) do begin Parent:= Self; align:= alLeft; end; LeftPanel:= TPanel.Create(Self); with (LeftPanel) do begin Parent:= Self; Width:= 125; Align:= alLeft; end; MainPanel:= TPanel.Create(Self); with (MainPanel) do begin Parent:= Self; Align:= alClient; Caption:= 'Hello'; end; end; | var BottomPanel: TPanel; VerticalSplitter: TPairSplitter; LeftPanel: TPanel; HorizontalSplitter: TPairSplitter; MainPanel: TPanel; begin VerticalSplitter:= TPairSplitter.Create(Self); with (VerticalSplitter) do begin Parent:= Self; Align:= alClient; Width:= Self.Width; Height:= Self.Height; SplitterType:= pstVertical; Position:= Height - 75; Sides[0].Width:= Width; Sides[0].Height:= Position; end; HorizontalSplitter:= TPairSplitter.Create(Self); with (HorizontalSplitter) do begin Parent:= VerticalSplitter.Sides[0]; Width:= Self.Width; Height:= VerticalSplitter.Position; align:= alClient; SplitterType:= pstHorizontal; Position:= 125; end; LeftPanel:= TPanel.Create(Self); with (LeftPanel) do begin Parent:= HorizontalSplitter.Sides[0]; Align:= alClient; end; MainPanel:= TPanel.Create(Self); with (MainPanel) do begin Parent:= HorizontalSplitter.Sides[1]; Align:= alClient; Caption:= 'Hello'; end; BottomPanel:= TPanel.Create(Self); with (BottomPanel) do begin Parent:= VerticalSplitter.Sides[1]; Align:= alClient; end; end;
286+
287+So 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.
426288
427-``` lfm
428-object VerticalSplitter: TPairSplitter
429- Align = alClient
430- SplitterType = pstVertical
431- Position = 225
432- Height = 300
433- Width = 400
434- object Pairsplitterside1: TPairSplitterIde
435- object HorizontalSplitter: TPairSplitter
436- Align = alClient
437- Position = 125
438- object Pairsplitterside3: TPairSplitterIde
439- Width = 125
440- object LeftPanel: TPanel
441- Align = alClient
442- Width = 125
443- end
444- end
445- object Pairsplitterside4: TPairSplitterIde
446- object MainPanel: TPanel
447- Align = alClient
448- end
449- end
450- end
451- end
452- object Pairsplitterside2: TPairSplitterIde
453- object BottomPanel: TPanel
454- Align = alClient
455- Height = 75
456- end
457- end
458-end
459-```
289+So the above example would be something like -
460290
291+**Delphi DFM** **(extraneous values removed)** | **Lazarus LFM** **(most width, height, etc. removed)**
292+---|---
293+object VerticalSplitter: TSplitter Height = 3 Cursor = crVSplit Align = alBottom end object HorizontalSplitter: TSplitter Width = 3 Align = alLeft end object BottomPanel: TPanel Height = 75 Align = alBottom end object LeftPanel: TPanel Width = 125 Align = alLeft end object MainPanel: TPanel Align = alClient end | object VerticalSplitter: TPairSplitter Align = alClient SplitterType = pstVertical Position = 225 Height = 300 Width = 400 object Pairsplitterside1: TPairSplitterIde object HorizontalSplitter: TPairSplitter Align = alClient Position = 125 object Pairsplitterside3: TPairSplitterIde Width = 125 object LeftPanel: TPanel Align = alClient Width = 125 end end object Pairsplitterside4: TPairSplitterIde object MainPanel: TPanel Align = alClient end end end end object Pairsplitterside2: TPairSplitterIde object BottomPanel: TPanel Align = alClient Height = 75 end end end
294+
461295### TCustomTreeView、およびTTreeViewについて
462296
463-VCLにもLCLにも、TCustomTreeView/TTreeViewのコンポーネントがあります。 ツリー構造化されたデータのリストで、複数のノードや、高度なセレクション、イメージリストなどの機能があります。 多くの機能は同等ですが、すべてのプロパティがまったくおなじではありません。主な相違点は以下です。
297+VCLにもLCLにも、TCustomTreeView/TTreeViewのコンポーネントがあります。 ツリー構造化されたデータのリストで、複数のノードや、高度なセレクション、イメージリストなどの機能があります。 多くの機能は同等ですが、すべてのプロパティがまったくおなじではありません。主な相違点は以下です。
464298
465299**Incomplete list, also update to include TCustomTreeView Mark functions and protected methods**
466300
467-1. LCLには、 TCustomTreeView.Optionsがあります。これは、コントロールが変更されたときのふるまいと見かけのオプションです。これらのオプションは次の通りです。:
468- - tvoAllowMultiselect - 複数のノードを選択できるモードです。eDelphi6のVCLのTCustomTreeView.MultiSelectと同等です。
469- - tvoAutoExpand - ノードを自動展開します。TCustomTreeView.AutoExpandと同様です。
470- - tvoAutoInsertMark - マウスが上を動くとドラッグのプレビューを更新します。
471- - tvoAutoItemHeight - Itemの高さを自動的に調節します。
472- - tvoHideSelection - 選択したItemをマークしません。
473- - tvoHotTrack - ホットトラッキングをおこないます。TCustomTreeview.HotTrackを有効にするのと同等です。
474- - tvoKeepCollapsedNodes - ノードを折畳んだりしたときに、子ノードを維持します。
475- - tvoReadOnly - TreeviewをReadOnlyにします。TCustomTreeviewのReadOnlyを有効にするのと同等です。
476- - tvoRightClickSelect - ノードをマウスの右クリックで選択状態にできるようにします。TCustomTreeView.RightClickSelectを有効にするのと同等です。
477- - tvoRowSelect - 行選択を可能にします。TCustomTreeView.RowSelectを有効にするのと同等です。
478- - tvoShowButtons - ボタンを表示します。TCustomTreeView.ShowButtonsを有効にするのと同等です。
479- - tvoShowLines - ノードへの線を表示します。TCustomTreeView.ShowLinesを有効にするのと同等です。
480- - tvoShowRoot - ルートノードを表示します。TCustomTreeView.ShowRootを有効にするのと同等です。
481- - tvoShowSeparators - セパレータを表示します。
482- - tvoToolTips - 個々のノードに、ツールチップを表示します。
483-2. LCLは次のプロパティを追加しました:
484- - TCustomTreeView.OnSelectionChange イベント
485- - TCustomTreeView.DefaultItems, アイテムのデフォルト設定のためのものです。
486- - TCustomTreeView.ExpandSignType ノードの展開、折りたたみの際のサインを決定します。
487-3. LCLにあるほとんどのドラッグ、ドッキングイベントは動作しません。これについてのより詳細な情報は、前の「ドラッグとドッキングの制御」を見てください。
301+ 1. LCLには、 TCustomTreeView.Optionsがあります。これは、コントロールが変更されたときのふるまいと見かけのオプションです。これらのオプションは次の通りです。:
302+ * tvoAllowMultiselect - 複数のノードを選択できるモードです。eDelphi6のVCLのTCustomTreeView.MultiSelectと同等です。
303+ * tvoAutoExpand - ノードを自動展開します。TCustomTreeView.AutoExpandと同様です。
304+ * tvoAutoInsertMark - マウスが上を動くとドラッグのプレビューを更新します。
305+ * tvoAutoItemHeight - Itemの高さを自動的に調節します。
306+ * tvoHideSelection - 選択したItemをマークしません。
307+ * tvoHotTrack - ホットトラッキングをおこないます。TCustomTreeview.HotTrackを有効にするのと同等です。
308+ * tvoKeepCollapsedNodes - ノードを折畳んだりしたときに、子ノードを維持します。
309+ * tvoReadOnly - TreeviewをReadOnlyにします。TCustomTreeviewのReadOnlyを有効にするのと同等です。
310+ * tvoRightClickSelect - ノードをマウスの右クリックで選択状態にできるようにします。TCustomTreeView.RightClickSelectを有効にするのと同等です。
311+ * tvoRowSelect - 行選択を可能にします。TCustomTreeView.RowSelectを有効にするのと同等です。
312+ * tvoShowButtons - ボタンを表示します。TCustomTreeView.ShowButtonsを有効にするのと同等です。
313+ * tvoShowLines - ノードへの線を表示します。TCustomTreeView.ShowLinesを有効にするのと同等です。
314+ * tvoShowRoot - ルートノードを表示します。TCustomTreeView.ShowRootを有効にするのと同等です。
315+ * tvoShowSeparators - セパレータを表示します。
316+ * tvoToolTips - 個々のノードに、ツールチップを表示します。
317+ 2. LCLは次のプロパティを追加しました:
318+ * TCustomTreeView.OnSelectionChange イベント
319+ * TCustomTreeView.DefaultItems, アイテムのデフォルト設定のためのものです。
320+ * TCustomTreeView.ExpandSignType ノードの展開、折りたたみの際のサインを決定します。
321+ 3. LCLにあるほとんどのドラッグ、ドッキングイベントは動作しません。これについてのより詳細な情報は、前の「ドラッグとドッキングの制御」を見てください。
488322
489323### Messages / Events
490324
491-The 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).
325+The 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).
492326
493-**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]]
327+**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]]
494328
495329## Original Contributors and changes
496330
497-This page has been converted from the epikwiki [version](http://lazarus-ccr.sourceforge.net/index.php?wiki=LazarusForDelphiUsers).
331+This page has been converted from the epikwiki [version](<http://lazarus-ccr.sourceforge.net/index.php?wiki=LazarusForDelphiUsers>).
498332
499-- Initial import and formatting - VlxAdmin 9/26/2003
500-- Begin VCL -\> LCL with a section on TSplitter -\> TPairSplitter - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 9/30/2003
501-- Add TControl.Font/TControl.ParentFont to VCL -\> LCL - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 9/30/2003
502-- Update TEdit/TCustomEdit section in VCL -\> LCL - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 10/1/2003
503-- Add Control Dragging/Docking to VCL -\> LCL - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 10/1/2003
504-- Added "Object Inspector" to Delphi IDE -\> Lazarus IDE - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 10/1/2003
505-- Added initial "TCustomTreeView/TTreeView" to VCL -\> LCL - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 10/1/2003
506-- Added introduction to VCL -\> LCL - [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson) 10/1/2003
507-- Fixed some typos - Vincent 10/2/2003
508-- Fixed Typo User:Kirkpatc 20 May 2004
333+ * Initial import and formatting - [ VlxAdmin](</User:Tom> "User:Tom") 9/26/2003
334+ * Begin VCL -> LCL with a section on TSplitter -> TPairSplitter - [Andrew Johnson](<http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson>) 9/30/2003
335+ * Add TControl.Font/TControl.ParentFont to VCL -> LCL - [Andrew Johnson](<http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson>) 9/30/2003
336+ * Update TEdit/TCustomEdit section in VCL -> LCL - [Andrew Johnson](<http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson>) 10/1/2003
337+ * Add Control Dragging/Docking to VCL -> LCL - [Andrew Johnson](<http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson>) 10/1/2003
338+ * Added "Object Inspector" to Delphi IDE -> Lazarus IDE - [Andrew Johnson](<http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson>) 10/1/2003
339+ * Added initial "TCustomTreeView/TTreeView" to VCL -> LCL - [Andrew Johnson](<http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson>) 10/1/2003
340+ * Added introduction to VCL -> LCL - [Andrew Johnson](<http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson>) 10/1/2003
341+ * Fixed some typos - [ Vincent](</User:Vincent> "User:Vincent") 10/2/2003
342+ * Fixed Typo [User:Kirkpatc](</User:Kirkpatc> "User:Kirkpatc") 20 May 2004
509343
510344## See Also
511345
512-[[Code Conversion Guide|Code Conversion Guide (from Delphi &amp; Kylix)]]
346+[[Code Conversion Guide|Code Conversion Guide (from Delphi & Kylix)]]
513347
514348[[Compile With Delphi]]
515349
516350---
517-*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).*
351+*From the Free Pascal wiki, page "Lazarus For Delphi Users/ja", as the Internet Archive kept it on 2025-10-03, last changed on 2020-02-19. 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