Sign in Join
Wiki copytemporary

How To Write Lazarus Component/ko: what changed

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

OldNewLine
11컴포넌츠 빌드방법에 대한 기본 안내서이다. 윈도우7 라자루스 0.9.30버전에서 테스트 되었다.
22
33## 단계 1: 패키지 생성
44
55- On the Lazarus IDE menu, click **Package \> New Package** to run the Package Manager.
66
7-<figure>
8-<img src="package_menu.png" title="package_menu.png" />
9-<figcaption>package_menu.png</figcaption>
10-</figure>
7+![](/wiki-images/7/7c/Package_menu.png)
118
129- A **Save dialog** file will appear. Chose a folder and a filename and press save. If the IDE prompts for using lowercase filenames press 'yes'.
1310
1411- Congratulations: You have just created your first package!
1512
16-<figure>
17-<img src="How_to_write_lazarus_component_package_maker.png" title="Package Maker" />
18-<figcaption>Package Maker</figcaption>
19-</figure>
13+![](/wiki-images/3/37/How_to_write_lazarus_component_package_maker.png)
2014
2115## 단계 2: 유닛 생성
2216
2317You can create a new unit or use an existing file.
2418
2519### 새로운 유닛 생성
2620
2721- Use the **Add button \> New component**.
2822
29-<figure>
30-<img src="package_new_component.png" title="package_new_component.png" />
31-<figcaption>package_new_component.png</figcaption>
32-</figure>
23+![](/wiki-images/5/56/Package_new_component.png)
3324
3425- Choose a component like TComboBox.
3526- Choose *customcontrol1.pas* as filename.
3627- Click OK.
3728
3829``` pascal
3930unit CustomControl1;
4031
4132{$mode objfpc}{$H+}
4233
4334interface
4435
4536uses
4637 Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls;
4738
4839type
4940 TCustomControl1 = class(TComboBox)
5041 private
5142 { Private declarations }
5243 protected
5344 { Protected declarations }
5445 public
5546 { Public declarations }
5647 published
5748 { Published declarations }
5849 end;
5950
6051procedure Register;
6152
6253implementation
6354
6455procedure Register;
6556begin
6657 RegisterComponents('Standard',[TCustomControl1]);
6758end;
6859
6960end.
7061```
7162
7263- Install the package by clicking the 'install' button at the top of the package editor.
7364
74-<figure>
75-<img src="package_install.png" title="package_install.png" />
76-<figcaption>package_install.png</figcaption>
77-</figure>
65+![](/wiki-images/3/36/Package_install.png)
7866
7967- Then the IDE will ask you, if the IDE should be rebuilt. Say yes.
8068
81-<figure>
82-<img src="package_rebuild.png" title="package_rebuild.png" />
83-<figcaption>package_rebuild.png</figcaption>
84-</figure>
69+![](/wiki-images/9/9b/Package_rebuild.png)
8570
8671- Restart Lazarus and see your new component in the component palette. Congratulations: You have just installed your first package with your first package component.
8772
88-<figure>
89-<img src="package_installed.png" title="package_installed.png" />
90-<figcaption>package_installed.png</figcaption>
91-</figure>
73+![](/wiki-images/3/35/Package_installed.png)
9274
9375> **Note:** If you do not see your new component in the component palette, it is most likely that you are not running the re-compiled version of Lazarus. You can set where Lazarus builds to in: Tools -\> Options -\> Files -\> Lazarus directory. Instead of calling lazarus directly, you also can use startlazarus, which starts the newly created lazarus, for example the lazarus executable in the ~/.lazarus directory, if you don't have write access to the directory lazarus was installed into.
9476
9577### 기존 유닛 추가
9678
9779If you already had a unit you can add it to the package:
9880
99-<figure>
100-<img src="package_existing_unit.png" title="package_existing_unit.png" />
101-<figcaption>package_existing_unit.png</figcaption>
102-</figure>
81+![](/wiki-images/1/11/Package_existing_unit.png)
10382
10483- Click the **Add** button, go to the **Add Files** tab. At the Unit file name, browse to your existing file. Click the **Add files to package**. If the packet manager complains that the unit is not in the unitpath, click yes to add the directory to the unit path.
10584- Click the **Add** button again, go to the **Add Files** tab and browse to the *.lrs* file and click OK (See Step 3 about creating this icon file).
10685- Click the **Add** button again, go to the **New Requirement** tab, in the Package name select **LCL** and click OK.
10786
10887End result should look like this:
10988
11089![`Package Maker`](/wiki-images/d/d9/How_to_write_lazarus_component_package_maker_done.png)
11190
11291- Click on under the Files tree in the Package Manager. In the File Properties, make sure *Register unit* is checked.
11392- Click the Options button. Select the IDE Integration tab. At the Package Type make sure Designtime and Runtime is selected.
11493- Click the Compile button to check to see if the files compile without errors.
11594- Click the Install button, Lazarus will rebuild and restart automatically.
11695
11796The component is created and ready to be used:
11897
11998![`Component Created`](/wiki-images/3/3c/How_to_write_lazarus_component_created.png)
12099
121100## 단계 3: 패키지 아이콘 생성
122101
123102아이콘은 PNG 파일로 24x24 사이즈입니다.
124103
125104FPC is capable of using standard resource files `.rc` or compiled resources `.res` since fpc version 2.6
126105
127106The `.lrs`
128107
129108### 라자루스 이미지 에디터 사용
130109
131110You can use [[Lazarus Image Editor]] to create the icons in .lrs format.
132111
133112### lazres 사용
134113
135114`lazres`는 라자루스툴 디렉토리에 있는 located를 사용합니다.
136115
137116You may need to compile lazres at first use. Simply open the *lazres.lpi* in the IDE and at the menu click **run \> build**.
138117
139118**Create lrs file**
140119
141120lrs 파일 생성:
142121
143122`~/lazarus/tools/lazres samplepackage.lrs TMyCom.png`
144123
145124Where *samplepackage* is the name of your package and *TMyCom* is the name of your component.
146125
147126You 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 ...
148127
149128**샘플**
150129
151130Following is a sample of the resulting *samplepackage.lrs* file.
152131
153132 LazarusResources.Add('TMyCom','PNG',[
154133 #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
155134 +#0#0#0#4'gAMA'#0#0#177#143#11#252'a'#5#0#0#0'|IDAT8O'#237#212#209#10#192' '#8
156135 +#5'P'#247#231#251's'#215#138#133#164#166'\'#220#195'`'#209'c'#157'L'#173#131
157136 +#153#169'd4'#168'dP'#137'r_'#235'5'#136'@Zmk'#16'd9'#144#176#232#164'1'#247
158137 +'I'#8#160'IL'#206'C'#179#144#12#199#140'.'#134#244#141'~'#168#247#209'S~;'#29
159138 +'V+'#196#201'^'#10#15#150'?'#255#18#227#206'NZ>42'#181#159#226#144#15'@'#201
160139 +#148#168'e'#224'7f<@4'#130'u_YD'#23#213#131#134'Q]'#158#188#135#0#0#0#0'IEND'
161140 +#174'B`'#130
162141 ]);
163142
164143Make sure to include your resource file in your new component source by adding the following at the bottom your component's unit and including "LResources" in the uses clause
165144
166145``` pascal
167146initialization
168147 {$I samplepackage.lrs}
169148```
170149
171150## 리컴파일링 패키지
172151
173152You 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.
174153
175154## 패키지 제거
176155
177156- To remove installed components, on the IDE menu, click Package \> Configure installed packages. The following image shows the Installed Packages tool.
178157
179158![`Installed Components`](/wiki-images/0/0e/How_to_write_lazarus_component_installed_components.png)
180159
181160- Select the package you want to uninstall and click Uninstall selection.
182161
183162If 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.
184163
185164## mycom.pas 개선
186165
187166- 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.
188167- *OnChange2* 이벤트를 만드는 방법을 보여줍니다
189168- The *OnSample* shows how to create custom events
190169- *MyText* and *MyText2* shows different ways to write properties.
191170- You can use TComboBox instead of TCustomComboBox as the base class, which publishes all properties as TComboBox.
192171- 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.
193172
194173``` pascal
195174unit mycom;
196175
197176{$mode objfpc}{$H+}
198177
199178interface
200179
201180uses
202181 Classes, SysUtils, StdCtrls, Forms, Dialogs,
203182 LCLType,LCLIntf,lresources,LCLProc;
204183
205184type
206185
207186 TSampleEvent = procedure(MyText: String) of Object;
208187
209188 TMyCom = class (TCustomComboBox)
210189 private
211190 FMyText: String;
212191 FOnChange2: TNotifyEvent;
213192 FOnSample: TSampleEvent;
214193 public
215194 constructor Create(TheOwner: TComponent); override;
216195 procedure CreateWnd; override;
217196 procedure Change; override;
218197 protected
219198 function GetMyText2: String;
220199 procedure SetMyText2(MyText: String);
221200 published
222201 property MyText: String read FMyText write FMyText;
223202 property MyText2: String read GetMyText2 write SetMyText2;
224203 property OnChange2: TNotifyEvent read FOnChange2 write FOnChange2;
225204 property OnSample: TSampleEvent read FOnSample write FOnSample;
226205
227206 // properties from TComboBox
228207 property Align;
229208 property Anchors;
230209 property ArrowKeysTraverseList;
231210 property AutoComplete;
232211 property AutoCompleteText;
233212 property AutoDropDown;
234213 property AutoSelect;
235214 property AutoSize;
236215 property BidiMode;
237216 property BorderSpacing;
238217 property CharCase;
239218 property Color;
240219 property Ctl3D;
241220 property Constraints;
242221 property DragCursor;
243222 property DragMode;
244223 property DropDownCount;
245224 property Enabled;
246225 property Font;
247226 property ItemHeight;
248227 property ItemIndex;
249228 property Items;
250229 property ItemWidth;
251230 property MaxLength;
252231 property OnChange;
253232 property OnChangeBounds;
254233 property OnClick;
255234 property OnCloseUp;
256235 property OnContextPopup;
257236 property OnDblClick;
258237 property OnDragDrop;
259238 property OnDragOver;
260239 property OnDrawItem;
261240 property OnEndDrag;
262241 property OnDropDown;
263242 property OnEditingDone;
264243 property OnEnter;
265244 property OnExit;
266245 property OnGetItems;
267246 property OnKeyDown;
268247 property OnKeyPress;
269248 property OnKeyUp;
270249 property OnMeasureItem;
271250 property OnMouseDown;
272251 property OnMouseMove;
273252 property OnMouseUp;
274253 property OnStartDrag;
275254 property OnSelect;
276255 property OnUTF8KeyPress;
277256 property ParentBidiMode;
278257 property ParentColor;
279258 property ParentCtl3D;
280259 property ParentFont;
281260 property ParentShowHint;
282261 property PopupMenu;
283262 property ReadOnly;
284263 property ShowHint;
285264 property Sorted;
286265 property Style;
287266 property TabOrder;
288267 property TabStop;
289268 property Text;
290269 property Visible;
291270 end;
292271
293272procedure Register;
294273
295274implementation
296275
297276procedure Register;
298277begin
299278 RegisterComponents('Sample',[TMyCom]);
300279end;
301280
302281constructor TMyCom.Create(TheOwner: TComponent);
303282begin
304283 inherited Create(TheOwner);
305284 Self.Style := csDropDownList;
306285end;
307286
308287procedure TMyCom.CreateWnd;
309288begin
310289 inherited CreateWnd;
311290 Items.Assign(Screen.Fonts);
312291end;
313292
314293procedure TMyCom.Change;
315294begin
316295 inherited;
317296 if Assigned(FOnChange2) then FOnChange2(Self);
318297 if Assigned(FOnSample) then FOnSample(FMyText);
319298end;
320299
321300function TMyCom.GetMyText2: String;
322301begin
323302 Result:=FMyText;
324303end;
325304
326305procedure TMyCom.SetMyText2(MyText: String);
327306begin
328307 FMyText:=MyText;
329308end;
330309
331310initialization
332311 {$I samplepackage.lrs}
333312
334313end.
335314```
336315
337316## 내장 (시각)컨포넌트 사용
338317
339318It'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:
340319
341320- Add a private attribute for the label component (FEmbeddedLabel: TLabel;).
342321- Add a published read-only property for the label component (property EmbeddedLabel: TLabel read FEmbeddedLabel;)
343322- Create the label in the component's (overridden) constructor (FEmbeddedLabel := TLabel.Create(self); )
344323- Set the parent of the component (FEmbeddedLabel.Parent := self;)
345324- 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);).
346325
347326To sum it up you would get something like this (only the essential parts are shown):
348327
349328``` pascal
350329TEnhancedPanel = class(TCustomControl)
351330private
352331 { The new attribute for the embedded label }
353332 FEmbeddedLabel: TLabel;
354333
355334public
356335 { The constructor must be overriden so the label can be created }
357336 constructor Create(AOwner: TComponent); override;
358337
359338published
360339 { Make the label visible in the IDE }
361340 property EmbeddedLabel: TLabel read FEmbeddedLabel;
362341end;
363342
364343implementation
365344
366345constructor TEnhancedPanel.Create(AOwner: TComponent);
367346begin
368347 inherited Create(AOwner);
369348
370349 // Set default width and height
371350 with GetControlClassDefaultSize do
372351 SetInitialBounds(0, 0, CX, CY);
373352
374353 // Add the embedded label
375354 FEmbeddedLabel := TLabel.Create(Self); // Add the embedded label
376355 FEmbeddedLabel.Parent := self; // Show the label in the panel
377356 FEmbeddedLabel.SetSubComponent(true); // Tell the IDE to store the modified properties
378357 FLabel.Name := 'EmbeddedLabel';
379358 FLabel.Caption := 'Howdy World!';
380359
381360 // Make sure the embedded label can not be selected/deleted within the IDE
382361 FLabel.ControlStyle := FLabel.ControlStyle - [csNoDesignSelectable];
383362
384363 // Set other properties if necessary
385364 //...
386365
387366end;
388367```
389368
390369## Using custom paint procedure
391370
392371You can always subclass a component inside your program. For example, this implements a custom Paint procedure to a TLabel:
393372
394373``` pascal
395374type
396375 TMyLabel = class(TLabel)
397376 public
398377 procedure Paint; override;
399378 end;
400379{...}
401380implementation
402381{...}
403382procedure TMyLabel.Paint;
404383begin
405384 // your code to implement Paint, for example
406385 Canvas.TextOut(0,0,Caption);
407386end;
408387```
409388
410389Now you can create a MyLabel inside your program, at run time, with that overridden Paint procedure instead of the standard one.
411390
412391For most components, and for most methods, it would be recommendable to call inherited procedure iniside it:
413392
414393``` pascal
415394procedure TMyLabel.Paint;
416395begin
417396
418397 inherited Paint; /////////////////////
419398
420399 // your code to implement Paint, for example
421400 Canvas.TextOut(0,0,Caption);
422401end;
423402```
424403
425404But inherited behavior is not desirable in this case, since the second writing action would overlap the first (inherited) one.
426405
427406## IDE와 컴포넌트를 통합
428407
429408### Property Editors
430409
431410Property 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.
432411
433412``` pascal
434413 TPropertyEditor = class
435414 public
436415 function AllEqual: Boolean; Virtual;
437416 function AutoFill: Boolean; Virtual;
438417 procedure Edit; Virtual; // Activated by double-clicking the property value
439418 procedure ShowValue; Virtual; // Activated by control-clicking the property value
440419 function GetAttributes: TPropertyAttributes; Virtual;
441420 function GetEditLimit: Integer; Virtual;
442421 function GetName: ShortString; Virtual;
443422 procedure GetProperties(Proc: TGetPropEditProc); Virtual;
444423 function GetHint(HintType: TPropEditHint; x, y: integer): String; Virtual;
445424 function GetDefaultValue: AnsiString; Virtual;
446425 procedure GetValues(Proc: TGetStrProc); Virtual;
447426 procedure SetValue(const NewValue: AnsiString); Virtual;
448427 procedure UpdateSubProperties; Virtual;
449428 function SubPropertiesNeedsUpdate: Boolean; Virtual;
450429 function IsDefaultValue: Boolean; Virtual;
451430 function IsNotDefaultValue: Boolean; Virtual;
452431 // ... shortened
453432 end;
454433```
455434
456435A good example for a property editor is the TFont property editor.
457436
458437One 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:
459438
460439``` pascal
461440TClassPropertyEditor = class(TPropertyEditor)
462441public
463442 constructor Create(Hook: TPropertyEditorHook; APropCount: Integer); Override;
464443 function GetAttributes: TPropertyAttributes; Override;
465444 procedure GetProperties(Proc: TGetPropEditProc); Override;
466445 function GetValue: AnsiString; Override;
467446 property SubPropsTypeFilter: TTypeKinds Read FSubPropsTypeFilter
468447 Write SetSubPropsTypeFilter
469448 Default tkAny;
470449end;
471450```
472451
473452Going 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:
474453
475454``` pascal
476455 TFontPropertyEditor = class(TClassPropertyEditor)
477456 public
478457 procedure Edit; Override;
479458 function GetAttributes: TPropertyAttributes; Override;
480459 end;
481460
482461procedure TFontPropertyEditor.Edit;
483462var
484463 FontDialog: TFontDialog;
485464begin
486465 FontDialog := TFontDialog.Create(NIL);
487466 try
488467 FontDialog.Font := TFont(GetObjectValue(TFont));
489468 FontDialog.Options := FontDialog.Options + [fdShowHelp, fdForceFontExist];
490469 if FontDialog.Execute then SetPtrValue(FontDialog.Font);
491470 finally
492471 FontDialog.Free;
493472 end;
494473end;
495474
496475function TFontPropertyEditor.GetAttributes: TPropertyAttributes;
497476begin
498477 Result := [paMultiSelect, paSubProperties, paDialog, paReadOnly];
499478end;
500479```
501480
502481### 컴포넌트 에디터
503482
504483Component 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:
505484
506485``` pascal
507486 TBaseComponentEditor = class
508487 protected
509488 public
510489 constructor Create(AComponent: TComponent;
511490 ADesigner: TComponentEditorDesigner); Virtual;
512491 procedure Edit; Virtual; Abstract;
513492 procedure ExecuteVerb(Index: Integer); Virtual; Abstract;
514493 function GetVerb(Index: Integer): String; Virtual; Abstract;
515494 function GetVerbCount: Integer; Virtual; Abstract;
516495 procedure PrepareItem(Index: Integer; const AnItem: TMenuItem); Virtual; Abstract;
517496 procedure Copy; Virtual; Abstract;
518497 function IsInInlined: Boolean; Virtual; Abstract;
519498 function GetComponent: TComponent; Virtual; Abstract;
520499 function GetDesigner: TComponentEditorDesigner; Virtual; Abstract;
521500 function GetHook(out Hook: TPropertyEditorHook): Boolean; Virtual; Abstract;
522501 procedure Modified; Virtual; Abstract;
523502 end;
524503```
525504
526505The 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.
527506
528507Other 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.
529508
530509A 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:
531510
532511``` pascal
533512 TCheckListBoxComponentEditor = class(TComponentEditor)
534513 protected
535514 procedure DoShowEditor;
536515 public
537516 procedure ExecuteVerb(Index: Integer); override;
538517 function GetVerb(Index: Integer): String; override;
539518 function GetVerbCount: Integer; override;
540519 end;
541520
542521procedure TCheckGroupComponentEditor.DoShowEditor;
543522var
544523 Dlg: TCheckGroupEditorDlg;
545524begin
546525 Dlg := TCheckGroupEditorDlg.Create(NIL);
547526 try
548527 // .. shortened
549528 Dlg.ShowModal;
550529 // .. shortened
551530 finally
552531 Dlg.Free;
553532 end;
554533end;
555534
556535procedure TCheckGroupComponentEditor.ExecuteVerb(Index: Integer);
557536begin
558537 case Index of
559538 0: DoShowEditor;
560539 end;
561540end;
562541
563542function TCheckGroupComponentEditor.GetVerb(Index: Integer): String;
564543begin
565544 Result := 'CheckBox Editor...';
566545end;
567546
568547function TCheckGroupComponentEditor.GetVerbCount: Integer;
569548begin
570549 Result := 1;
571550end;
572551```
573552
574553## 같이 보기
575554
576555- [[Extending the IDE]]
577556- [[Lazarus Packages]] - A guide for creating a package under Lazarus
578557- [[Components and Code examples]]
579558- [[Lazarus Components]]
580559- [[IDE Window: Add to Package]]
581560
582561You can post questions regarding this page [here](http://forum.lazarus.freepascal.org/index.php/topic,5789.0.html)
583562
584563---
585564*From the Free Pascal wiki, page "How To Write Lazarus Component/ko", 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