Difference between revisions of "Extending the IDE/ja"

From Lazarus wiki
Jump to navigationJump to search
Line 7: Line 7:
 
== 概要 ==
 
== 概要 ==
  
The IDE supports several types of plugins:
+
IDEはいくつかのプラグインをサポートしています。
  
; Components : These are the items in the component palette. For a example TButton can be used to create Buttons.
+
; コンポーネント : コンポーネントパレット上にアイコンとして現れます。と問えば、TButtonはボタンを作るのに使われます。
  
; Component Editors : Component editors are used when you double click on a component in the designer or to add some extra items to the popup menu of the designer, when you right click on a component.
+
; コンポーネントエディタ : コンポーネントエディタはコンポーネントを設計時にダブルクリックしたり、設計時にコンポーネント上で右クリックで表示されるポップアップメニューにいくつかの項目を追加するときに使われます。
  
; Property Editors : These are used by the rows in the object inspector.
+
; プロパティエディタ : オブジェクトインスペクタの行で使われます。
  
; Experts : These are all other types.
+
; エキスパート : その他の全てです。
  
  
There are two possibilities to add your own plugins to Lazarus:
+
Lazarusに独自のプラグインを追加するには、2つの方法があります。
  
# Write a package, install it and register your plugins in the 'Register' procedure of a unit.
+
# パッケージを書く方法, 自分でプラグインを書いて、そのユニットの'Register'手続きを使います。
# Extend the lazarus code, and send your cvs diff to the lazarus mailing list.
+
 
 +
# Lazarusのコードを拡張して、差分をlazarusのメーリングリストへ送る方法。
  
 
== コンポーネントを作成する ==
 
== コンポーネントを作成する ==

Revision as of 14:56, 6 January 2008

Deutsch (de) English (en) español (es) français (fr) 日本語 (ja) русский (ru) slovenčina (sk) 中文(中国大陆)‎ (zh_CN)

日本語版メニュー
メインページ - Lazarus Documentation日本語版 - 翻訳ノート - 日本語障害情報

IDEを拡張する

概要

IDEはいくつかのプラグインをサポートしています。

コンポーネント
コンポーネントパレット上にアイコンとして現れます。と問えば、TButtonはボタンを作るのに使われます。
コンポーネントエディタ
コンポーネントエディタはコンポーネントを設計時にダブルクリックしたり、設計時にコンポーネント上で右クリックで表示されるポップアップメニューにいくつかの項目を追加するときに使われます。
プロパティエディタ
オブジェクトインスペクタの行で使われます。
エキスパート
その他の全てです。


Lazarusに独自のプラグインを追加するには、2つの方法があります。

  1. パッケージを書く方法, 自分でプラグインを書いて、そのユニットの'Register'手続きを使います。
  1. 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

イベントハンドラを登録する

There are several events in the IDE, for which plugins can add their own handlers. In propedits.pp there is a "GlobalDesignHook" object, which maintains several events for designing. Each event calls a list of handlers. The default handlers are added by the IDE. You can add your own handlers with the AddHandlerXXX and RemoveHandlerXXX methods. They will be called before the default handlers.

Examples:

 Adding your handler (this is normally done in the constructor of your object):
   GlobalDesignHook.AddHandlerComponentAdded(@YourOnComponentAdded);
Removing your handler: GlobalDesignHook.RemoveHandlerComponentAdded(@YourOnComponentAdded);
You can remove all handlers at once. For example, it is a good idea to add this line in the destructor of object: GlobalDesignHook.RemoveAllHandlersForObject(Self);

The handlers of 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


ソースのヘルプを追加する

First create a 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