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