Extending the IDE/ja: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Extending the IDE/ja
| Old | New | Line | |
|---|---|---|---|
| 1 | + | # IDEを拡張する | |
| 2 | + | ||
| 3 | + | ## 概要 | |
| 4 | + | ||
| 5 | + | IDEはいくつかのプラグインをサポートしています。 | |
| 6 | + | ||
| 7 | + | コンポーネント | |
| 8 | + | コンポーネントパレット上にアイコンとして現れます。と問えば、TButtonはボタンを作るのに使われます。 | |
| 9 | + | ||
| 10 | + | コンポーネントエディタ | |
| 11 | + | コンポーネントエディタはコンポーネントを設計時にダブルクリックしたり、設計時にコンポーネント上で右クリックで表示されるポップアップメニューにいくつかの項目を追加するときに使われます。 | |
| 12 | + | ||
| 13 | + | プロパティエディタ | |
| 14 | + | オブジェクトインスペクタの行で使われます。 | |
| 15 | + | ||
| 16 | + | エキスパート | |
| 17 | + | その他の全てです。 | |
| 18 | + | ||
| 19 | + | Lazarusに独自のプラグインを追加するには、2つの方法があります。 | |
| 20 | + | ||
| 21 | + | 1. パッケージを書く方法, 自分でプラグインを書いて、そのユニットの'Register'手続きを使います。 | |
| 22 | + | ||
| 23 | + | 1. Lazarusのコードを拡張して、差分をlazarusのメーリングリストへ送る方法。 | |
| 24 | + | ||
| 25 | + | ## コンポーネントを作成する | |
| 26 | + | ||
| 27 | + | ToDo Hint: Create a new component via the package editor. | |
| 28 | + | ||
| 29 | + | ## コンポーネントエディタを作成する | |
| 30 | + | ||
| 31 | + | ToDo Hint: see componenteditors.pas for examples | |
| 32 | + | ||
| 33 | + | ## プロパティエディタを作成する | |
| 34 | + | ||
| 35 | + | ToDo Hint: see propedits.pp for examples | |
| 36 | + | ||
| 37 | + | ## イベントハンドラを登録する | |
| 38 | + | ||
| 39 | + | IDEにはいくつかのイベントがあり、それに対してプラグインは独自のハンドラを追加することができます。propedits.pp で、"GlobalDesignHook"オブジェクトがあります。これは、設計時のイベントを管理します。各々のイベントはハンドラーのリストを呼び出します。デフォルトのハンドラーはIDEから追加されています。あなたは独自のハンドラを、AddHandlerXXXやRemoveHandlerXXX手続きを使って登録できます。それらは、デフォルトのハンドラの前に呼び出されます。 | |
| 40 | + | ||
| 41 | + | 例: | |
| 42 | + | ||
| 43 | + | ` 独自のハンドラを追加します。(通常、あなたが作成したオブジェクトのコンストラクタでおこないます。):`\ | |
| 44 | + | ` GlobalDesignHook.AddHandlerComponentAdded(@YourOnComponentAdded);`\ | |
| 45 | + | \ | |
| 46 | + | ` 独自のハンドラを取り除きます:`\ | |
| 47 | + | ` GlobalDesignHook.RemoveHandlerComponentAdded(@YourOnComponentAdded);`\ | |
| 48 | + | \ | |
| 49 | + | ` すべてのハンドラを一度に削除することもできます。たとえば、次の行をオブジェクトのデストラクタに追加するのも良いでしょう。:`\ | |
| 50 | + | ` GlobalDesignHook.RemoveAllHandlersForObject(Self);` | |
| 51 | + | ||
| 52 | + | GlobalDesignHookのハンドラです: | |
| 53 | + | ||
| 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` | |
| 92 | + | ||
| 93 | + | ## ソースのヘルプを追加する | |
| 94 | + | ||
| 95 | + | THelpDatabaseを最初に作りましょう: | |
| 96 | + | ||
| 97 | + | ` HelpDB:=TFPDocHTMLHelpDatabase(`\ | |
| 98 | + | ` HelpDatabases.CreateHelpDatabase('ANameOfYourChoiceForTheDatabase',`\ | |
| 99 | + | ` TFPDocHTMLHelpDatabase,true));`\ | |
| 100 | + | ` HelpDB.DefaultBaseURL:='`[`http://your.help.org/`](http://your.help.org/)`';` | |
| 101 | + | ||
| 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);` | |
| 109 | + | ||
| 110 | + | ## 最初の製作者と変更 | |
| 111 | + | ||
| 112 | + | This page has been converted from the epikwiki [version](http://lazarus-ccr.sourceforge.net/index.php?wiki=ExtendingTheIde). | |
| 113 | + | ||
| 114 | + | This document was authored by Mattias Gaertner Initial import and formatted for Lazarus-CCR - VlxAdmin 9/26/2003 | |
| 115 | + | ||
| 116 | + | --- | |
| 117 | + | *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).* |
