Sign in Join
Wiki copytemporary

Lazarus Tutorial/ja: what changed

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

Title: Lazarus Tutorial/ja

OldNewLine
1+*このLazarusチュートリアルに、遠慮なくあなたの経験を書き加えてみませんか? どうぞご遠慮なく。*
2+
3+## 概要
4+
5+Lazarusは Free Pascal コンパイラのためのフリーでオープンソースな開発ツールです。 Lazarus IDEは、機能が豊富なプログラム環境であり、単独で機能するGUIアプリケーションやコンソールアプリケーションを開発できます。 Lazarusは、現在 Linux、 FreeBSD、 Win32 そして Mac OS X の上で動作し、カスタマイズ可能なソースエディタ、FreePascalコンパイラと統合された完全なGUI、 パッケージマネージャやデバッガを持つビジュアルなフォーム作成環境を提供します。
6+
7+<figure>
8+<img src="Laz_ScreenShot_ja.png" title="スクリーンショット" />
9+<figcaption>スクリーンショット</figcaption>
10+</figure>
11+
12+## Lazarusでプログラムをはじめてみよう
13+
14+[[Installing Lazarus/ja|Lazarusをインストールして]]、起動してみてください。これだけで、Free PascalやLazarusをつかったプログラムをはじめてみることができます。
15+
16+起動すると、いくつかのウィンドウがデスクトップ上に現れます。上の方にはメインメニューがあります。左には、**[[IDE Window: Object Inspector/ja|オブジェクトインスペクタ]]**あります。そのほかのデスクトップの大部分は、**[[source code editor/ja|ソースコードエディタ]]**です。多分Form1ウィンドウが作られていて、ソースエディタに重なっているはずです。
17+
18+上の方にあるメニューウィンドウの、メニューの下にタブの列があります。'標準'タブが選択されていますね。そこでButtonアイコン(四角の中に「OK」と書いてあるもの)を探してクリックしてください。そして、Form1の上の左中央あたりでクリックしてください。すると'Button1'と書かれた四角い図形(=ボタンです)が現れるはずです。もう一回標準タブのButtonアイコンをクリックして、Form1の右中央でクリックしてください。'Button2'と書かれたボタンが現れます。
19+
20+Button1をクリックしましょう。オブジェクトインスペクタに、オブジェクトButton1のプロパティが表示されます。'Caption'と名付けられたプロパティに'Button1'と表示されていますね。その部分をクリックして'Button1'を'Press'に書き換えてください。あなたがENTERキーを押すか、別のボックスをクリックすれば、最初にForm1に置いたボタンが'Press'という名前になります。 続いて、オブジェクトインスペクタ上のイベントタブをクリックすると、ボタンに関連付けられている色々なイベントを見ることができます。 イベントには、たとえば、OnClick、OnEnter、OnExitなどがあります。OnClickボックスの右側を選択してください。小さなボックスが...と一緒に表示されます。あなたがこれをクリックすれば、自動的にソースエディタに移動してカーソルはコードの開始部分に移動します。
21+
22+``` pascal
23+ procedure TForm1.Button1Click(Sender: TObject);
24+ begin
25+ {ここで次のように入力:} Button1.caption := 'Press again';
26+ {エディタは、このプロシージャ名を補完しました。}
27+ end;
28+```
29+
30+と入力したら、F12を押してソースエディタから出てForm1ウィンドウを選択してください。
31+
32+続いてButton2のプロパティを編集します。Button2をクリックして、プロパティをオブジェクトインスペクタに表示させてください。Captionプロパティを変更して'Button2'から'Exit'にします。イベントタブを選択して、OnClickボックスをクリックしてください。...をクリックして、ソースエディタに入り、真ん中あたりのプロシージャに
33+
34+``` pascal
35+ procedure TForm1.Button2Click(Sender: TObject);
36+ begin
37+ {ここで次のように入力:} Close;
38+ {エディタは、このプロシージャ名を補完しました。}
39+ end;
40+```
41+
42+こう書いて、もう一度F12を押してForm1ウィンドウに戻ります。 これで、コンパイルを試みる段階まで来ました。コンパイルはとても簡単です。メインメニューにある'実行'を選択するだけです。 サブメニューで'実行'のオプションを選ぶこともできます。 また、単純にF9を押しても行えます。最初のコンパイルが行われ(うまくいけば)、リンクが完了し、コンパイルされたプログラムが実行されます。
43+
44+複数のテキストウィンドウが現れてすべてのコンパイラメッセージが表示され、その後はForm1ウィンドウが現れますが、グリッドの点は表示されません。これはあなたのアプリケーションのメインウィンドウであり、あなたがボタンを押すか他の方法で操作をするのを待っています。
45+
46+では'Press'と書かれたボタンを押してみましょう。あなたはそれが'Press again'と変わることに気づくでしょう。あなたがそれをもう一度押してもそれは'Press again'でしょう!!
47+
48+'Exit'のボタンも押してみます。ウィンドウが閉じてプログラムが終了します。オリジナルのForm1ウィンドウがドットによるグリッドとともに表示され、編集可能な状態になります。
49+
50+それではこれまでの作業を保存しておきましょう(これは頻繁に行いましょうね!!)。プロジェクトメニュー \> 別名で保存 \> your_selected_file_name.pas(適当な名前を付けます)とすれば完了です。これで、プログラムを終了して、PCの電源を切っても、保存したところから作業を再開できます。
51+
52+### プログラムを変更する
53+
54+先ほど保存しておいた、プロジェクトを開いてください。 Form1ウィンドウにある'Press'ボタンをクリックして、選択してください。 オブジェクトインスペクタのイベントタブを選択して、OnClickボックスの右側をクリックして、ソースエディタの適切な位置に戻りましょう。
55+
56+次に続くコードを参考に、さきほどのコードを書き直してみてください。
57+
58+``` pascal
59+ procedure TForm1.Button1Click(Sender: TObject);
60+ {TButtonのTagプロパティを使います。ここでは0か1の値を設定しています。}
61+ begin
62+ if Button1.tag =0 then
63+ begin
64+ Button1.caption := 'Press again';
65+ Button1.tag := 1
66+ end else
67+ begin
68+ Button1.caption := 'Press';
69+ Button1.tag := 0
70+ end
71+ end;
72+```
73+
74+保存し、もう一度コンパイルして実行しましょう。このコードによって、左側のボタンを押すと、今度はふたつのメッセージを交互に表示するようになりました。
75+
76+さあ、後は自由に工夫してみてください。
77+
78+もし、このようなGUIをもつプログラムでなく、たとえばあなたが基本的なPascalプログラミングを試してみたい、とかバッチモードで動作するプログラムを書く必要がある、とかシステムプログラミングをしたいとかそういう時には、コンソールやテキストベースのPascalプログラムを書く場面があるかもしれません。
79+
80+そんな時にも、プログラムを編集、コンパイル、実行するために、Pascalの統合開発環境としてLazarusを使うことができます。 LazarusはPascalによる開発のための理想的な環境を作ります。詳しくは[[Console Mode Pascal/ja|コンソールモードPascalをご]]覧ください。
81+
82+## エディタのウインドウ
83+
84+Lazarusを起動すると、いくつかに分割されている'フローティング'ウィンドウが、あなたのデスクトップ上に現れます。
85+
86+デスクトップ右上に、**Lazarus Editor vXXXXXX - project1**(これはあなたが現在開いているプロジェクトの名前になります)とタイトルに書かれたものが表示されています。
87+
88+これがプロジェクトのメインコントロールウィンドウで、メインメニューとコンポーネントパレットを含んでいます。
89+
90+<center>
91+
92+<figure>
93+<img src="LazMain_ja.png" title="LazMain_ja.png" />
94+<figcaption>LazMain_ja.png</figcaption>
95+</figure>
96+
97+</center>
98+
99+タイトルバー下のラインは*メインメニュー*でファイル、編集、検索、表示メニューなどを含んでおり、Lazarusの基本的な操作をおこなえます。
100+
101+この下に一組のビットボタン(よく使うメニューアイテムへのショートカットになっています)があり、その右側にはコンポートネントパレットがあります。
102+
103+Lazarus Editorウィンドウの下には**[[IDE Window: Object Inspector/ja|オブジェクトインスペクタ]]**が左側に、 **[[source code editor/ja|ソースコードエディタ]]**が右側にあります。他に小さな窓があり、**[Form1](http://lazarus-ccr.sourceforge.net/kbdata/blankform.jpg)**と名付けられていてLazarusソースエディタウィンドウの上に覆いかぶさっているでしょう。これが見えなければ**F12**キーを押すことですぐに画面上に復帰させることができます。 Formウィンドウはあなたのアプリケーションのグラフィカルインターフェイスを作成するためにあり、ソースエディタはあなたのアプリケーションのPascalコードを表示します。The operation of the Object Inspector is discussed in more detail below while the Component Palette is described.
104+
105+あなたが新しいプロジェクトを始めるとき、(Lazarusもしくはあなたが最初にLazarusを起動するとき)デフォルトのフォームが既に作成されていることでしょう。ここにはドットでグリッドが描かれており、あなたがコンポーネントをフォームに配置するときの手助けをします。そしてタイトルバーには**最小化**、 **最大化** そして **閉じる**のボタンがあります。もし あなたがこのウィンドウをクリックすればデスクトップの左側にあるオブジェクトインスペクタにこのフォームのプロパティが表示されます。
106+
107+他のウィンドウが貴方の作業中に目にはいるようになることもあるでしょう。 **[プロジェクトインスペクタ](http://lazarus-ccr.sourceforge.net/kbdata/projinsp.jpg)**はあなたのプロジェクトの詳細と、関連するファイルを表示し、またファイルの追加や削除を行うことができます。**メッセージウィンドウ** は貴方のプロジェクトに関するコンパイラからのメッセージやエラー、もしくは進行状態を表示します。もしもLazarusをターミナルウィンドウから起動しているなら、本来ターミナルに表示されるべきことがらや、コンパイラメッセージの詳細が出力されます。
108+
109+## メインメニュー
110+
111+Lazarus IDEのメインメニューからアクセスできるすべてのメニューアイテムの詳細な説明については、[[Main menu/ja|Main menu/jaページを]]参照してください。
112+
113+## IDE クールバー
114+
115+<figure>
116+<img src="ide_coolbar.png" title="ide_coolbar.png" />
117+<figcaption>ide_coolbar.png</figcaption>
118+</figure>
119+
120+メインコントロールウィンドウの左側、メインメニューの直下、コンポーネントパレットの左にIDEクールバーがあります。ここには、メインメニューの中でよく用いられる機能のボタンがあります:
121+
122+
123+**新規ユニット**、**開く** (ボタン右側の下向き矢印を押すと最近扱ったファイルの一覧が表示されます)、**保存**、**すべて保存**、**新規フォーム**、**フォーム/ユニット切り替え**(フォームかユニットのソースコードを表示)、**ユニットを表示**、**フォームを表示**、**実行**(コンパイルして実行)、**一時停止**、**トレース実行**、**ステップ実行**(最後の2つはデバッガの機能)
124+
125+## コンポーネントパレット
126+
127+コンポーネントパレットとは、多くのアイコンが並んだタブ付きのツールバーのことです。各アイコンは、フォームを作成する際によく用いられるコンポーネントを表しています。
128+
129+<figure>
130+<img src="Component_Palette_Standard.png" title="size=&quot;100%" />
131+<figcaption>size="100%</figcaption>
132+</figure>
133+
134+それぞれのタブは機能ごとに分けられており、異なった組のアイコンからなります。 全てのタブでは、一番左に矢印のアイコンがあります。これは選択ツール(Selection Tool)と呼びます。
135+
136+マウスカーソルをコンポーネントパレットのアイコンの上に移動して、しばらくクリックしないで待つと、アイコンが意味するコンポーネントの名前がポップアップします。 それらの名前がすべて 'T' で始まることに注意してください。これは、そのコンポーネントの 「型:'Type'」 、正確に言うとコンポーネントの 「クラス:'Class'」 を示しています。
137+
138+コンポーネントをフォームに加えると、その [[Class]] が [[Unit]] の **[[Interface]]** 部の **[[Type]]** セクションに追加されます。(通常は TForm1 の定義の一部として) 同時に、そのクラスの **instance** が **[[Var]]** セクションに加えられます(通常、Form1という名前の変数として)。 フォームやコンポーネントが用いる **Methods** は、全て(つまり全ての [[Procedure]] と [[Function]] )、そのユニットの **[[Implementation]]** 部で宣言する必要があります。
139+
140+#### コンポーネントのサンプルプログラム
141+
142+コンポーネントのサンプルプログラムは、 \$LazarusPath/lazarus/examples に保存されています。
143+
144+多くのプログラムで、IDEやコンポーネントパレットを使わないでダイアログや他のコンポーネントを利用する方法が分かるでしょう。全てのコンポーネントは、明確に主となるpascalプログラムで定義されています。 IDEを大いに利用するサンプルもあります。
145+
146+サンプルプログラムの中には、そのままでは動作しないものもあるでしょう。ファイルやディレクトリのパス、パーミッションを設定する必要があるかも知れません。サンプルプログラムをコンパイルするにあたり、ファイル及びディレクトリに対する 読み/書き/実行 (read/write/execute) のパーミッションを確認して下さい。または適切なパーミッションを持ったディレクトリにファイルをコピーしてください。
147+
148+まずは、'testall' プログラムを実行してみましょう。利用可能なコンポーネントのメニューと簡単な実行例があります。コードを読んでどう動いているか調べてみましょう!
149+
150+#### コンポーネントの一覧
151+
152+コンポーネントの一覧を以下に示します。各ユニットには、それらの解説するページへのリンクが張ってあります(ないのもあります)。 あるコンポーネントのプロパティについて知りたければ、そのコンポーネントの継承を調べ、継承元となるコンポーネントについて調べるとよいでしょう。 例えば、TMaskEdit について理解することは、 TCustomMaskEditについて調査する際にも役に立ちます。
153+
154+**タブの名前** (タブ自体の名前がおよその説明になっています。)
155+
156+- **[Standard](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/index-4.html)**(基本:コンポーネントの記述は、[[Standard tab/ja|Standard タブ]] にあります)。
157+
158+<center>
159+
160+<figure>
161+<img src="Component_Palette_Standart.png" title="Component_Palette_Standart.png" />
162+<figcaption>Component_Palette_Standart.png</figcaption>
163+</figure>
164+
165+</center>
166+
167+
168+[TMainMenu](http://lazarus-ccr.sourceforge.net/docs/lcl/menus/tmainmenu.html), [TPopupMenu](http://lazarus-ccr.sourceforge.net/docs/lcl/menus/tpopupmenu.html), [TButton](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tbutton.html), [TLabel](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tlabel.html), [TEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tedit.html), [TMemo](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tmemo.html), [TToggleBox](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/ttogglebox.html), [TCheckBox](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tcheckbox.html), [TRadioButton](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tradiobutton.html), [TListBox](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tlistbox.html), [TComboBox](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tcombobox.html), [TScrollBar](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tscrollbar.html), [TGroupBox](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tgroupbox.html),[TRadioGroup](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tradiogroup.html), [TCheckGroup](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tcheckgroup.html), [TPanel](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tpanel.html), [TActionList](http://lazarus-ccr.sourceforge.net/docs/lcl/actnlist/tactionlist.html)
169+
170+- **[Additional](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/index-4.html)** (追加:コンポーネントの自体は、[[Additional tab/ja|Additionalタブ]] もご覧下さい。)
171+
172+<center>
173+
174+<figure>
175+<img src="Component_Palette_Additional.png" title="Component_Palette_Additional.png" />
176+<figcaption>Component_Palette_Additional.png</figcaption>
177+</figure>
178+
179+</center>
180+
181+
182+[TBitBtn](http://lazarus-ccr.sourceforge.net/docs/lcl/buttons/tbitbtn.html), [TSpeedButton](http://lazarus-ccr.sourceforge.net/docs/lcl/buttons/tspeedbutton.html), [TStaticText](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tstatictext.html), [TImage](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/timage.html), [TShape](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tshape.html), [TBevel](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tbevel.html), [TPaintBox](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tpaintbox.html), [TNotebook](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tnotebook.html), [TLabeledEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tlabelededit.html), [TSplitter](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tsplitter.html), [TTrayIcon](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/ttrayicon.html), [TMaskEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/maskedit/tmaskedit.html), [TCheckListBox](http://lazarus-ccr.sourceforge.net/docs/lcl/checklst/tchecklistbox.html), [TScrollBox](http://lazarus-ccr.sourceforge.net/docs/lcl/forms/tscrollbox.html), [TApplicationProperties](http://lazarus-ccr.sourceforge.net/docs/lcl/forms/tapplicationproperties.html), [TStringGrid](http://lazarus-ccr.sourceforge.net/docs/lcl/grids/tstringgrid.html), [TDrawGrid](http://lazarus-ccr.sourceforge.net/docs/lcl/grids/tdrawgrid.html), [TPairSplitter](http://lazarus-ccr.sourceforge.net/docs/lcl/pairsplitter/tpairsplitter.html), [TColorBox](http://lazarus-ccr.sourceforge.net/docs/lcl/colorbox/tcolorbox.html), [TColorListBox](http://lazarus-ccr.sourceforge.net/docs/lcl/colorbox/tcolorlistbox.html), [TChart](http://lazarus-ccr.sourceforge.net/docs/lcl/chart/index.html)
183+
184+- **[Common Controls](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/index-4.html)** (コンポーネントの記述は、 [[Common Controls tab]] にあります。)
185+
186+<center>
187+
188+<figure>
189+<img src="Component_Palette_Common_Controls.png" title="Component_Palette_Common_Controls.png" />
190+<figcaption>Component_Palette_Common_Controls.png</figcaption>
191+</figure>
192+
193+</center>
194+
195+
196+[TTrackBar](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttrackbar.html), [TProgressBar](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/tprogressbar.html), [TTreeView](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttreeview.html), [TListView](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/tlistview.html), [TStatusBar](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/tstatusbar.html), [TToolBar](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttoolbar.html), [TUpDown](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/tupdown.html), [TPageControl](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/tpagecontrol.html), [TTabControl](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/ttabcontrol.html), [THeaderControl](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/theadercontrol.html), [TImageList](http://lazarus-ccr.sourceforge.net/docs/lcl/controls/timagelist.html), [TPopupNotifier](http://lazarus-ccr.sourceforge.net/docs/lcl/popupnotifier/index.html)
197+
198+- **[Dialogs](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/index-4.html)** (コンポーネントの記述は、 [[Dialogs tab]] にあります。)
199+
200+<center>
201+
202+<figure>
203+<img src="Component_Palette_Dialogs.png" title="Component_Palette_Dialogs.png" />
204+<figcaption>Component_Palette_Dialogs.png</figcaption>
205+</figure>
206+
207+</center>
208+
209+
210+[TOpenDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/topendialog.html), [TSaveDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tsavedialog.html), [TSelectDirectoryDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tselectdirectorydialog.html), [TColorDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tcolordialog.html), [TFontDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tfontdialog.html), [TFindDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tfinddialog.html), [TReplaceDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/treplacedialog.html), [TOpenPictureDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/extdlgs/topenpicturedialog.html), [TSavePictureDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/extdlgs/tsavepicturedialog.html), [TCalendarDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/extdlgs/tcalendardialog.html), [TCalculatorDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/extdlgs/tcalculatordialog.html), [TPrinterSetupDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tcustomprintersetupdialog.html), [TPrintDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tcustomprintdialog.html), [TPageSetupDialog](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/tcustomprintersetupdialog.html)
211+
212+パレットに含まれていませんが、他にもいくつかの便利な **[ダイアログ](http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogExamples)**手続きや関数があります。それらはソースプログラムから直接に呼び出せ、簡単に利用できます。
213+
214+- **Misc**(その他)
215+
216+<center>
217+
218+<figure>
219+<img src="Component_Palette_Misc.png" title="Component_Palette_Misc.png" />
220+<figcaption>Component_Palette_Misc.png</figcaption>
221+</figure>
222+
223+</center>
224+
225+
226+[TColorButton](http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogsTxt), [TSpinEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/spin/tspinedit.html), [TFloatSpinEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/spin/tfloatspinedit.html), [TArrow](http://lazarus-ccr.sourceforge.net/docs/lcl/arrow/tarrow.html), [TCalendar](http://lazarus-ccr.sourceforge.net/docs/lcl/calendar/tcalendar.html), [TEditButton](http://lazarus-ccr.sourceforge.net/docs/lcl/editbtn/teditbutton.html), [TFileNameEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/editbtn/tfilenameedit.html), [TDirectoryEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/editbtn/tdirectoryedit.html), [TDateEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/editbtn/tdateedit.html), [TCalcEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/editbtn/tcalcedit.html), [TFileListBox](http://lazarus-ccr.sourceforge.net/docs/lcl/filectrl/tfilelistbox.html), [TXMLPropStorage](http://lazarus-ccr.sourceforge.net/docs/lcl/xmlpropstorage/txmlpropstorage.html), [TIniPropStorage](http://lazarus-ccr.sourceforge.net/docs/lcl/inipropstorage/tinipropstorage.html), [TBarChart](http://lazarus-ccr.sourceforge.net/docs/lcl/chart/tbarchart.html), [TButtonPanel](http://lazarus-ccr.sourceforge.net/docs/lcl/buttonpanel/tbuttonpanel.html), TIDEDialogLayoutStorage
227+
228+- **[Data Controls](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/index-4.html)**(データの制御。Standard及びAdditionalグループに似ていますが、データベースに適用できます)
229+
230+<center>
231+
232+<figure>
233+<img src="Component_Palette_DataControls.png" title="Component_Palette_DataControls.png" />
234+<figcaption>Component_Palette_DataControls.png</figcaption>
235+</figure>
236+
237+</center>
238+
239+
240+[TDBNavigator](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbnavigator.html), [TDBText](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbtext.html), [TDBEdit](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbedit.html), [TDBMemo](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbmemo.html), [TDBImage](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbimage.html), [TDBListBox](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdblistbox.html), [TDBComboBox](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbcombobox.html), [TDBCheckBox](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbcheckbox.html), [TDBRadioGroup](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbradiogroup.html), [TDBCalendar](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbcalendar.html), [TDBGroupBox](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/tdbgroupbox.html), [TDBGrid](http://lazarus-ccr.sourceforge.net/docs/lcl/dbgrids/tdbgrid.html)
241+
242+- **Data Access**(データへのアクセス)
243+
244+<center>
245+
246+<figure>
247+<img src="Component_Palette_DataAccess.png" title="Component_Palette_DataAccess.png" />
248+<figcaption>Component_Palette_DataAccess.png</figcaption>
249+</figure>
250+
251+</center>
252+
253+
254+TDatasource, TMemDataset, TSdfDataSet, TFixedFormatDataSet, TDbf
255+
256+- **System**(システム)
257+
258+<center>
259+
260+<figure>
261+<img src="Component_Palette_System.png" title="Component_Palette_System.png" />
262+<figcaption>Component_Palette_System.png</figcaption>
263+</figure>
264+
265+</center>
266+
267+
268+[TTimer](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/ttimer.html), [TIdleTimer](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/tidletimer.html), [TLazComponentQueue](http://lazarus-ccr.sourceforge.net/docs/lcl/lresources/tlazcomponentqueue.html), [THtmlHelpDatabase](http://lazarus-ccr.sourceforge.net/docs/lcl/lazhelphtml/thtmlhelpdatabase.html), [THtmlBrowserHelpViewer](http://lazarus-ccr.sourceforge.net/docs/lcl/lazhelphtml/thtmlbrowserhelpviewer.html), [TProcessUTF8](http://lazarus-ccr.sourceforge.net/docs/lcl/asyncprocess/tprocessutf8.html), [TAsyncProcess](http://lazarus-ccr.sourceforge.net/docs/lcl/asyncprocess/tasyncprocess.html), [[doc:fcl/process/tprocess.html|TProcess]], TSimpleIPCClient, TSimpleIPCServer, TXMLConfig, TEventLog
269+
270+- **SynEdit**(SynEdit:他の言語や開発ツールへのインターフェースとなるコンポーネント[sourceforge](http://synedit.sourceforge.net/))
271+
272+<center>
273+
274+<figure>
275+<img src="Component_Palette_SynEdit.png" title="Component_Palette_SynEdit.png" />
276+<figcaption>Component_Palette_SynEdit.png</figcaption>
277+</figure>
278+
279+</center>
280+
281+
282+TSynEdit, TSynAutoComplete, TSynExporterHTML, TSynMacroRecorder, TSynMemo, TSynPasSyn, TSynFreePascalSyn, TSynCppSyn, TSynJavaSyn, TSynPerlSyn, TSynHTMLSyn, TSynXMLSyn, TSynLFMSyn, TSynUNIXShellScriptSyn, TSynCssSyn, TSynPHPSyn, TSynTeXSyn, TSynSQLSyn, TSynPythonSyn, TSynVBSyn, TSynAnySyn, TSynMultiSyn
283+
284+SynEditは、 Borland Delphi, Kylix と C++Builder用の複数行編集コントロールであり、文法ハイライト機能やコード補完機能、HTMLやTeX、RTFへのエクスポート機能を持っています。これは完全なVCL/CLXコントロールであり、Microsoft Windows のコントロールのラッパーではなく、ランタイムライブラリを必要としない、クロスプラットフォームで利用できるコンポーネントです。FreePascalとの互換性も計画されており、 Lararus IDE をエディタも SynEditが利用されています。[sourceforge](http://synedit.sourceforge.net/)も参照ください。
285+
286+#### コンポーネントパレットの使い方
287+
288+コンポーネントパレットの利用にあたっては、フォームが作成されており、エディタ上で見えている必要があります(フォームが無い場合は、 File -\> New Form で新たなフォームが作成してください)。 次に、使いたいコンポーネントのアイコンをクリックして選択し、フォーム上のコンポーネントを配置したい位置でクリックすることで、選択されたコンポーネントが配置されます。 コンポーネントの移動やサイズの調整は、マウスで直接操作することでもできますし、コンポーネントのプロパティの値をオブジェクトエディタから直接操作することでもできます。
289+
290+コンポーネントを新たに追加したときには(自作や他のパッケージから追加するなど)、コンポーネントパレットに新しいタブが現れ、コンポーネントに応じたアイコンが表示されます。それらは他のコンポーネントと同様に使用できます。
291+
292+## デバッガ
293+
294+
295+(まだ書かれていません)
296+
297+## Lazarusのファイルについて
298+
299+ファイルの保存操作をすると、次の二つのファイルを保存することになります:
300+
301+`  xxx.pas`\
302+`  yyy.lpr `
303+
304+他にも保存されるファイルはありますが、あなたが名前をつけられるのはこの二つです。 プロジェクトファイル (lpr) 及びユニットファイル (pas) は同じ名前であってはいけません。Lazarus はユニットの名前(ソースコードに現れる名前)をユニットファイル名(xxxの部分)と同じになるように、またプログラムの名前をプロジェクトファイル名(yyyの部分)と同じになるように設定するので、同じになっていると、プロジェクト中で識別子が重複してしまいます。 一貫性を維持するため、project1 や、unit1 に適当な名前をつけましょう。
305+
306+たとえば、**again** という名前のプロジェクトを保存しようとする際に、again.pas と again.lpr という名前で保存しようとするとうまくいきません。ユニット名とプログラム名は同じプロジェクト中にあるため、名前が重複したというエラー duplicate name error になります。
307+
308+そこで、次のようになりました:
309+
310+e:/lazarus/kj/lazhello:
311+
312+`total 4740  free 76500`\
313+`-rwxrwxrwx   1 kjwh     root  4618697 Mar 24 11:19 again.exe`\
314+`-rw-rw-rw-   1 kjwh     root     3002 Mar 24 11:21 again.lpi`\
315+`-rw-rw-rw-   1 kjwh     root      190 Mar 24 11:18 again.lpr`\
316+`-rw-rw-rw-   1 kjwh     root      506 Mar 24 11:08 againu.lfm`\
317+`-rw-rw-rw-   1 kjwh     root      679 Mar 24 11:08 againu.lrs`\
318+`-rw-rw-rw-   1 kjwh     root      677 Mar 24 11:08 againu.pas`\
319+`-rw-rw-rw-   1 kjwh     root     2124 Mar 24 11:08 againu.ppu`\
320+`-rwxrwxrwx   1 kjwh     root      335 Mar 24 11:07 ppas.bat`
321+
322+二つのファイル (again.lpr、againu.pas) を保存したと思っていたのに、もっと多くのファイルが保存されています。
323+
324+それぞれのファイルの簡単な説明をしておきましょう:
325+
326+**again.exe:**
327+メインプログラムのバイナリ実行ファイルです。Win32では拡張子"exe"がつきます。Linux(やMac OS X)では何もつきません。デバッグ用のシンボルを含むために、Linuxでは巨大なファイルになります。"strip"コマンドでそれらを除去すると実行ファイルを小さくすることができます。
328+
329+**again.lpi:**
330+Lazarus プロジェクトのメインファイルです (Lazarus Project Information); Delphi でこれと同等なものが .dpr です。このファイルは XML フォーマットで保存されます。
331+
332+**again.lpr:**
333+メインプログラムのソースファイルです。Lazarus特有の拡張部分を除くと、実際にはごく普通の Pascal ソースファイルです。
334+
335+uses節があり、コンパイラはその記述に従って必要な全ユニットを見つけます。Program 宣言の名前はファイル名と一致する必要があります。
336+
337+**againu.lfm:**
338+フォームユニットのレイアウトを格納します。Lazarus はこれを用いてリソースファイルを生成し、それが againu.pas の初期化セクション でインクルードされます。 Lazarus IDE の Tools-\>Convert DFM file to LFM utility を用いると、Delphi の dfm ファイルをlfmに変換することができます。
339+
340+**againu.lrs:**
341+生成されたリソースファイルです。Windows のリソースファイルとは異なります。
342+
343+**againu.pas:**
344+このユニットにフォームのコードを書きます。
345+
346+**againu.ppu:**
347+ユニットをコンパイルしたオブジェクトコードです。
348+
349+**ppas.bat:**
350+プログラムをリンクし実行ファイルを作るための簡単なスクリプト(バッチファイル)です。コンパイルが成功すれば、コンパイラによって削除されます。
351+
352+## Original contributors and changes
353+
354+This page has been imported from the epikwiki [version](http://lazarus-ccr.sourceforge.net/index.php?wiki=LazarusTutorial).
355+
356+- Created initial page and template. T. Lisjac - 11/04/2003 VlxAdmin
357+- Inserted a note containing instructions for writing your first Lazarus Program. Suggest an administrator places it in the appropriate place on the Tutorial menu. 3/09/2004 User:Kirkpatc
358+- Per above, moved Chris's writeup to the main body of the tutorial VlxAdmin
359+- Began to insert text describing the Lazarus Editor - more to follow! 24 Mar 2004 User:Kirkpatc
360+- Added some more to Lazarus Editor section of Tutorial. 25 Mar 2004 User:Kirkpatc
361+- Added screenshots and revised some of the page formatting VlxAdmin 3/25/2004
362+- Moved some of kwhitefoot's comments into Tutorial section. Formatting not quite right, but have to go to bed now! 26 Mar 2004 User:Kirkpatc
363+- Formatted, added credits and comments. Removed original notes. VlxAdmin 3/26/2004
364+- More material added to Editor section of tutorial. 26 Mar 2004 User:Kirkpatc
365+- More material added describing the Main Menu. Renamed 'Hello World' to 'Getting Started' and moved it to nearer the top. 31 March 2004 User:Kirkpatc
366+- Inserted section on Run sub-menu. Some general editing (eg ended each entry with a period to ensure consistency). 9 Apr 2004 User:Kirkpatc
367+- Inserted a new section on How to get started with MySQL in FPC/Lazarus. 13 Apr 2004 User:Kirkpatc
368+- Deleted the section on MySQL from here: it has been copied to Lazarus Database section of tutorial. 14 Apr 2004 User:Kirkpatc
369+- Added some more to the description of the Editor Main Menu. 18 Apr 2004 User:Kirkpatc
370+- Added section on Environment sub-menu. 19 Apr 2004 User:Kirkpatc
371+- Added section on Components sub-menu. 4 May 2004 User:Kirkpatc
372+- Adding Tools sub-menu description (incomplete). 7 May 2004 User:Kirkpatc
373+- Added some screenshots to Menu descriptions. 9 May 2004 User:Kirkpatc
374+- Fixed a bit in Environment Options - thanks VincentSnijders. 14 May 2004 User:Kirkpatc
375+- More additions to Tools sub-menu. 19 May 2004 User:Kirkpatc
376+- Added a section on the Button Bar and started work on The Component Palette. 20 May 2004 User:Kirkpatc
377+- Posted a description file for the StdCtrls unit of the LCL, in the hope that people will add comments. 26 May 2004 User:Kirkpatc
378+- Edited the StdCtrls file, removing a lot of repetitive material and doing some formatting. It is still far too long. 28 May 2004 User:Kirkpatc
379+- Expanding on the Components Palette. 5 June 2004 User:Kirkpatc
380+- Added a lot to the DialogExamples page. 10 June 2004 User:Kirkpatc
381+- Considerable revision of the StdCtrls page, hopefully making it clearer and encouraging people to contribute - particularly in the 'Description' sections. 14 June 2004 User:Kirkpatc
382+- Added pages for Menus and Dialogs units (linked to Component Palette description) - please feel free to add to these pages. 14 June 2004 User:Kirkpatc
383+- Added page for Common Controls (linked to Component Palette). 16 June 2004 User:Kirkpatc
384+- Added MaskEdit page (linked to Component Palette). 17 June 2004 User:Kirkpatc
385+- Added Buttons, ExtCtrls pages (linked to Component Palette). 17 June 2004 User:Kirkpatc
386+- Edited MainMenu component description page. 23 June 2004 User:Kirkpatc
387+- Some additions to Common Controls. 28 June 2004 User:Kirkpatc
388+- A new tutorial on Text-mode Pascal programming has been added. 5 July 2004 User:Kirkpatc
389+- Minor changes to ComCtrls, ExtCtrls, Environment Menu. 10 July User:Kirkpatc
390+- Added FormsTxt, component description page for Component Palette. 20 July 2004 User:Kirkpatc
391+- Some corrections to ConsoleModePascal. 21 July 2004 User:Kirkpatc
392+- Some small changes to ComponentPalette. 22 July 2004 User:Kirkpatc
393+- Some edits and additions to the Lazarus Component section. 23th Jan 2009 User: Miyatake
394+
395+---
396+*From the Free Pascal wiki, page "Lazarus Tutorial/ja", as it stood on 2024-03-30 after a change by Ariben, 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