Lazarus Tutorial/ja: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | *このLazarusチュートリアルに、遠慮なくあなたの経験を書き加えてみませんか? どうぞご遠慮なく。* | |
| 2 | 2 | ||
| 3 | 3 | ## 概要 | |
| 4 | 4 | ||
| 5 | 5 | Lazarusは Free Pascal コンパイラのためのフリーでオープンソースな開発ツールです。 Lazarus IDEは、機能が豊富なプログラム環境であり、単独で機能するGUIアプリケーションやコンソールアプリケーションを開発できます。 Lazarusは、現在 Linux、 FreeBSD、 Win32 そして Mac OS X の上で動作し、カスタマイズ可能なソースエディタ、FreePascalコンパイラと統合された完全なGUI、 パッケージマネージャやデバッガを持つビジュアルなフォーム作成環境を提供します。 | |
| 6 | 6 | ||
| 7 | - | ||
| 8 | - | ||
| 9 | - | ||
| 10 | - | ||
| 7 | + |  | |
| 11 | 8 | ||
| 12 | 9 | ## Lazarusでプログラムをはじめてみよう | |
| 13 | 10 | ||
| 14 | 11 | [[Installing Lazarus/ja|Lazarusをインストールして]]、起動してみてください。これだけで、Free PascalやLazarusをつかったプログラムをはじめてみることができます。 | |
| 15 | 12 | ||
| 16 | 13 | 起動すると、いくつかのウィンドウがデスクトップ上に現れます。上の方にはメインメニューがあります。左には、**[[IDE Window: Object Inspector/ja|オブジェクトインスペクタ]]**あります。そのほかのデスクトップの大部分は、**[[source code editor/ja|ソースコードエディタ]]**です。多分Form1ウィンドウが作られていて、ソースエディタに重なっているはずです。 | |
| 17 | 14 | ||
| 18 | 15 | 上の方にあるメニューウィンドウの、メニューの下にタブの列があります。'標準'タブが選択されていますね。そこでButtonアイコン(四角の中に「OK」と書いてあるもの)を探してクリックしてください。そして、Form1の上の左中央あたりでクリックしてください。すると'Button1'と書かれた四角い図形(=ボタンです)が現れるはずです。もう一回標準タブのButtonアイコンをクリックして、Form1の右中央でクリックしてください。'Button2'と書かれたボタンが現れます。 | |
| 19 | 16 | ||
| 20 | 17 | Button1をクリックしましょう。オブジェクトインスペクタに、オブジェクトButton1のプロパティが表示されます。'Caption'と名付けられたプロパティに'Button1'と表示されていますね。その部分をクリックして'Button1'を'Press'に書き換えてください。あなたがENTERキーを押すか、別のボックスをクリックすれば、最初にForm1に置いたボタンが'Press'という名前になります。 続いて、オブジェクトインスペクタ上のイベントタブをクリックすると、ボタンに関連付けられている色々なイベントを見ることができます。 イベントには、たとえば、OnClick、OnEnter、OnExitなどがあります。OnClickボックスの右側を選択してください。小さなボックスが...と一緒に表示されます。あなたがこれをクリックすれば、自動的にソースエディタに移動してカーソルはコードの開始部分に移動します。 | |
| 21 | 18 | ||
| 22 | 19 | ``` pascal | |
| 23 | 20 | procedure TForm1.Button1Click(Sender: TObject); | |
| 24 | 21 | begin | |
| 25 | 22 | {ここで次のように入力:} Button1.caption := 'Press again'; | |
| 26 | 23 | {エディタは、このプロシージャ名を補完しました。} | |
| 27 | 24 | end; | |
| 28 | 25 | ``` | |
| 29 | 26 | ||
| 30 | 27 | と入力したら、F12を押してソースエディタから出てForm1ウィンドウを選択してください。 | |
| 31 | 28 | ||
| 32 | 29 | 続いてButton2のプロパティを編集します。Button2をクリックして、プロパティをオブジェクトインスペクタに表示させてください。Captionプロパティを変更して'Button2'から'Exit'にします。イベントタブを選択して、OnClickボックスをクリックしてください。...をクリックして、ソースエディタに入り、真ん中あたりのプロシージャに | |
| 33 | 30 | ||
| 34 | 31 | ``` pascal | |
| 35 | 32 | procedure TForm1.Button2Click(Sender: TObject); | |
| 36 | 33 | begin | |
| 37 | 34 | {ここで次のように入力:} Close; | |
| 38 | 35 | {エディタは、このプロシージャ名を補完しました。} | |
| 39 | 36 | end; | |
| 40 | 37 | ``` | |
| 41 | 38 | ||
| 42 | 39 | こう書いて、もう一度F12を押してForm1ウィンドウに戻ります。 これで、コンパイルを試みる段階まで来ました。コンパイルはとても簡単です。メインメニューにある'実行'を選択するだけです。 サブメニューで'実行'のオプションを選ぶこともできます。 また、単純にF9を押しても行えます。最初のコンパイルが行われ(うまくいけば)、リンクが完了し、コンパイルされたプログラムが実行されます。 | |
| 43 | 40 | ||
| 44 | 41 | 複数のテキストウィンドウが現れてすべてのコンパイラメッセージが表示され、その後はForm1ウィンドウが現れますが、グリッドの点は表示されません。これはあなたのアプリケーションのメインウィンドウであり、あなたがボタンを押すか他の方法で操作をするのを待っています。 | |
| 45 | 42 | ||
| 46 | 43 | では'Press'と書かれたボタンを押してみましょう。あなたはそれが'Press again'と変わることに気づくでしょう。あなたがそれをもう一度押してもそれは'Press again'でしょう!! | |
| 47 | 44 | ||
| 48 | 45 | 'Exit'のボタンも押してみます。ウィンドウが閉じてプログラムが終了します。オリジナルのForm1ウィンドウがドットによるグリッドとともに表示され、編集可能な状態になります。 | |
| 49 | 46 | ||
| 50 | 47 | それではこれまでの作業を保存しておきましょう(これは頻繁に行いましょうね!!)。プロジェクトメニュー \> 別名で保存 \> your_selected_file_name.pas(適当な名前を付けます)とすれば完了です。これで、プログラムを終了して、PCの電源を切っても、保存したところから作業を再開できます。 | |
| 51 | 48 | ||
| 52 | 49 | ### プログラムを変更する | |
| 53 | 50 | ||
| 54 | 51 | 先ほど保存しておいた、プロジェクトを開いてください。 Form1ウィンドウにある'Press'ボタンをクリックして、選択してください。 オブジェクトインスペクタのイベントタブを選択して、OnClickボックスの右側をクリックして、ソースエディタの適切な位置に戻りましょう。 | |
| 55 | 52 | ||
| 56 | 53 | 次に続くコードを参考に、さきほどのコードを書き直してみてください。 | |
| 57 | 54 | ||
| 58 | 55 | ``` pascal | |
| 59 | 56 | procedure TForm1.Button1Click(Sender: TObject); | |
| 60 | 57 | {TButtonのTagプロパティを使います。ここでは0か1の値を設定しています。} | |
| 61 | 58 | begin | |
| 62 | 59 | if Button1.tag =0 then | |
| 63 | 60 | begin | |
| 64 | 61 | Button1.caption := 'Press again'; | |
| 65 | 62 | Button1.tag := 1 | |
| 66 | 63 | end else | |
| 67 | 64 | begin | |
| 68 | 65 | Button1.caption := 'Press'; | |
| 69 | 66 | Button1.tag := 0 | |
| 70 | 67 | end | |
| 71 | 68 | end; | |
| 72 | 69 | ``` | |
| 73 | 70 | ||
| 74 | 71 | 保存し、もう一度コンパイルして実行しましょう。このコードによって、左側のボタンを押すと、今度はふたつのメッセージを交互に表示するようになりました。 | |
| 75 | 72 | ||
| 76 | 73 | さあ、後は自由に工夫してみてください。 | |
| 77 | 74 | ||
| 78 | 75 | もし、このようなGUIをもつプログラムでなく、たとえばあなたが基本的なPascalプログラミングを試してみたい、とかバッチモードで動作するプログラムを書く必要がある、とかシステムプログラミングをしたいとかそういう時には、コンソールやテキストベースのPascalプログラムを書く場面があるかもしれません。 | |
| 79 | 76 | ||
| 80 | 77 | そんな時にも、プログラムを編集、コンパイル、実行するために、Pascalの統合開発環境としてLazarusを使うことができます。 LazarusはPascalによる開発のための理想的な環境を作ります。詳しくは[[Console Mode Pascal/ja|コンソールモードPascalをご]]覧ください。 | |
| 81 | 78 | ||
| 82 | 79 | ## エディタのウインドウ | |
| 83 | 80 | ||
| 84 | 81 | Lazarusを起動すると、いくつかに分割されている'フローティング'ウィンドウが、あなたのデスクトップ上に現れます。 | |
| 85 | 82 | ||
| 86 | 83 | デスクトップ右上に、**Lazarus Editor vXXXXXX - project1**(これはあなたが現在開いているプロジェクトの名前になります)とタイトルに書かれたものが表示されています。 | |
| 87 | 84 | ||
| 88 | 85 | これがプロジェクトのメインコントロールウィンドウで、メインメニューとコンポーネントパレットを含んでいます。 | |
| 89 | 86 | ||
| 90 | - | ||
| 91 | - | ||
| 92 | - | ||
| 93 | - | ||
| 94 | - | ||
| 95 | - | ||
| 96 | - | ||
| 97 | - | ||
| 87 | + |  | |
| 98 | 88 | ||
| 99 | 89 | タイトルバー下のラインは*メインメニュー*でファイル、編集、検索、表示メニューなどを含んでおり、Lazarusの基本的な操作をおこなえます。 | |
| 100 | 90 | ||
| 101 | 91 | この下に一組のビットボタン(よく使うメニューアイテムへのショートカットになっています)があり、その右側にはコンポートネントパレットがあります。 | |
| 102 | 92 | ||
| 103 | 93 | 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 | 94 | ||
| 105 | 95 | あなたが新しいプロジェクトを始めるとき、(Lazarusもしくはあなたが最初にLazarusを起動するとき)デフォルトのフォームが既に作成されていることでしょう。ここにはドットでグリッドが描かれており、あなたがコンポーネントをフォームに配置するときの手助けをします。そしてタイトルバーには**最小化**、 **最大化** そして **閉じる**のボタンがあります。もし あなたがこのウィンドウをクリックすればデスクトップの左側にあるオブジェクトインスペクタにこのフォームのプロパティが表示されます。 | |
| 106 | 96 | ||
| 107 | 97 | 他のウィンドウが貴方の作業中に目にはいるようになることもあるでしょう。 **[プロジェクトインスペクタ](http://lazarus-ccr.sourceforge.net/kbdata/projinsp.jpg)**はあなたのプロジェクトの詳細と、関連するファイルを表示し、またファイルの追加や削除を行うことができます。**メッセージウィンドウ** は貴方のプロジェクトに関するコンパイラからのメッセージやエラー、もしくは進行状態を表示します。もしもLazarusをターミナルウィンドウから起動しているなら、本来ターミナルに表示されるべきことがらや、コンパイラメッセージの詳細が出力されます。 | |
| 108 | 98 | ||
| 109 | 99 | ## メインメニュー | |
| 110 | 100 | ||
| 111 | 101 | Lazarus IDEのメインメニューからアクセスできるすべてのメニューアイテムの詳細な説明については、[[Main menu/ja|Main menu/jaページを]]参照してください。 | |
| 112 | 102 | ||
| 113 | 103 | ## IDE クールバー | |
| 114 | 104 | ||
| 115 | - | ||
| 116 | - | ||
| 117 | - | ||
| 118 | - | ||
| 105 | + |  | |
| 119 | 106 | ||
| 120 | 107 | メインコントロールウィンドウの左側、メインメニューの直下、コンポーネントパレットの左にIDEクールバーがあります。ここには、メインメニューの中でよく用いられる機能のボタンがあります: | |
| 121 | 108 | ||
| 122 | 109 | ||
| 123 | 110 | **新規ユニット**、**開く** (ボタン右側の下向き矢印を押すと最近扱ったファイルの一覧が表示されます)、**保存**、**すべて保存**、**新規フォーム**、**フォーム/ユニット切り替え**(フォームかユニットのソースコードを表示)、**ユニットを表示**、**フォームを表示**、**実行**(コンパイルして実行)、**一時停止**、**トレース実行**、**ステップ実行**(最後の2つはデバッガの機能) | |
| 124 | 111 | ||
| 125 | 112 | ## コンポーネントパレット | |
| 126 | 113 | ||
| 127 | 114 | コンポーネントパレットとは、多くのアイコンが並んだタブ付きのツールバーのことです。各アイコンは、フォームを作成する際によく用いられるコンポーネントを表しています。 | |
| 128 | 115 | ||
| 129 | - | ||
| 130 | - | ||
| 131 | - | ||
| 132 | - | ||
| 116 | + |  | |
| 133 | 117 | ||
| 134 | 118 | それぞれのタブは機能ごとに分けられており、異なった組のアイコンからなります。 全てのタブでは、一番左に矢印のアイコンがあります。これは選択ツール(Selection Tool)と呼びます。 | |
| 135 | 119 | ||
| 136 | 120 | マウスカーソルをコンポーネントパレットのアイコンの上に移動して、しばらくクリックしないで待つと、アイコンが意味するコンポーネントの名前がポップアップします。 それらの名前がすべて 'T' で始まることに注意してください。これは、そのコンポーネントの 「型:'Type'」 、正確に言うとコンポーネントの 「クラス:'Class'」 を示しています。 | |
| 137 | 121 | ||
| 138 | 122 | コンポーネントをフォームに加えると、その [[Class]] が [[Unit]] の **[[Interface]]** 部の **[[Type]]** セクションに追加されます。(通常は TForm1 の定義の一部として) 同時に、そのクラスの **instance** が **[[Var]]** セクションに加えられます(通常、Form1という名前の変数として)。 フォームやコンポーネントが用いる **Methods** は、全て(つまり全ての [[Procedure]] と [[Function]] )、そのユニットの **[[Implementation]]** 部で宣言する必要があります。 | |
| 139 | 123 | ||
| 140 | 124 | #### コンポーネントのサンプルプログラム | |
| 141 | 125 | ||
| 142 | 126 | コンポーネントのサンプルプログラムは、 \$LazarusPath/lazarus/examples に保存されています。 | |
| 143 | 127 | ||
| 144 | 128 | 多くのプログラムで、IDEやコンポーネントパレットを使わないでダイアログや他のコンポーネントを利用する方法が分かるでしょう。全てのコンポーネントは、明確に主となるpascalプログラムで定義されています。 IDEを大いに利用するサンプルもあります。 | |
| 145 | 129 | ||
| 146 | 130 | サンプルプログラムの中には、そのままでは動作しないものもあるでしょう。ファイルやディレクトリのパス、パーミッションを設定する必要があるかも知れません。サンプルプログラムをコンパイルするにあたり、ファイル及びディレクトリに対する 読み/書き/実行 (read/write/execute) のパーミッションを確認して下さい。または適切なパーミッションを持ったディレクトリにファイルをコピーしてください。 | |
| 147 | 131 | ||
| 148 | 132 | まずは、'testall' プログラムを実行してみましょう。利用可能なコンポーネントのメニューと簡単な実行例があります。コードを読んでどう動いているか調べてみましょう! | |
| 149 | 133 | ||
| 150 | 134 | #### コンポーネントの一覧 | |
| 151 | 135 | ||
| 152 | 136 | コンポーネントの一覧を以下に示します。各ユニットには、それらの解説するページへのリンクが張ってあります(ないのもあります)。 あるコンポーネントのプロパティについて知りたければ、そのコンポーネントの継承を調べ、継承元となるコンポーネントについて調べるとよいでしょう。 例えば、TMaskEdit について理解することは、 TCustomMaskEditについて調査する際にも役に立ちます。 | |
| 153 | 137 | ||
| 154 | 138 | **タブの名前** (タブ自体の名前がおよその説明になっています。) | |
| 155 | 139 | ||
| 156 | 140 | - **[Standard](http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/index-4.html)**(基本:コンポーネントの記述は、[[Standard tab/ja|Standard タブ]] にあります)。 | |
| 157 | 141 | ||
| 158 | - | ||
| 159 | - | ||
| 160 | - | ||
| 161 | - | ||
| 162 | - | ||
| 163 | - | ||
| 164 | - | ||
| 165 | - | ||
| 142 | + |  | |
| 166 | 143 | ||
| 167 | 144 | ||
| 168 | 145 | [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 | 146 | ||
| 170 | 147 | - **[Additional](http://lazarus-ccr.sourceforge.net/docs/lcl/extctrls/index-4.html)** (追加:コンポーネントの自体は、[[Additional tab/ja|Additionalタブ]] もご覧下さい。) | |
| 171 | 148 | ||
| 172 | - | ||
| 173 | - | ||
| 174 | - | ||
| 175 | - | ||
| 176 | - | ||
| 177 | - | ||
| 178 | - | ||
| 179 | - | ||
| 149 | + |  | |
| 180 | 150 | ||
| 181 | 151 | ||
| 182 | 152 | [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 | 153 | ||
| 184 | 154 | - **[Common Controls](http://lazarus-ccr.sourceforge.net/docs/lcl/comctrls/index-4.html)** (コンポーネントの記述は、 [[Common Controls tab]] にあります。) | |
| 185 | 155 | ||
| 186 | - | ||
| 187 | - | ||
| 188 | - | ||
| 189 | - | ||
| 190 | - | ||
| 191 | - | ||
| 192 | - | ||
| 193 | - | ||
| 156 | + |  | |
| 194 | 157 | ||
| 195 | 158 | ||
| 196 | 159 | [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 | 160 | ||
| 198 | 161 | - **[Dialogs](http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/index-4.html)** (コンポーネントの記述は、 [[Dialogs tab]] にあります。) | |
| 199 | 162 | ||
| 200 | - | ||
| 201 | - | ||
| 202 | - | ||
| 203 | - | ||
| 204 | - | ||
| 205 | - | ||
| 206 | - | ||
| 207 | - | ||
| 163 | + |  | |
| 208 | 164 | ||
| 209 | 165 | ||
| 210 | 166 | [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 | 167 | ||
| 212 | 168 | パレットに含まれていませんが、他にもいくつかの便利な **[ダイアログ](http://lazarus-ccr.sourceforge.net/index.php?wiki=DialogExamples)**手続きや関数があります。それらはソースプログラムから直接に呼び出せ、簡単に利用できます。 | |
| 213 | 169 | ||
| 214 | 170 | - **Misc**(その他) | |
| 215 | 171 | ||
| 216 | - | ||
| 217 | - | ||
| 218 | - | ||
| 219 | - | ||
| 220 | - | ||
| 221 | - | ||
| 222 | - | ||
| 223 | - | ||
| 172 | + |  | |
| 224 | 173 | ||
| 225 | 174 | ||
| 226 | 175 | [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 | 176 | ||
| 228 | 177 | - **[Data Controls](http://lazarus-ccr.sourceforge.net/docs/lcl/dbctrls/index-4.html)**(データの制御。Standard及びAdditionalグループに似ていますが、データベースに適用できます) | |
| 229 | 178 | ||
| 230 | - | ||
| 231 | - | ||
| 232 | - | ||
| 233 | - | ||
| 234 | - | ||
| 235 | - | ||
| 236 | - | ||
| 237 | - | ||
| 179 | + |  | |
| 238 | 180 | ||
| 239 | 181 | ||
| 240 | 182 | [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 | 183 | ||
| 242 | 184 | - **Data Access**(データへのアクセス) | |
| 243 | 185 | ||
| 244 | - | ||
| 245 | - | ||
| 246 | - | ||
| 247 | - | ||
| 248 | - | ||
| 249 | - | ||
| 250 | - | ||
| 251 | - | ||
| 186 | + |  | |
| 252 | 187 | ||
| 253 | 188 | ||
| 254 | 189 | TDatasource, TMemDataset, TSdfDataSet, TFixedFormatDataSet, TDbf | |
| 255 | 190 | ||
| 256 | 191 | - **System**(システム) | |
| 257 | 192 | ||
| 258 | - | ||
| 259 | - | ||
| 260 | - | ||
| 261 | - | ||
| 262 | - | ||
| 263 | - | ||
| 264 | - | ||
| 265 | - | ||
| 193 | + |  | |
| 266 | 194 | ||
| 267 | 195 | ||
| 268 | 196 | [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 | 197 | ||
| 270 | 198 | - **SynEdit**(SynEdit:他の言語や開発ツールへのインターフェースとなるコンポーネント[sourceforge](http://synedit.sourceforge.net/)) | |
| 271 | 199 | ||
| 272 | - | ||
| 273 | - | ||
| 274 | - | ||
| 275 | - | ||
| 276 | - | ||
| 277 | - | ||
| 278 | - | ||
| 279 | - | ||
| 200 | + |  | |
| 280 | 201 | ||
| 281 | 202 | ||
| 282 | 203 | TSynEdit, TSynAutoComplete, TSynExporterHTML, TSynMacroRecorder, TSynMemo, TSynPasSyn, TSynFreePascalSyn, TSynCppSyn, TSynJavaSyn, TSynPerlSyn, TSynHTMLSyn, TSynXMLSyn, TSynLFMSyn, TSynUNIXShellScriptSyn, TSynCssSyn, TSynPHPSyn, TSynTeXSyn, TSynSQLSyn, TSynPythonSyn, TSynVBSyn, TSynAnySyn, TSynMultiSyn | |
| 283 | 204 | ||
| 284 | 205 | SynEditは、 Borland Delphi, Kylix と C++Builder用の複数行編集コントロールであり、文法ハイライト機能やコード補完機能、HTMLやTeX、RTFへのエクスポート機能を持っています。これは完全なVCL/CLXコントロールであり、Microsoft Windows のコントロールのラッパーではなく、ランタイムライブラリを必要としない、クロスプラットフォームで利用できるコンポーネントです。FreePascalとの互換性も計画されており、 Lararus IDE をエディタも SynEditが利用されています。[sourceforge](http://synedit.sourceforge.net/)も参照ください。 | |
| 285 | 206 | ||
| 286 | 207 | #### コンポーネントパレットの使い方 | |
| 287 | 208 | ||
| 288 | 209 | コンポーネントパレットの利用にあたっては、フォームが作成されており、エディタ上で見えている必要があります(フォームが無い場合は、 File -\> New Form で新たなフォームが作成してください)。 次に、使いたいコンポーネントのアイコンをクリックして選択し、フォーム上のコンポーネントを配置したい位置でクリックすることで、選択されたコンポーネントが配置されます。 コンポーネントの移動やサイズの調整は、マウスで直接操作することでもできますし、コンポーネントのプロパティの値をオブジェクトエディタから直接操作することでもできます。 | |
| 289 | 210 | ||
| 290 | 211 | コンポーネントを新たに追加したときには(自作や他のパッケージから追加するなど)、コンポーネントパレットに新しいタブが現れ、コンポーネントに応じたアイコンが表示されます。それらは他のコンポーネントと同様に使用できます。 | |
| 291 | 212 | ||
| 292 | 213 | ## デバッガ | |
| 293 | 214 | ||
| 294 | 215 | ||
| 295 | 216 | (まだ書かれていません) | |
| 296 | 217 | ||
| 297 | 218 | ## Lazarusのファイルについて | |
| 298 | 219 | ||
| 299 | 220 | ファイルの保存操作をすると、次の二つのファイルを保存することになります: | |
| 300 | 221 | ||
| 301 | 222 | ` xxx.pas`\ | |
| 302 | 223 | ` yyy.lpr ` | |
| 303 | 224 | ||
| 304 | 225 | 他にも保存されるファイルはありますが、あなたが名前をつけられるのはこの二つです。 プロジェクトファイル (lpr) 及びユニットファイル (pas) は同じ名前であってはいけません。Lazarus はユニットの名前(ソースコードに現れる名前)をユニットファイル名(xxxの部分)と同じになるように、またプログラムの名前をプロジェクトファイル名(yyyの部分)と同じになるように設定するので、同じになっていると、プロジェクト中で識別子が重複してしまいます。 一貫性を維持するため、project1 や、unit1 に適当な名前をつけましょう。 | |
| 305 | 226 | ||
| 306 | 227 | たとえば、**again** という名前のプロジェクトを保存しようとする際に、again.pas と again.lpr という名前で保存しようとするとうまくいきません。ユニット名とプログラム名は同じプロジェクト中にあるため、名前が重複したというエラー duplicate name error になります。 | |
| 307 | 228 | ||
| 308 | 229 | そこで、次のようになりました: | |
| 309 | 230 | ||
| 310 | 231 | e:/lazarus/kj/lazhello: | |
| 311 | 232 | ||
| 312 | 233 | `total 4740 free 76500`\ | |
| 313 | 234 | `-rwxrwxrwx 1 kjwh root 4618697 Mar 24 11:19 again.exe`\ | |
| 314 | 235 | `-rw-rw-rw- 1 kjwh root 3002 Mar 24 11:21 again.lpi`\ | |
| 315 | 236 | `-rw-rw-rw- 1 kjwh root 190 Mar 24 11:18 again.lpr`\ | |
| 316 | 237 | `-rw-rw-rw- 1 kjwh root 506 Mar 24 11:08 againu.lfm`\ | |
| 317 | 238 | `-rw-rw-rw- 1 kjwh root 679 Mar 24 11:08 againu.lrs`\ | |
| 318 | 239 | `-rw-rw-rw- 1 kjwh root 677 Mar 24 11:08 againu.pas`\ | |
| 319 | 240 | `-rw-rw-rw- 1 kjwh root 2124 Mar 24 11:08 againu.ppu`\ | |
| 320 | 241 | `-rwxrwxrwx 1 kjwh root 335 Mar 24 11:07 ppas.bat` | |
| 321 | 242 | ||
| 322 | 243 | 二つのファイル (again.lpr、againu.pas) を保存したと思っていたのに、もっと多くのファイルが保存されています。 | |
| 323 | 244 | ||
| 324 | 245 | それぞれのファイルの簡単な説明をしておきましょう: | |
| 325 | 246 | ||
| 326 | 247 | **again.exe:** | |
| 327 | 248 | メインプログラムのバイナリ実行ファイルです。Win32では拡張子"exe"がつきます。Linux(やMac OS X)では何もつきません。デバッグ用のシンボルを含むために、Linuxでは巨大なファイルになります。"strip"コマンドでそれらを除去すると実行ファイルを小さくすることができます。 | |
| 328 | 249 | ||
| 329 | 250 | **again.lpi:** | |
| 330 | 251 | Lazarus プロジェクトのメインファイルです (Lazarus Project Information); Delphi でこれと同等なものが .dpr です。このファイルは XML フォーマットで保存されます。 | |
| 331 | 252 | ||
| 332 | 253 | **again.lpr:** | |
| 333 | 254 | メインプログラムのソースファイルです。Lazarus特有の拡張部分を除くと、実際にはごく普通の Pascal ソースファイルです。 | |
| 334 | 255 | ||
| 335 | 256 | uses節があり、コンパイラはその記述に従って必要な全ユニットを見つけます。Program 宣言の名前はファイル名と一致する必要があります。 | |
| 336 | 257 | ||
| 337 | 258 | **againu.lfm:** | |
| 338 | 259 | フォームユニットのレイアウトを格納します。Lazarus はこれを用いてリソースファイルを生成し、それが againu.pas の初期化セクション でインクルードされます。 Lazarus IDE の Tools-\>Convert DFM file to LFM utility を用いると、Delphi の dfm ファイルをlfmに変換することができます。 | |
| 339 | 260 | ||
| 340 | 261 | **againu.lrs:** | |
| 341 | 262 | 生成されたリソースファイルです。Windows のリソースファイルとは異なります。 | |
| 342 | 263 | ||
| 343 | 264 | **againu.pas:** | |
| 344 | 265 | このユニットにフォームのコードを書きます。 | |
| 345 | 266 | ||
| 346 | 267 | **againu.ppu:** | |
| 347 | 268 | ユニットをコンパイルしたオブジェクトコードです。 | |
| 348 | 269 | ||
| 349 | 270 | **ppas.bat:** | |
| 350 | 271 | プログラムをリンクし実行ファイルを作るための簡単なスクリプト(バッチファイル)です。コンパイルが成功すれば、コンパイラによって削除されます。 | |
| 351 | 272 | ||
| 352 | 273 | ## Original contributors and changes | |
| 353 | 274 | ||
| 354 | 275 | This page has been imported from the epikwiki [version](http://lazarus-ccr.sourceforge.net/index.php?wiki=LazarusTutorial). | |
| 355 | 276 | ||
| 356 | 277 | - Created initial page and template. T. Lisjac - 11/04/2003 VlxAdmin | |
| 357 | 278 | - 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 | 279 | - Per above, moved Chris's writeup to the main body of the tutorial VlxAdmin | |
| 359 | 280 | - Began to insert text describing the Lazarus Editor - more to follow! 24 Mar 2004 User:Kirkpatc | |
| 360 | 281 | - Added some more to Lazarus Editor section of Tutorial. 25 Mar 2004 User:Kirkpatc | |
| 361 | 282 | - Added screenshots and revised some of the page formatting VlxAdmin 3/25/2004 | |
| 362 | 283 | - 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 | 284 | - Formatted, added credits and comments. Removed original notes. VlxAdmin 3/26/2004 | |
| 364 | 285 | - More material added to Editor section of tutorial. 26 Mar 2004 User:Kirkpatc | |
| 365 | 286 | - 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 | 287 | - 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 | 288 | - Inserted a new section on How to get started with MySQL in FPC/Lazarus. 13 Apr 2004 User:Kirkpatc | |
| 368 | 289 | - Deleted the section on MySQL from here: it has been copied to Lazarus Database section of tutorial. 14 Apr 2004 User:Kirkpatc | |
| 369 | 290 | - Added some more to the description of the Editor Main Menu. 18 Apr 2004 User:Kirkpatc | |
| 370 | 291 | - Added section on Environment sub-menu. 19 Apr 2004 User:Kirkpatc | |
| 371 | 292 | - Added section on Components sub-menu. 4 May 2004 User:Kirkpatc | |
| 372 | 293 | - Adding Tools sub-menu description (incomplete). 7 May 2004 User:Kirkpatc | |
| 373 | 294 | - Added some screenshots to Menu descriptions. 9 May 2004 User:Kirkpatc | |
| 374 | 295 | - Fixed a bit in Environment Options - thanks VincentSnijders. 14 May 2004 User:Kirkpatc | |
| 375 | 296 | - More additions to Tools sub-menu. 19 May 2004 User:Kirkpatc | |
| 376 | 297 | - Added a section on the Button Bar and started work on The Component Palette. 20 May 2004 User:Kirkpatc | |
| 377 | 298 | - 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 | 299 | - 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 | 300 | - Expanding on the Components Palette. 5 June 2004 User:Kirkpatc | |
| 380 | 301 | - Added a lot to the DialogExamples page. 10 June 2004 User:Kirkpatc | |
| 381 | 302 | - 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 | 303 | - 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 | 304 | - Added page for Common Controls (linked to Component Palette). 16 June 2004 User:Kirkpatc | |
| 384 | 305 | - Added MaskEdit page (linked to Component Palette). 17 June 2004 User:Kirkpatc | |
| 385 | 306 | - Added Buttons, ExtCtrls pages (linked to Component Palette). 17 June 2004 User:Kirkpatc | |
| 386 | 307 | - Edited MainMenu component description page. 23 June 2004 User:Kirkpatc | |
| 387 | 308 | - Some additions to Common Controls. 28 June 2004 User:Kirkpatc | |
| 388 | 309 | - A new tutorial on Text-mode Pascal programming has been added. 5 July 2004 User:Kirkpatc | |
| 389 | 310 | - Minor changes to ComCtrls, ExtCtrls, Environment Menu. 10 July User:Kirkpatc | |
| 390 | 311 | - Added FormsTxt, component description page for Component Palette. 20 July 2004 User:Kirkpatc | |
| 391 | 312 | - Some corrections to ConsoleModePascal. 21 July 2004 User:Kirkpatc | |
| 392 | 313 | - Some small changes to ComponentPalette. 22 July 2004 User:Kirkpatc | |
| 393 | 314 | - Some edits and additions to the Lazarus Component section. 23th Jan 2009 User: Miyatake | |
| 394 | 315 | ||
| 395 | 316 | --- | |
| 396 | 317 | *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).* |
