Difference between revisions of "Extending the IDE/ja"
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Extending the IDE}} | {{Extending the IDE}} | ||
− | + | {{Japanese Menu}} | |
− | = | + | = IDEを拡張する = |
− | + | == 概要 == | |
− | + | IDEはいくつかのプラグインをサポートしています。 | |
− | ; | + | ; コンポーネント : コンポーネントパレット上にアイコンとして現れます。と問えば、TButtonはボタンを作るのに使われます。 |
− | ; | + | ; コンポーネントエディタ : コンポーネントエディタはコンポーネントを設計時にダブルクリックしたり、設計時にコンポーネント上で右クリックで表示されるポップアップメニューにいくつかの項目を追加するときに使われます。 |
− | ; | + | ; プロパティエディタ : オブジェクトインスペクタの行で使われます。 |
+ | ; エキスパート : その他の全てです。 | ||
− | |||
− | + | Lazarusに独自のプラグインを追加するには、2つの方法があります。 | |
− | |||
− | == | + | # パッケージを書く方法, 自分でプラグインを書いて、そのユニットの'Register'手続きを使います。 |
+ | |||
+ | # Lazarusのコードを拡張して、差分をlazarusのメーリングリストへ送る方法。 | ||
+ | |||
+ | == コンポーネントを作成する == | ||
ToDo | ToDo | ||
Hint: Create a new component via the package editor. | Hint: Create a new component via the package editor. | ||
− | == | + | == コンポーネントエディタを作成する == |
ToDo | ToDo | ||
Hint: see componenteditors.pas for examples | Hint: see componenteditors.pas for examples | ||
− | == | + | == プロパティエディタを作成する == |
ToDo | ToDo | ||
Hint: see propedits.pp for examples | Hint: see propedits.pp for examples | ||
− | == | + | == イベントハンドラを登録する == |
− | + | IDEにはいくつかのイベントがあり、それに対してプラグインは独自のハンドラを追加することができます。propedits.pp で、"GlobalDesignHook"オブジェクトがあります。これは、設計時のイベントを管理します。各々のイベントはハンドラーのリストを呼び出します。デフォルトのハンドラーはIDEから追加されています。あなたは独自のハンドラを、AddHandlerXXXやRemoveHandlerXXX手続きを使って登録できます。それらは、デフォルトのハンドラの前に呼び出されます。 | |
− | + | 例: | |
− | + | 独自のハンドラを追加します。(通常、あなたが作成したオブジェクトのコンストラクタでおこないます。): | |
GlobalDesignHook.AddHandlerComponentAdded(@YourOnComponentAdded);<br> | GlobalDesignHook.AddHandlerComponentAdded(@YourOnComponentAdded);<br> | ||
− | + | ||
+ | 独自のハンドラを取り除きます: | ||
GlobalDesignHook.RemoveHandlerComponentAdded(@YourOnComponentAdded);<br> | GlobalDesignHook.RemoveHandlerComponentAdded(@YourOnComponentAdded);<br> | ||
− | + | ||
− | + | すべてのハンドラを一度に削除することもできます。たとえば、次の行をオブジェクトのデストラクタに追加するのも良いでしょう。: | |
GlobalDesignHook.RemoveAllHandlersForObject(Self); | GlobalDesignHook.RemoveAllHandlersForObject(Self); | ||
− | + | GlobalDesignHookのハンドラです: | |
+ | |||
// lookup root | // lookup root | ||
Line 91: | Line 96: | ||
RefreshPropertyValues | RefreshPropertyValues | ||
+ | ==ソースのヘルプを追加する== | ||
− | + | THelpDatabaseを最初に作りましょう: | |
− | |||
− | |||
HelpDB:=TFPDocHTMLHelpDatabase( | HelpDB:=TFPDocHTMLHelpDatabase( | ||
HelpDatabases.CreateHelpDatabase('ANameOfYourChoiceForTheDatabase', | HelpDatabases.CreateHelpDatabase('ANameOfYourChoiceForTheDatabase', | ||
Line 108: | Line 112: | ||
HelpDB.RegisterItem(DirectoryItem); | HelpDB.RegisterItem(DirectoryItem); | ||
− | == | + | ==最初の製作者と変更== |
This page has been converted from the epikwiki [http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtendingTheIde version]. | This page has been converted from the epikwiki [http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtendingTheIde version]. |
Latest revision as of 15:06, 6 January 2008
│
Deutsch (de) │
English (en) │
español (es) │
français (fr) │
日本語 (ja) │
русский (ru) │
slovenčina (sk) │
中文(中国大陆) (zh_CN) │
IDEを拡張する
概要
IDEはいくつかのプラグインをサポートしています。
- コンポーネント
- コンポーネントパレット上にアイコンとして現れます。と問えば、TButtonはボタンを作るのに使われます。
- コンポーネントエディタ
- コンポーネントエディタはコンポーネントを設計時にダブルクリックしたり、設計時にコンポーネント上で右クリックで表示されるポップアップメニューにいくつかの項目を追加するときに使われます。
- プロパティエディタ
- オブジェクトインスペクタの行で使われます。
- エキスパート
- その他の全てです。
Lazarusに独自のプラグインを追加するには、2つの方法があります。
- パッケージを書く方法, 自分でプラグインを書いて、そのユニットの'Register'手続きを使います。
- Lazarusのコードを拡張して、差分をlazarusのメーリングリストへ送る方法。
コンポーネントを作成する
ToDo Hint: Create a new component via the package editor.
コンポーネントエディタを作成する
ToDo Hint: see componenteditors.pas for examples
プロパティエディタを作成する
ToDo Hint: see propedits.pp for examples
イベントハンドラを登録する
IDEにはいくつかのイベントがあり、それに対してプラグインは独自のハンドラを追加することができます。propedits.pp で、"GlobalDesignHook"オブジェクトがあります。これは、設計時のイベントを管理します。各々のイベントはハンドラーのリストを呼び出します。デフォルトのハンドラーはIDEから追加されています。あなたは独自のハンドラを、AddHandlerXXXやRemoveHandlerXXX手続きを使って登録できます。それらは、デフォルトのハンドラの前に呼び出されます。
例:
独自のハンドラを追加します。(通常、あなたが作成したオブジェクトのコンストラクタでおこないます。): GlobalDesignHook.AddHandlerComponentAdded(@YourOnComponentAdded);
独自のハンドラを取り除きます: GlobalDesignHook.RemoveHandlerComponentAdded(@YourOnComponentAdded);
すべてのハンドラを一度に削除することもできます。たとえば、次の行をオブジェクトのデストラクタに追加するのも良いでしょう。: GlobalDesignHook.RemoveAllHandlersForObject(Self);
GlobalDesignHookのハンドラです:
// lookup root ChangeLookupRoot Called when the "LookupRoot" changed. The "LookupRoot" is the owner object of the currently selected components. Normally this is a TForm.
// methods CreateMethod GetMethodName GetMethods MethodExists RenameMethod ShowMethod Called MethodFromAncestor ChainCall
// components GetComponent GetComponentName GetComponentNames GetRootClassName ComponentRenamed Called when a component was renamed ComponentAdded Called when a new component was added to the LookupRoot ComponentDeleting Called before a component is freed. DeleteComponent Called by the IDE to delete a component. GetSelectedComponents Get the current selection of components.
// persistent objects GetObject GetObjectName GetObjectNames
// modifing Modified Revert RefreshPropertyValues
ソースのヘルプを追加する
THelpDatabaseを最初に作りましょう:
HelpDB:=TFPDocHTMLHelpDatabase( HelpDatabases.CreateHelpDatabase('ANameOfYourChoiceForTheDatabase', TFPDocHTMLHelpDatabase,true)); HelpDB.DefaultBaseURL:='http://your.help.org/';
FPDocNode:=THelpNode.CreateURL(HelpDB, 'Package1 - A new package', 'file://index.html'); HelpDB.TOCNode:=THelpNode.Create(HelpDB,FPDocNode);// once as TOC DirectoryItem:=THelpDBISourceDirectory.Create(FPDocNode,'$(PkgDir)/lcl', '*.pp;*.pas',false);// and once as normal page HelpDB.RegisterItem(DirectoryItem);
最初の製作者と変更
This page has been converted from the epikwiki version.
This document was authored by Mattias Gaertner Initial import and formatted for Lazarus-CCR - VlxAdmin 9/26/2003