Difference between revisions of "Extending the IDE/de"
m |
m |
||
Line 9: | Line 9: | ||
; Komponenten : Komponenten werden in der Palette installiert. Z.B. TButton erzeugt Buttons. | ; Komponenten : Komponenten werden in der Palette installiert. Z.B. TButton erzeugt Buttons. | ||
− | ; Komponenten Editoren : 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. | + | ; Komponenten-Editoren : 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. |
− | ; | + | ; Eigenschafts-Editoren : Stellen die Editierfähigkeiten im Objekt-Inspektor zur Verfügung. |
− | ; | + | ; Experten : Alle anderen Typen von Editoren. |
Line 21: | Line 21: | ||
# Erweitere den Lazarus Code und sende Dein diff an die lazarus mailing list. | # Erweitere den Lazarus Code und sende Dein diff an die lazarus mailing list. | ||
− | == | + | == Komponenten schreiben == |
ToDo | ToDo | ||
Hint: Create a new component via the package editor. | Hint: Create a new component via the package editor. | ||
− | == | + | == Komponenten-Editoren schreiben == |
ToDo | ToDo | ||
− | + | Hinweis: siehe componenteditors.pas für Beispiele | |
− | == | + | == Eigenschafts-Editoren schreiben == |
ToDo | ToDo | ||
− | + | Hinweis: siehe propedits.pp für Beispiele | |
== Register event handlers == | == Register event handlers == | ||
Line 82: | Line 82: | ||
GetSelectedComponents | GetSelectedComponents | ||
Get the current selection of components.<br> | Get the current selection of components.<br> | ||
− | // | + | // persistente Objekte |
GetObject | GetObject | ||
GetObjectName | GetObjectName |
Revision as of 16:17, 27 March 2007
│
Deutsch (de) │
English (en) │
español (es) │
français (fr) │
日本語 (ja) │
русский (ru) │
slovenčina (sk) │
中文(中国大陆) (zh_CN) │
Erweitern der IDE
Einleitung
Die IDE unterstützt verschiedene Erweiterungen:
- Komponenten
- Komponenten werden in der Palette installiert. Z.B. TButton erzeugt Buttons.
- Komponenten-Editoren
- 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.
- Eigenschafts-Editoren
- Stellen die Editierfähigkeiten im Objekt-Inspektor zur Verfügung.
- Experten
- Alle anderen Typen von Editoren.
Es gibt 2 Möglichkeiten, Plugins in Lazarus zu integrieren:
- Erstellen eines Packages, installiert und registriert werden diese mit der Prozedur 'Register' in einer Unit.
- Erweitere den Lazarus Code und sende Dein diff an die lazarus mailing list.
Komponenten schreiben
ToDo Hint: Create a new component via the package editor.
Komponenten-Editoren schreiben
ToDo Hinweis: siehe componenteditors.pas für Beispiele
Eigenschafts-Editoren schreiben
ToDo Hinweis: siehe propedits.pp für Beispiele
Register event handlers
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.
Beispiele:
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.
// Methoden CreateMethod GetMethodName GetMethods MethodExists RenameMethod ShowMethod Called MethodFromAncestor ChainCall
// Komponenten 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.
// persistente Objekte GetObject GetObjectName GetObjectNames
// modifing Modified Revert RefreshPropertyValues
Hilfe für die Quellen hinzufügen
Erzeugen sie zuerst eine THelpDatabase:
HelpDB:=TFPDocHTMLHelpDatabase( HelpDatabases.CreateHelpDatabase('ANameOfYourChoiceForTheDatabase', TFPDocHTMLHelpDatabase,true)); HelpDB.DefaultBaseURL:='http://ihre.hilfe.org/';
FPDocNode:=THelpNode.CreateURL(HelpDB, 'Package1 - A new package', 'file://index.html'); HelpDB.TOCNode:=THelpNode.Create(HelpDB,FPDocNode);// einmal als Inhaltsverzeichnis DirectoryItem:=THelpDBISourceDirectory.Create(FPDocNode,'$(PkgDir)/lcl', '*.pp;*.pas',false);// und einmal als normale Seite HelpDB.RegisterItem(DirectoryItem);
Original contributors and changes
Diese Seite wurde von der epikwiki Version konvertiert.
This document was authored by Mattias Gaertner Initial import and formatted for Lazarus-CCR - VlxAdmin 9/26/2003