Sign in Join
Wiki copytemporary

Extending the IDE/ja: what changed

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

OldNewLine
11# IDEを拡張する
22
33## 概要
44
55IDEはいくつかのプラグインをサポートしています。
66
77コンポーネント
88コンポーネントパレット上にアイコンとして現れます。と問えば、TButtonはボタンを作るのに使われます。
99
1010コンポーネントエディタ
1111コンポーネントエディタはコンポーネントを設計時にダブルクリックしたり、設計時にコンポーネント上で右クリックで表示されるポップアップメニューにいくつかの項目を追加するときに使われます。
1212
1313プロパティエディタ
1414オブジェクトインスペクタの行で使われます。
1515
1616エキスパート
1717その他の全てです。
1818
1919Lazarusに独自のプラグインを追加するには、2つの方法があります。
2020
21211. パッケージを書く方法, 自分でプラグインを書いて、そのユニットの'Register'手続きを使います。
2222
23231. Lazarusのコードを拡張して、差分をlazarusのメーリングリストへ送る方法。
2424
2525## コンポーネントを作成する
2626
2727ToDo Hint: Create a new component via the package editor.
2828
2929## コンポーネントエディタを作成する
3030
3131ToDo Hint: see componenteditors.pas for examples
3232
3333## プロパティエディタを作成する
3434
3535ToDo Hint: see propedits.pp for examples
3636
3737## イベントハンドラを登録する
3838
3939IDEにはいくつかのイベントがあり、それに対してプラグインは独自のハンドラを追加することができます。propedits.pp で、"GlobalDesignHook"オブジェクトがあります。これは、設計時のイベントを管理します。各々のイベントはハンドラーのリストを呼び出します。デフォルトのハンドラーはIDEから追加されています。あなたは独自のハンドラを、AddHandlerXXXやRemoveHandlerXXX手続きを使って登録できます。それらは、デフォルトのハンドラの前に呼び出されます。
4040
4141例:
4242
43-` 独自のハンドラを追加します。(通常、あなたが作成したオブジェクトのコンストラクタでおこないます。):`\
44-`   GlobalDesignHook.AddHandlerComponentAdded(@YourOnComponentAdded);`\
43+```text
44+ 独自のハンドラを追加します。(通常、あなたが作成したオブジェクトのコンストラクタでおこないます。):
45+ GlobalDesignHook.AddHandlerComponentAdded(@YourOnComponentAdded);
46+```
4547
46-` 独自のハンドラを取り除きます:`\
47-`   GlobalDesignHook.RemoveHandlerComponentAdded(@YourOnComponentAdded);`\
48+```text
49+ 独自のハンドラを取り除きます:
50+ GlobalDesignHook.RemoveHandlerComponentAdded(@YourOnComponentAdded);
51+```
4852
49-` すべてのハンドラを一度に削除することもできます。たとえば、次の行をオブジェクトのデストラクタに追加するのも良いでしょう。:`\
50-`   GlobalDesignHook.RemoveAllHandlersForObject(Self);`
53+```text
54+ すべてのハンドラを一度に削除することもできます。たとえば、次の行をオブジェクトのデストラクタに追加するのも良いでしょう。:
55+ GlobalDesignHook.RemoveAllHandlersForObject(Self);
56+```
5157
5258GlobalDesignHookのハンドラです:
5359
54-` // lookup root`\
55-` ChangeLookupRoot`\
56-`   Called when the "LookupRoot" changed.`\
57-`   The "LookupRoot" is the owner object of the currently selected components.`\
58-`   Normally this is a TForm.`\
59-`  // methods`\
60-` CreateMethod`\
61-` GetMethodName`\
62-` GetMethods`\
63-` MethodExists`\
64-` RenameMethod`\
65-` ShowMethod`\
66-`   Called`\
67-` MethodFromAncestor`\
68-` ChainCall`\
69-`  // components`\
70-` GetComponent`\
71-` GetComponentName`\
72-` GetComponentNames`\
73-` GetRootClassName`\
74-` ComponentRenamed`\
75-`   Called when a component was renamed`\
76-` ComponentAdded`\
77-`   Called when a new component was added to the LookupRoot`\
78-` ComponentDeleting`\
79-`   Called before a component is freed.`\
80-` DeleteComponent`\
81-`   Called by the IDE to delete a component.`\
82-` GetSelectedComponents`\
83-`   Get the current selection of components.`\
84-`  // persistent objects`\
85-` GetObject`\
86-` GetObjectName`\
87-` GetObjectNames`\
88-`  // modifing`\
89-` Modified`\
90-` Revert`\
91-` RefreshPropertyValues`
60+``` pascal
61+ // lookup root
62+ ChangeLookupRoot
63+ Called when the "LookupRoot" changed.
64+ The "LookupRoot" is the owner object of the currently selected components.
65+ Normally this is a TForm.
66+ // methods
67+ CreateMethod
68+ GetMethodName
69+ GetMethods
70+ MethodExists
71+ RenameMethod
72+ ShowMethod
73+ Called
74+ MethodFromAncestor
75+ ChainCall
76+ // components
77+ GetComponent
78+ GetComponentName
79+ GetComponentNames
80+ GetRootClassName
81+ ComponentRenamed
82+ Called when a component was renamed
83+ ComponentAdded
84+ Called when a new component was added to the LookupRoot
85+ ComponentDeleting
86+ Called before a component is freed.
87+ DeleteComponent
88+ Called by the IDE to delete a component.
89+ GetSelectedComponents
90+ Get the current selection of components.
91+ // persistent objects
92+ GetObject
93+ GetObjectName
94+ GetObjectNames
95+ // modifing
96+ Modified
97+ Revert
98+ RefreshPropertyValues
99+```
92100
93101## ソースのヘルプを追加する
94102
95103THelpDatabaseを最初に作りましょう:
96104
97-` HelpDB:=TFPDocHTMLHelpDatabase(`\
98-`    HelpDatabases.CreateHelpDatabase('ANameOfYourChoiceForTheDatabase',`\
99-`                                            TFPDocHTMLHelpDatabase,true));`\
100-` HelpDB.DefaultBaseURL:='`[`http://your.help.org/`](http://your.help.org/)`';`
105+``` pascal
106+ HelpDB:=TFPDocHTMLHelpDatabase(
107+ HelpDatabases.CreateHelpDatabase('ANameOfYourChoiceForTheDatabase',
108+ TFPDocHTMLHelpDatabase,true));
109+ HelpDB.DefaultBaseURL:='http://your.help.org/';
110+```
101111
102-` FPDocNode:=THelpNode.CreateURL(HelpDB,`\
103-`                  'Package1 - A new package',`\
104-`                  '`[`file://index.html`](file://index.html)`');`\
105-` HelpDB.TOCNode:=THelpNode.Create(HelpDB,FPDocNode);// once as TOC`\
106-` DirectoryItem:=THelpDBISourceDirectory.Create(FPDocNode,'$(PkgDir)/lcl',`\
107-`                                 '*.pp;*.pas',false);// and once as normal page`\
108-` HelpDB.RegisterItem(DirectoryItem);`
112+``` pascal
113+ FPDocNode:=THelpNode.CreateURL(HelpDB,
114+ 'Package1 - A new package',
115+ 'file://index.html');
116+ HelpDB.TOCNode:=THelpNode.Create(HelpDB,FPDocNode);// once as TOC
117+ DirectoryItem:=THelpDBISourceDirectory.Create(FPDocNode,'$(PkgDir)/lcl',
118+ '*.pp;*.pas',false);// and once as normal page
119+ HelpDB.RegisterItem(DirectoryItem);
120+```
109121
110122## 最初の製作者と変更
111123
112124This page has been converted from the epikwiki [version](http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtendingTheIde).
113125
114126This document was authored by Mattias Gaertner Initial import and formatted for Lazarus-CCR - VlxAdmin 9/26/2003
115127
116128---
117129*From the Free Pascal wiki, page "Extending the IDE/ja", as it stood on 2008-01-06 after a change by Saeka-jp, 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