Sign in Join
Wiki copytemporary

How To Write Lazarus Component/it: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: How To Write Lazarus Component/it

OldNewLine
1+## Introduzione
2+
3+Questa è una guida di base su come costruire componenti. È stata testata su Lazarus 0.9.30 eseguito in Windows 7.
4+
5+## Passo 1: Creare il Package
6+
7+- Nel menu di Lazarus IDE, click su **Package \> Nuovo Package** per eseguire il Package Manager.
8+
9+<figure>
10+<img src="package_menu_it.png" title="package_menu_it.png" />
11+<figcaption>package_menu_it.png</figcaption>
12+</figure>
13+
14+- Apparirà la **finestra di dialog Salva file**. Scegli una cartella e un nome e salva. Se l'IDE propone di utilizzare le minuscole per il nome file, premi 'OK'.
15+
16+- Congratulazioni: hai appena creato il tuo primo Package!
17+
18+<figure>
19+<img src="nuovo_package.png" title="nuovo_package.png" />
20+<figcaption>nuovo_package.png</figcaption>
21+</figure>
22+
23+## Passo 2: Creare la Unit
24+
25+Puoi creare una nuova unit o usare un file esistente.
26+
27+### Crea una Nuova Unit
28+
29+- Usa il pulsante **Aggiungi \> Nuovo componente**.
30+
31+<figure>
32+<img src="nuovo_componente.png" title="nuovo_componente.png" />
33+<figcaption>nuovo_componente.png</figcaption>
34+</figure>
35+
36+- Scegli un componente come TComboBox.
37+- Scegli *customcontrol1.pas* come mome file.
38+- Clicca OK.
39+
40+``` pascal
41+unit CustomControl1;
42+
43+{$mode objfpc}{$H+}
44+
45+interface
46+
47+uses
48+ Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls;
49+
50+type
51+ TCustomControl1 = class(TComboBox)
52+ private
53+ { Private declarations }
54+ protected
55+ { Protected declarations }
56+ public
57+ { Public declarations }
58+ published
59+ { Published declarations }
60+ end;
61+
62+procedure Register;
63+
64+implementation
65+
66+procedure Register;
67+begin
68+ RegisterComponents('Standard',[TCustomControl1]);
69+end;
70+
71+end.
72+```
73+
74+- Installa il package cliccando il bottone 'install' in alto nel package editor.
75+
76+<figure>
77+<img src="package_install_it.png" title="package_install_it.png" />
78+<figcaption>package_install_it.png</figcaption>
79+</figure>
80+
81+- Quindi l'IDE chiederà se si vuole che venga fatto il rebuild dell'IDE. Cliccare yes.
82+
83+<figure>
84+<img src="package_rebuild_it.png" title="package_rebuild_it.png" />
85+<figcaption>package_rebuild_it.png</figcaption>
86+</figure>
87+
88+- Riavviato Lazarus potrete vedere il vostro nuovo componente nella component palette. Congratulazioni: Avete appena installato il vostro primo package con il vostro primo componente.
89+
90+<figure>
91+<img src="componente_installato.png" title="componente_installato.png" />
92+<figcaption>componente_installato.png</figcaption>
93+</figure>
94+
95+*Nota:* Se non vedete il vostro nuovo componente nella palette dei componenti, molto probabilmente state eseguendo una versione non ricompilata di Lazarus. Potete impostare dove Lazarus effettua il build in: Strumenti -\> Opzioni -\> File -\> Cartella di Lazarus. Invece di eseguire lazarus direttamente, potete anche usare startlazarus, che esegue lazarus più recentemente compilato, per esempio l'eseguibile di lazarus nella cartella ~/.lazarus, se non avete i diritti di scrittura nella cartella in cui è installato lazarus.
96+
97+### Aggiungi una Unit esistente
98+
99+Se avete già una unit potete aggiungerla al package:
100+
101+<figure>
102+<img src="package_add_unit_it.png" title="package_add_unit_it.png" />
103+<figcaption>package_add_unit_it.png</figcaption>
104+</figure>
105+
106+- Fate Click sul pulsante **Aggiungi**, andate sul tab **Aggiungi File**. Cliccato il pulsante Esplora, cercate il vostro file. Fate Click su **Aggiungi file al pacchetto**. Se il gestore pacchetti lamenta che la unit non è nella cartella, accettate di aggiungere la directory al percorso nel unit path.
107+- Fate Click ancora su **Aggiungi** , andate sul tab **Aggiungi File** e cercate il file *.lrs*, quindi fate click su OK (Vedete il Passo 3 per creare il file dell'icona ).
108+- Fate Click di nuovo su **Aggiungi**, andate sul tab **Nuovo requisito**, selezionate **LCL** in Nome pacchetto e fate click su OK.
109+
110+Il risultato finale dovrebbe assomigliare a questo:
111+
112+![`Package Maker`](/wiki-images/d/d9/How_to_write_lazarus_component_package_maker_done.png)
113+
114+- Click on under the Files tree in the Package Manager. In the File Properties, make sure *Register unit* is checked.
115+- Click the Options button. Select the IDE Integration tab. At the Package Type make sure Designtime and Runtime is selected.
116+- Click the Compile button to check to see if the files compile without errors.
117+- Click the Install button, Lazarus will rebuild and restart automatically.
118+
119+The component is created and ready to be used:
120+
121+![`Component Created`](/wiki-images/3/3c/How_to_write_lazarus_component_created.png)
122+
123+## Passo 3: Creare Icone Per Il Package
124+
125+La dimensione del file PNG dovrebbe essere 24x24. Il formato icona utilizzato è *.lrs*.
126+
127+### Usa Lazarus Image Editor
128+
129+Puoi usare [[Lazarus Image Editor]] per creare le icons nel formato .lrs.
130+
131+### Usa lazres
132+
133+Potresti aver bisogno di compilare lazres al primo utilizzo. Semplicemente apri *lazres.lpi* nell'IDE e scegli nel menu **run \> build**.
134+
135+**Crea file lrs**
136+
137+Per creare il file lrs esegui:
138+
139+`~/lazarus/tools/lazres samplepackage.lrs TMyCom.png`
140+
141+Dove *samplepackage* è il nome del tuo package e *TMyCom* è il nome del tuo componente.
142+
143+You can add more than one image to the lrs file by appending the image filename at the end. Eg. ~/lazarus/tools/lazres samplepackage.lrs TMyCom.png TMyOtherCom.png ...
144+
145+**Sample**
146+
147+Following is a sample of the resulting *samplepackage.lrs* file.
148+
149+ LazarusResources.Add('TMyCom','PNG',[
150+ #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#2#0#0#0'o'#21#170#175
151+ +#0#0#0#4'gAMA'#0#0#177#143#11#252'a'#5#0#0#0'|IDAT8O'#237#212#209#10#192' '#8
152+ +#5'P'#247#231#251's'#215#138#133#164#166'\'#220#195'`'#209'c'#157'L'#173#131
153+ +#153#169'd4'#168'dP'#137'r_'#235'5'#136'@Zmk'#16'd9'#144#176#232#164'1'#247
154+ +'I'#8#160'IL'#206'C'#179#144#12#199#140'.'#134#244#141'~'#168#247#209'S~;'#29
155+ +'V+'#196#201'^'#10#15#150'?'#255#18#227#206'NZ>42'#181#159#226#144#15'@'#201
156+ +#148#168'e'#224'7f<@4'#130'u_YD'#23#213#131#134'Q]'#158#188#135#0#0#0#0'IEND'
157+ +#174'B`'#130
158+ ]);
159+
160+## Recompiling Packages
161+
162+You need to rebuild the package everytime you make changes to the *mycom.pas* file. To rebuild the package, open the *samplepackage.lpk* file in the Package Manager and click the Install button.
163+
164+## Removing Packages
165+
166+- To remove installed components, on the IDE menu, click Package \> Configure installed packages. The following image shows the Installed Packages tool.
167+
168+![`Installed Components`](/wiki-images/0/0e/How_to_write_lazarus_component_installed_components.png)
169+
170+- Select the package you want to uninstall and click Uninstall selection.
171+
172+If something goes wrong with a package (e.g. package directory is deleted without first uninstalling it), Lazarus may not allow you to uninstall packages. To fix the problem, at the IDE menu click Tools \> Build Lazarus. Lazarus will rebuild all packages and restart. You should now be able to uninstall problematic packages.
173+
174+## Enhancing mycom.pas
175+
176+- The codes in *mycom.pas* above gives you the basics on what you need to create a component. The following is an enhanced version with some tips on how to write procedures and events for components.
177+- The *OnChange2* shows how to create events
178+- The *OnSample* shows how to create custom events
179+- *MyText* and *MyText2* shows different ways to write properties.
180+- You can use TComboBox instead of TCustomComboBox as the base class, which publishes all properties as TComboBox.
181+- If TCustomComboBox is used as the base class, you'll notice a lot of properties and events will be missing at the Object Inspector in the IDE. To add those properties and events just copy and paste the properties as listed below *// properties from TComboBox*. These list of properties can be got from the TComboBox declaration in the StdCtrls unit. Omit any property which you want to handle yourself.
182+
183+``` pascal
184+unit mycom;
185+
186+{$mode objfpc}{$H+}
187+
188+interface
189+
190+uses
191+ Classes, SysUtils, StdCtrls, Forms, Dialogs,
192+ LCLType,LCLIntf,lresources,LCLProc;
193+
194+type
195+
196+ TSampleEvent = procedure(MyText: String) of Object;
197+
198+ TMyCom = class (TCustomComboBox)
199+ private
200+ FMyText: String;
201+ FOnChange2: TNotifyEvent;
202+ FOnSample: TSampleEvent;
203+ public
204+ constructor Create(TheOwner: TComponent); override;
205+ procedure CreateWnd; override;
206+ procedure Change; override;
207+ protected
208+ function GetMyText2: String;
209+ procedure SetMyText2(MyText: String);
210+ published
211+ property MyText: String read FMyText write FMyText;
212+ property MyText2: String read GetMyText2 write SetMyText2;
213+ property OnChange2: TNotifyEvent read FOnChange2 write FOnChange2;
214+ property OnSample: TSampleEvent read FOnSample write FOnSample;
215+
216+ // properties from TComboBox
217+ property Align;
218+ property Anchors;
219+ property ArrowKeysTraverseList;
220+ property AutoComplete;
221+ property AutoCompleteText;
222+ property AutoDropDown;
223+ property AutoSelect;
224+ property AutoSize;
225+ property BidiMode;
226+ property BorderSpacing;
227+ property CharCase;
228+ property Color;
229+ property Ctl3D;
230+ property Constraints;
231+ property DragCursor;
232+ property DragMode;
233+ property DropDownCount;
234+ property Enabled;
235+ property Font;
236+ property ItemHeight;
237+ property ItemIndex;
238+ property Items;
239+ property ItemWidth;
240+ property MaxLength;
241+ property OnChange;
242+ property OnChangeBounds;
243+ property OnClick;
244+ property OnCloseUp;
245+ property OnContextPopup;
246+ property OnDblClick;
247+ property OnDragDrop;
248+ property OnDragOver;
249+ property OnDrawItem;
250+ property OnEndDrag;
251+ property OnDropDown;
252+ property OnEditingDone;
253+ property OnEnter;
254+ property OnExit;
255+ property OnGetItems;
256+ property OnKeyDown;
257+ property OnKeyPress;
258+ property OnKeyUp;
259+ property OnMeasureItem;
260+ property OnMouseDown;
261+ property OnMouseMove;
262+ property OnMouseUp;
263+ property OnStartDrag;
264+ property OnSelect;
265+ property OnUTF8KeyPress;
266+ property ParentBidiMode;
267+ property ParentColor;
268+ property ParentCtl3D;
269+ property ParentFont;
270+ property ParentShowHint;
271+ property PopupMenu;
272+ property ReadOnly;
273+ property ShowHint;
274+ property Sorted;
275+ property Style;
276+ property TabOrder;
277+ property TabStop;
278+ property Text;
279+ property Visible;
280+ end;
281+
282+procedure Register;
283+
284+implementation
285+
286+procedure Register;
287+begin
288+ RegisterComponents('Sample',[TMyCom]);
289+end;
290+
291+constructor TMyCom.Create(TheOwner: TComponent);
292+begin
293+ inherited Create(TheOwner);
294+ Self.Style := csDropDownList;
295+end;
296+
297+procedure TMyCom.CreateWnd;
298+begin
299+ inherited CreateWnd;
300+ Items.Assign(Screen.Fonts);
301+end;
302+
303+procedure TMyCom.Change;
304+begin
305+ inherited;
306+ if Assigned(FOnChange2) then FOnChange2(Self);
307+ if Assigned(FOnSample) then FOnSample(FMyText);
308+end;
309+
310+function TMyCom.GetMyText2: String;
311+begin
312+ Result:=FMyText;
313+end;
314+
315+procedure TMyCom.SetMyText2(MyText: String);
316+begin
317+ FMyText:=MyText;
318+end;
319+
320+initialization
321+ {$I samplepackage.lrs}
322+
323+end.
324+```
325+
326+## Using embedded (visual) components
327+
328+It's possible to use standard components embedded in your own components (look for example at TLabeledEdit or TButtonPanel). Let's say you want to create a custom panel with a TLabel on it. With the steps described above the base package and source files can be created. Now to add a TLabel to the component, do the following:
329+
330+- Add a private attribute for the label component (FEmbeddedLabel: TLabel;).
331+- Add a published read-only property for the label component (property EmbeddedLabel: TLabel read FEmbeddedLabel;)
332+- Create the label in the component's (overridden) constructor (FEmbeddedLabel := TLabel.Create(self); )
333+- Set the parent of the component (FEmbeddedLabel.Parent := self;)
334+- If the component to be embedded is not a 'subcomponent' by default (like TBoundLabel, TPanelBitBtn etc.) then add the call to SetSubComponent. This is necessary for the IDE so it knows that it has to store the properties of the embedded component as well. TLabel is not a subcomponent by default so the call to the method must be added (FEmbeddedLabel.SetSubComponent(true);).
335+
336+To sum it up you would get something like this (only the essential parts are shown):
337+
338+``` pascal
339+TEnhancedPanel = class(TCustomControl)
340+private
341+ { The new attribute for the embedded label }
342+ FEmbeddedLabel: TLabel;
343+
344+public
345+ { The constructor must be overriden so the label can be created }
346+ constructor Create(AOwner: TComponent); override;
347+
348+published
349+ { Make the label visible in the IDE }
350+ property EmbeddedLabel: TLabel read FEmbeddedLabel;
351+end;
352+
353+implementation
354+
355+constructor TEnhancedPanel.Create(AOwner: TComponent);
356+begin
357+ inherited Create(AOwner);
358+
359+ // Set default width and height
360+ with GetControlClassDefaultSize do
361+ SetInitialBounds(0, 0, CX, CY);
362+
363+ // Add the embedded label
364+ FEmbeddedLabel := TLabel.Create(Self); // Add the embedded label
365+ FEmbeddedLabel.Parent := self; // Show the label in the panel
366+ FEmbeddedLabel.SetSubComponent(true); // Tell the IDE to store the modified properties
367+ FLabel.Name := 'EmbeddedLabel';
368+ FLabel.Caption := 'Howdy World!';
369+
370+ // Make sure the embedded label can not be selected/deleted within the IDE
371+ FLabel.ControlStyle := FLabel.ControlStyle - [csNoDesignSelectable];
372+
373+ // Set other properties if necessary
374+ //...
375+
376+end;
377+```
378+
379+## Using custom paint procedure
380+
381+You can always subclass a component inside your program. For example, this implements a custom Paint procedure to a TLabel:
382+
383+``` pascal
384+type
385+ TMyLabel = class(TLabel)
386+ public
387+ procedure Paint; override;
388+ end;
389+{...}
390+implementation
391+{...}
392+procedure TMyLabel.Paint;
393+begin
394+ // your code to implement Paint, for example
395+ Canvas.TextOut(0,0,Caption);
396+end;
397+```
398+
399+Now you can create a MyLabel inside your program, at run time, with that overridden Paint procedure instead of the standard one.
400+
401+For most components, and for most methods, it would be recommendable to call inherited procedure iniside it:
402+
403+``` pascal
404+procedure TMyLabel.Paint;
405+begin
406+
407+ inherited Paint; /////////////////////
408+
409+ // your code to implement Paint, for example
410+ Canvas.TextOut(0,0,Caption);
411+end;
412+```
413+
414+But inherited behavior is not desirable in this case, since the second writing action would overlap the first (inherited) one.
415+
416+## Integrating the Component with the IDE
417+
418+### Property Editors
419+
420+Property editors provide custom dialogs to edit properties in the object inspector. For most properties, like strings, string lists, images, enumerated types and others, there are already default property editors, but if a custom component has a special kind of property it may require a custom dialog to edit the property. Each property editor is a class, which should descend from TPropertyEditor or one of it's descendents and implement methods from this base class. They should be registered in the 'Register' procedure by using the function RegisterPropertyEditor from the unit PropEdits. It is a standard to name property editors with the property name followed by 'Property', for example TFieldProperty for the property editor of the TField property.
421+
422+``` pascal
423+ TPropertyEditor = class
424+ public
425+ function AllEqual: Boolean; Virtual;
426+ function AutoFill: Boolean; Virtual;
427+ procedure Edit; Virtual; // Activated by double-clicking the property value
428+ procedure ShowValue; Virtual; // Activated by control-clicking the property value
429+ function GetAttributes: TPropertyAttributes; Virtual;
430+ function GetEditLimit: Integer; Virtual;
431+ function GetName: ShortString; Virtual;
432+ procedure GetProperties(Proc: TGetPropEditProc); Virtual;
433+ function GetHint(HintType: TPropEditHint; x, y: integer): String; Virtual;
434+ function GetDefaultValue: AnsiString; Virtual;
435+ procedure GetValues(Proc: TGetStrProc); Virtual;
436+ procedure SetValue(const NewValue: AnsiString); Virtual;
437+ procedure UpdateSubProperties; Virtual;
438+ function SubPropertiesNeedsUpdate: Boolean; Virtual;
439+ function IsDefaultValue: Boolean; Virtual;
440+ function IsNotDefaultValue: Boolean; Virtual;
441+ // ... shortened
442+ end;
443+```
444+
445+A good example for a property editor is the TFont property editor.
446+
447+One of the most common cases for property editors is properties which are classes, because classes have many fields and can have a variety of formats, it's not possible for Lazarus to have the object inspector edit field able to edit it, like is done for strings and numeric types. For classes a convention is to have the value field show permanently the name of the class in parentheses, for example „(TFont)“ and the „...“ button shows a dialog to edit this class. This behavior, except for the dialog, is implemented by a standard property editor for classes called TClassPropertyEditor, which can be inherited from when writing property editors for classes:
448+
449+``` pascal
450+TClassPropertyEditor = class(TPropertyEditor)
451+public
452+ constructor Create(Hook: TPropertyEditorHook; APropCount: Integer); Override;
453+ function GetAttributes: TPropertyAttributes; Override;
454+ procedure GetProperties(Proc: TGetPropEditProc); Override;
455+ function GetValue: AnsiString; Override;
456+ property SubPropsTypeFilter: TTypeKinds Read FSubPropsTypeFilter
457+ Write SetSubPropsTypeFilter
458+ Default tkAny;
459+end;
460+```
461+
462+Going back to the TFont example, inheriting from TClassPropertyEditor already offers part of the desired behavior and then the TFontPropertyEditor class only needs to implement showing the dialog in the Edit method and set the attributes for the editor:
463+
464+``` pascal
465+ TFontPropertyEditor = class(TClassPropertyEditor)
466+ public
467+ procedure Edit; Override;
468+ function GetAttributes: TPropertyAttributes; Override;
469+ end;
470+
471+procedure TFontPropertyEditor.Edit;
472+var
473+ FontDialog: TFontDialog;
474+begin
475+ FontDialog := TFontDialog.Create(NIL);
476+ try
477+ FontDialog.Font := TFont(GetObjectValue(TFont));
478+ FontDialog.Options := FontDialog.Options + [fdShowHelp, fdForceFontExist];
479+ if FontDialog.Execute then SetPtrValue(FontDialog.Font);
480+ finally
481+ FontDialog.Free;
482+ end;
483+end;
484+
485+function TFontPropertyEditor.GetAttributes: TPropertyAttributes;
486+begin
487+ Result := [paMultiSelect, paSubProperties, paDialog, paReadOnly];
488+end;
489+```
490+
491+### Component Editors
492+
493+Component editors control the behavior of right-clicking and double clicking components in the form designer. Each component editor is a class, which should descend from TComponentEditor or one of it's descendents and implement methods from this base class. They should be registered in the 'Register' procedure by using the function RegisterComponentEditor from the unit ComponentEditors. It is a standard to name component editors with the component name followed by 'Editor', for example TStringGridComponentEditor for the property editor of the TStringGrid component. Although user component editors should be based in TComponentEditor, most of it's methods are actually from an ancestor, so it is necessary to also know TBaseComponentEditor:
494+
495+``` pascal
496+ TBaseComponentEditor = class
497+ protected
498+ public
499+ constructor Create(AComponent: TComponent;
500+ ADesigner: TComponentEditorDesigner); Virtual;
501+ procedure Edit; Virtual; Abstract;
502+ procedure ExecuteVerb(Index: Integer); Virtual; Abstract;
503+ function GetVerb(Index: Integer): String; Virtual; Abstract;
504+ function GetVerbCount: Integer; Virtual; Abstract;
505+ procedure PrepareItem(Index: Integer; const AnItem: TMenuItem); Virtual; Abstract;
506+ procedure Copy; Virtual; Abstract;
507+ function IsInInlined: Boolean; Virtual; Abstract;
508+ function GetComponent: TComponent; Virtual; Abstract;
509+ function GetDesigner: TComponentEditorDesigner; Virtual; Abstract;
510+ function GetHook(out Hook: TPropertyEditorHook): Boolean; Virtual; Abstract;
511+ procedure Modified; Virtual; Abstract;
512+ end;
513+```
514+
515+The most important method of a component editor is Edit, which is called when the component is double clicked. When the context menu for the component is invoked the GetVerbCount and GetVerb methods are called to build the menu. If one of the verbs (which means menu items in this case) are selected, ExecuteVerb is called. There is a default component editor (TDefaultEditor) which implements Edit to search the properties of the component for the most appropriate one to be edited. It usually chooses an event, which is edited by adding it's skeleton code in the code editor and setting the cursor to be in place to add code for it.
516+
517+Other important methods from TBasComponentEditor are: ExecuteVerb(Index), which executes one of the extra menu items placed on the right-click popup menu; GetVerb – To return the name of each extra popup menu item. Note that t is the responsibility of the component editor to place special menu item caption characters like & to create a keyboard accelerator and “-” to create a separator; GetVerbCount – Returns the amount of items to be added to the popup menu. The index for the routines GetVerb and ExecuteVerb is zero based, going from 0 to GetVerbCount – 1; PrepareItem – Called for each verb after the menu item was created. Allows the menu item to be customized such as by adding subitems, adding a checkbox or even hiding it by setting Visible to false; Copy - Called when the component is being copied to the clipboard. The component data for use by Lazarus will always be added and cannot be modified. This method is instead for adding a different kind of clipboard information to paste the component in other applications, but which won't affect the Lazarus paste.
518+
519+A simple and interesting example is the TCheckListBox component editor which creates a dialog to edit. More convenient then implementing all methods from TBaseComponentEditor is inheriting from TComponentEditor, and this is what TCheckListBoxEditor does. This base class adds empty implementations for most methods and some default ones for others. For Edit it calls ExecuteVerb(0), so if the first item will be identical to the double-click action, which is a convention for editor, there is no need to implement Edit. This basic action for the double-click and first menu item is often a dialog, and for TCheckListBox this is also done:
520+
521+``` pascal
522+ TCheckListBoxComponentEditor = class(TComponentEditor)
523+ protected
524+ procedure DoShowEditor;
525+ public
526+ procedure ExecuteVerb(Index: Integer); override;
527+ function GetVerb(Index: Integer): String; override;
528+ function GetVerbCount: Integer; override;
529+ end;
530+
531+procedure TCheckGroupComponentEditor.DoShowEditor;
532+var
533+ Dlg: TCheckGroupEditorDlg;
534+begin
535+ Dlg := TCheckGroupEditorDlg.Create(NIL);
536+ try
537+ // .. shortened
538+ Dlg.ShowModal;
539+ // .. shortened
540+ finally
541+ Dlg.Free;
542+ end;
543+end;
544+
545+procedure TCheckGroupComponentEditor.ExecuteVerb(Index: Integer);
546+begin
547+ case Index of
548+ 0: DoShowEditor;
549+ end;
550+end;
551+
552+function TCheckGroupComponentEditor.GetVerb(Index: Integer): String;
553+begin
554+ Result := 'CheckBox Editor...';
555+end;
556+
557+function TCheckGroupComponentEditor.GetVerbCount: Integer;
558+begin
559+ Result := 1;
560+end;
561+```
562+
563+## Reference
564+
565+- [[Extending the IDE]]
566+- [[Lazarus Packages]] - A guide for creating a package under Lazarus
567+- [[Components and Code examples]]
568+- [[Lazarus Components]]
569+- [[IDE Window: Add to Package]]
570+
571+You can post questions regarding this page [here](http://forum.lazarus.freepascal.org/index.php/topic,5789.0.html)
572+
573+# Questa pagina
574+
575+Questa pagina è in corso di traduzione dalla [[How To Write Lazarus Component|corrispondente pagina inglese]]
576+
577+## Author
578+
579+[[User talk:Tpglemur|Original Author]]
580+
581+Tradotta da User:JohnCat
582+
583+---
584+*From the Free Pascal wiki, page "How To Write Lazarus Component/it", as it stood on 2020-02-17 after a change by Trev, 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).*

Back to history