Sign in Join
Wiki copytemporary

Lazarus For Delphi Users/ko: what changed

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

OldNewLine
11이 문서는 라자루스에 흥미를 가지는 델파이 유저를 위한 것입니다. 이문서는 둘 사이의 차이점에 대해 설명합니다.
22
33## 델파이 -\> 라자루스
44
55Lazarus is an Rapid Application Development (RAD) tool like Delphi. That means it comes with a visual component library and an IDE. The Lazarus component library (LCL) is very similar to Delphi's VCL. Most units, classes and properties have the same name and functionality. This makes porting easy. But Lazarus is *not* an 'open source Delphi clone'. So don't expect 100% compatibility.
66
77### 큰 차이점
88
99Lazarus is completely open source, is written platform independent and uses the mighty [[Free Pascal]] compiler (FPC). FPC runs on more than 15 platforms. But not all packages and libs are ported, so Lazarus currently runs on Linux (i386, x86_64), FreeBSD (i386), Mac OS X (powerpc, i386) and Windows (i386, x86_64).
1010
1111**리자루스는 완전하지 않지만 그러기 위해서 이문서를 꾸준히 향상시킨다. 우리는 항상 새로운 개발자들, 패키지제작자들, 이식자들, 문서작성자들... 을 위해 검색한다.**
1212
1313### 첫번째 언제 델파이 프로젝트를 컨버팅 할지 생각하는 것입니다.
1414
1515Having opened Lazarus, you should go to to **Tools** and then **Convert Delphi Project to Lazarus Project**. This won't do everything for you, but nonetheless will take you a good deal of the way. Note that the Lazarus IDE's conversion tools are generally one-way conversions. If you need to retain Delphi compatibility so you can compile your project with both Delphi and Lazarus, consider converting your files with the [XDev Toolkit](http://wiki.lazarus.freepascal.org/XDev_Toolkit) instead.
1616
1717### 유니코드 지원
1818
1919델파이 2007버전 전까지는 유니코드를 지원하지 못했습니다, 그래서 윈도우 ANSI encoding을 사용했습니다.
2020
2121델파이 2009버전에서는 UTF-16 문자열을 지원합니다.
2222
2323라자루스는 온전히 유니코드를 지원하고 UTF-8 문자열을 사용합니다. 더 자세한 정보는 [[LCL Unicode Support|LCL Unicode Support를]] 참조하세요.
2424
2525## Delphi IDE -\> Lazarus IDE
2626
2727### 프로젝트들
2828
2929The main file of a Delphi application is the .dpr file. The main file of a Lazarus project is the .lpi file (Lazarus Project Information). A .dpr file is the program main source and the Delphi IDE stores some information about the compiler switches and units. A Lazarus application also has a .lpr file, which is also the main source file. But all other information is stored in the .lpi file. So, the important file is the .lpi file.
3030
3131For example:
3232
3333Delphi stores the paths of the units in the .dpr file. For instance: unit1 in 'path/Unit1.pas'. These 'in' paths are Delphi specific and are not read by the Lazarus IDE. Don't use them. Use instead the compiler options unit paths.
3434
3535Delphi stores compiler options in the .dpr file. For instance {\$APPTYPE CONSOLE}. These are ignored by the Lazarus IDE. Don't use them. Use instead the compiler options.
3636
3737One important rule: There is *always* a project. The only way to "close" a project is to exit lazarus or open another project. This is because a lazarus project is also a "session". This means, the current editor settings are also stored in the .lpi file and are restored when you reopen the project. For example: You are debugging an application, set a lot of breakpoints and bookmarks. You can save the project at any time, close lazarus or open another project. When you reopen the project, even on another computer, all your breakpoints, bookmarks, open files, cursor positions, jump history, ... are restored.
3838
3939### 소스 에디터
4040
4141Nearly all keys and short cuts can be defined in Tools -\> Options -\> Editor -\> Key Mappings
4242
4343The Lazarus IDE has a lot of tools for sources. Many of them look and work very similar to Delphi. But there is one important difference: Lazarus does not use the compiler to get code information. It parses the sources directly. This has a lot of important advantages:
4444
4545The source editor works with "comments". For Delphi the comments in the source are just space between code. No code feature works there and when new code is auto inserted, your comments will travel. Under Lazarus you can do a find declaration even on code in comments. Although this is not completely reliable, it often works. And when new code is inserted, the IDE uses some heuristics to keep comment and code together. For example: It will not split the line "c: char; // comment".
4646
4747Delphi's "Code Completion" (Ctrl+Space) is called "Identifier Completion" under Lazarus. The Lazarus term "Code Completion" is a feature, combining "Automatic Class Completion" (same as under Delphi), "Local Variable Completion" and "Event Assignment Completion". All of them are invoked by Ctrl+Shift+C and the IDE determines by the cursor position, what is meant.
4848
4949#### 지역변수 완성 예제
5050
5151"i:=3;"지역변수 완성을 단지 새로운 메소드를 생성 과 작성을 위해서
5252
5353``` pascal
5454procedure TForm1.DoSomething;
5555begin
5656 i := 3;
5757end;
5858```
5959
6060"i" 뒤에 커서를 이동한 뒤 `Ctrl`+`Shift`+`C` 누름:
6161
6262``` pascal
6363procedure TForm1.DoSomething;
6464var i: Integer;
6565begin
6666 i := 3;
6767end;
6868```
6969
7070#### 이벤트 할당 완성 예
7171
7272A nice feature of the object inspector is to auto create methods. You can get the source editor to create the events too.\
7373예시:
7474
7575``` pascal
7676Button1.OnClick:=
7777```
7878
7979":=" 뒤로 커서를 이동 한 뒤 `Ctrl`+`Shift`+`C` 누름.
8080
8181#### 프로시저 호출 완성 예
8282
8383Assume you just wrote the statement "DoSomething(Width);"
8484
8585``` pascal
8686procedure SomeProcedure;
8787var
8888 Width: integer;
8989begin
9090 Width:=3;
9191 DoSomething(Width);
9292end;
9393```
9494
9595"DoSomething" 뒤 커서 이동후 `Ctrl`+`Shift`+`C` 누름
9696
9797``` pascal
9898procedure DoSomething(aWidth: LongInt);
9999begin
100100
101101end;
102102
103103procedure SomeProcedure;
104104var
105105 Width: integer;
106106begin
107107 Width:=3;
108108 DoSomething(Width);
109109end;
110110```
111111
112112#### "Word Completion" Ctrl+W
113113
114114It works similar to the "Identifier Completion", but it does not work on pascal identifiers, but on all words. It lets you choose of all words in all open files beginning with the same letters.
115115
116116#### 인크루드 파일들의 지원
117117
118118Delphi didn't support them, and so you probably haven't created many include files yet. But include files have a big advantage: They make it possible writing platform (in)dependent code without messing your code with IFDEFs. For example: Method jumping, Class Completion, find declaration, .. all work with include files.
119119
120120There are many options for the code features.
121121
122122### 디자이너
123123
124124\- Guidelines
125125
126126#### 오브젝트 인스펙터
127127
128128In the Delphi and Lazarus IDE's the Object Inspector is used to edit component properties and assign events etc. The following are a few minor differences to note in use :
129129
1301301. Starting in Delphi 5 there is an Object Treeview which can be used to navigate and select objects according to hierarchy in addition to the traditional drop down list in the Object Inspector. In Lazarus this is part of the Object Inspector and is used in place of the default drop-down, you can select to use/not use it from the right click menu with "Show Component Tree"
1311312. In Delphi double clicking on a blank event will auto create one and open the Source Editor to that position, in Lazarus there is a button to the right of the selected drop-down which performs this action instead.
1321323. In Delphi you must manually delete the name of an event in the edit to remove the attatchement, in Lazarus you can drop down and select "(None)".
1331334. Similarly to Events, double clicking regular properties such as boolean will not change the value, you must select it from a drop down. And to open those with an assigned editor form, you must click the '...' button to the right of the edit/drop-down
134134
135135#### 패키지
136136
137137리자루스 설치 후 델파이 패키지를 사용 할수 있나요?
138138
139139아니요, 왜냐하면 그것들은 델파이 컴파일러를 요구하기때문입니다.
140140
141141우리는 특별히 리자루스를 위해 만들어진 것들을 필요합니까?
142142
143143Yes. Create a new package, save it in the package source directory (normally same directory of the .dpk file), add the LCL as required package and finally add the .pas files. You can install it, or use it in your projects now. There are some differences between Lazarus and Delphi packages, so please read
144144
145145\- 문서 / 라자루스 소스에 Packages.txt을 참조하십시오.
146146
147147### VCL -\> LCL
148148
149149While the VCL and the LCL both serve much of the same purpose - of an Object Oriented Component Hierarchy especially geared toward rapid application development, they are not identical. For instance while the VCL provides many non-visual components, the LCL tries to only provide visual, while most non-visual components (such as db access) are provided by the FCL, included with [[Free Pascal]] .
150150
151151Additionally many controls may not exist in the LCL that are in the VCL, or vice versa, or even when controls do exist in both, they are not clones, and changes must be made in applications, components and controls if porting.
152152
153153The following is an attempt to provide fairly complete descriptions of major differences or incompatiblities between the two for the Delphi user. It covers differences primarily with the VCL of D4 especially, though at times D5, D6, or D7 as well; and with the current LCL, as is in CVS. As such it may not always be accurate to the version of Delphi you are used to, or completely match the current LCL you have. If you see inacuracies between the following and the LCL as in CVS, or your Delphi feel free to append and modify so as to keep this as comprehensive as possible for all people.
154154
155155#### TControl.Font/TControl.ParentFont
156156
157157In the VCL it is quite common and normal to use a specific font name and font properties such as bold and italics for controls, and expect this value to always be followed. Further is provided the TControl.ParentFont property which ensures that a control will always follow its parent's font. Again the implicit assumption being that these values will always be followed, even regardless of Windows Apearance Settings.
158158
159159This is not always true in the LCL, nor can it be. The LCL being cross-platform/cross-interface in nature prefers to take a balanced aproach, and instead will always try to use native Desktop/Toolkit Apearance or Theme settings on any widgets. For example if using a GTK interface, and the gtk theme supplies a specific font for buttons, then LCL buttons will always try to use this font.
160160
161161This means that most LCL controls do not have the same level of design control that is often expected in the VCL, rather only those custom controls which are Canvas drawn instead of interface allocated can consistantly be modified in this manner regardless of the Interface used.
162162
163163#### Control Dragging/Docking
164164
165165In the VCL most (Win)Controls implement methods and callback functions for handling dragging and docking of controls, eg. dragging a control from one panel, and docking it onto another panel at run time.
166166
167167This functionality is currently unimplemented/unfinished in the LCL, though it is currently in the initial stages of planning, and should eventually support some level of compatibility for this type of behavior, if not in the exact same manner.
168168
169169This currently means that no Control will inherit/use the following TControl functions, procedures, properties, or events -
170170
171171``` pascal
172172Protected
173173 function GetDockEdge(MousePos: TPoint): TAlign;
174174 function GetDragImages: TDragImageList;
175175 function GetFloating: Boolean;
176176 function GetFloatingDockSiteClass: TWinControlClass;
177177 procedure DoEndDrag(Target:TObject); X, Y: Integer);
178178 procedure DockTrackNoTarget(Source: TDragDockObject; X, Y: Integer);
179179 procedure DoEndDock(Target: TObject; X, Y: Integer);
180180 procedure DoDock(NewDockSite: TWinControl; var ARect: TRect);
181181 procedure DoStartDock(var DragObject: TDragObject);
182182 procedure DragCanceled;
183183 procedure DragOver(Source: TObject; X, Y: Integer; State: TDragState;
184184 var Accept: Boolean);
185185 procedure DoEndDrag(Target: TObject; X, Y: Integer);
186186 procedure DoStartDrag(var DragObject: TDragObject);
187187 procedure DrawDragDockImage(DragDockObject: TDragDockObject);
188188 procedure EraseDragDockImage(DragDockObject: TDragDockObject);
189189 procedure PositionDockRect(DragDockObject: TDragDockObject);
190190 procedure SetDragMode(Value: TDragMode);
191191 property DragKind: TDragKind;
192192 property DragCursor: TCursor;
193193 property DragMode: TDragMode;
194194 property OnDragDrop: TDragDropEvent;
195195 property OnDragOver: TDragOverEvent;
196196 property OnEndDock: TEndDragEvent;
197197 property OnEndDrag: TEndDragEvent;
198198 property OnStartDock: TStartDockEvent;
199199 property OnStartDrag: TStartDragEvent;
200200public
201201 function Dragging: Boolean;
202202 function ManualDock(NewDockSite: TWinControl; DropControl: TControl;
203203 ControlSide: TAlign): Boolean;
204204 function ManualFloat(ScreenPos: TRect): Boolean;
205205 function ReplaceDockedControl(Control: TControl; NewDockSite: TWinControl;
206206 DropControl: TControl; ControlSide: TAlign): Boolean;
207207 procedure BeginDrag(Immediate: Boolean; Threshold: Integer);
208208 procedure Dock(NewDockSite: TWinControl; ARect: TRect);
209209 procedure DragDrop(Source: TObject; X, Y: Integer);
210210 procedure EndDrag(Drop: Boolean);
211211 property DockOrientation: TDockOrientation;
212212 property Floating: Boolean;
213213 property FloatingDockSiteClass: TWinControlClass;
214214 property HostDockSite: TWinControl;
215215 property LRDockWidth: Integer;
216216 property TBDockHeight: Integer;
217217 property UndockHeight: Integer;
218218 property UndockWidth: Integer;
219219```
220220
221221that the following classes do not exist/are unusable -
222222
223223``` pascal
224224TDragImageList = class(TCustomImageList)
225225TDockZone = class
226226TDockTree = class(TInterfacedObject, IDockManager)
227227TDragObject = class(TObject)
228228TBaseDragControlObject = class(TDragObject)
229229TDragControlObject = class(TBaseDragControlObject)
230230TDragDockObject = class(TBaseDragControlObject)
231231```
232232
233233and that the following functions are also unusable/incompatible -
234234
235235``` pascal
236236function FindDragTarget(const Pos: TPoint;
237237 AllowDisabled: Boolean) : TControl;
238238procedure CancelDrag;
239239function IsDragObject(sender: TObject): Boolean;
240240```
241241
242242도킹 매니져의 설명은 여기에: [[Anchor Docking]]
243243
244244#### TEdit/TCustomEdit
245245
246246The Edit controls, while functioning essentialy the same in the LCL as the VCL, do have some issues to be aware of in converting -
247247
2482481. Due to restrictions in the Interfaces, TEdit.PasswordChar does not work in all interfaces yet(though in time it may), instead TCustomEdit.EchoMode emPassword should be used in the event text needs to be hidden.
2492492. On Drag/Dock Events are not yet implemented. For more information please see earlier section on Control Dragging/Docking.
2502503. Font Properties are usually ignored for interface consistancy, for detailed explanation as too why please see TControl.Font/TControl.ParentFont
251251
252252#### TDBImage
253253
254254Delphi and Lazarus both have a TDBImage control that shows images stored in a database field. However, Lazarus stores information about the image type in the database field before the actual image data. See procedure *TDBImage.UpdateData* This means that the Delphi and Lazarus implementations are not compatible.
255255
256256Note: current (r40924, April 2013) Lazarus trunk has implemented changes that allow Delphi compatible behaviour. Please see [[Lazarus 1.2.0 release notes|Lazarus_1.2.0_release_notes#TDBImage]] for details.
257257
258258### (optional) TSplitter -\> TPairSplitter
259259
260260**Please Improve Me**
261261
262262There is now a TSplitter control in the LCL, so no need to convert it.
263263
264264Nevertheless, if you want, here it is explained:
265265
266266The following is loosely based on questions by Vincent Snijders on the mailing list, and responses by [Andrew Johnson](http://lazarus-ccr.sourceforge.net/index.php?wiki=AndrewJohnson):
267267
268268In the VCL, "Splitting" controls, that is a handle which can be dragged between two components to give one more or less space then the other, is accomplished by a TSplitter. This is often seen, for instance in the Delphi IDE between the docked Code Explorer and Source Viewer.
269269
270270The LCL provides its own Control called a TPairSplitter, which serves the same type of purpose, however it is not compatible, so "repairing" broken VCL code or Delphi DFM's will be necessary in the event of porting code, even though much is shared in common between the two.
271271
272272So what exactly are the differences?
273273
274274Well the biggest differences are a VCL TSplitter has no children, instead it is placed between two controls aligned properly, and allows resizing between them at runtime, regardless its own size. It must have two controls aligned on each side to do anything. A simple example would be form with a Left Aligned Panel, a left aligned Splitter, and a second client aligned panel. On run time you could then realign the size given each panel by dragging on the handle provided by this Splitter control.
275275
276276On the LCL hand however, a TPairSplitter is a special kind of control, with two panels, and it can only be usefull if the controls to split are on these panels, but it will still perform a split between those panel whether or not anything is on them. So following the prior example, you would have a form with a TPairSplitter aligned client, and a panel aligned client on its left side, and a panel aligned client on its right side.
277277
278278The other important difference is that in the VCl, since the TSplitter is its own TControl, then the position is kept relative to the other controls on resize, so for instance a client panel will grow while the other panels will not, thus the split position is relative to the alignment of the split controls,
279279
280280In the LCL since the side panels are separate then the TPairSplitter has a Position property which is absolute relative to top or left. so on resize the actual position does not change according to contents, so a callback must be set to ensure the ratio is kept on resize if this is important.
281281
282282For example if the Right side of a vertical split needs to have alClient like behaviour, you need to add a form resize callback which does something like :
283283
284-`PairSplitter.Position := PairSplitter.Width - PairSplitter.Position; `
284+``` pascal
285+PairSplitter.Position := PairSplitter.Width - PairSplitter.Position;
286+```
285287
286288So how can I convert existing code using TSplitter to the TPairSplitter?
287289
288290If the splitter and controls are created within an actual function(like form oncreate), conversion shouldn't be too difficult, primarily reorganize the code to create the controls in order of new hierarchy and set the parents of the child controls to split to the left/top and right/bottom portions of the PairSplitter. An example of the changes being -
289291
290292**VCL**
291293
292294**LCL**
293295
294296``` pascal
295297var
296298 BottomPanel: TPanel;
297299 VerticalSplitter: TSplitter;
298300 LeftPanel: TPanel;
299301 HorizontalSplitter: TSplitter;
300302 MainPanel: TPanel;
301303
302304begin
303305 BottomPanel:= TPanel.Create(Self);
304306 with (BottomPanel) do
305307 begin
306308 Parent:= Self;
307309 Height:= 75;
308310 Align:= alBottom;
309311 end;
310312
311313 VerticalSplitter:= TSplitter.Create(Self);
312314 with (VerticalSplitter) do
313315 begin
314316 Parent:= Self;
315317 Align:= alBottom;
316318 end;
317319
318320 HorizontalSplitter:= TSplitter.Create(Self);
319321 with (HorizontalSplitter) do
320322 begin
321323 Parent:= Self;
322324 align:= alLeft;
323325 end;
324326
325327 LeftPanel:= TPanel.Create(Self);
326328 with (LeftPanel) do
327329 begin
328330 Parent:= Self;
329331 Width:= 125;
330332 Align:= alLeft;
331333 end;
332334
333335 MainPanel:= TPanel.Create(Self);
334336 with (MainPanel) do
335337 begin
336338 Parent:= Self;
337339 Align:= alClient;
338340 Caption:= 'Hello';
339341 end;
340342end;
341343```
342344
343345``` pascal
344346var
345347 BottomPanel: TPanel;
346348 VerticalSplitter: TPairSplitter;
347349 LeftPanel: TPanel;
348350 HorizontalSplitter: TPairSplitter;
349351 MainPanel: TPanel;
350352
351353begin
352354 VerticalSplitter:= TPairSplitter.Create(Self);
353355 with (VerticalSplitter) do
354356 begin
355357 Parent:= Self;
356358 Align:= alClient;
357359 Width:= Self.Width;
358360 Height:= Self.Height;
359361 SplitterType:= pstVertical;
360362 Position:= Height - 75;
361363 Sides[0].Width:= Width;
362364 Sides[0].Height:= Position;
363365 end;
364366
365367 HorizontalSplitter:= TPairSplitter.Create(Self);
366368 with (HorizontalSplitter) do
367369 begin
368370 Parent:= VerticalSplitter.Sides[0];
369371 Width:= Self.Width;
370372 Height:= VerticalSplitter.Position;
371373 align:= alClient;
372374 SplitterType:= pstHorizontal;
373375 Position:= 125;
374376 end;
375377
376378 LeftPanel:= TPanel.Create(Self);
377379 with (LeftPanel) do
378380 begin
379381 Parent:= HorizontalSplitter.Sides[0];
380382 Align:= alClient;
381383 end;
382384
383385 MainPanel:= TPanel.Create(Self);
384386 with (MainPanel) do
385387 begin
386388 Parent:= HorizontalSplitter.Sides[1];
387389 Align:= alClient;
388390 Caption:= 'Hello';
389391 end;
390392
391393 BottomPanel:= TPanel.Create(Self);
392394 with (BottomPanel) do
393395 begin
394396 Parent:= VerticalSplitter.Sides[1];
395397 Align:= alClient;
396398 end;
397399end;
398400```
399401
400402So as you can see, farely consistant with most control hierarchy. And if you are familiar with DFM's, the changes needed for DFM-\>LFM conversion should be farely obvious from the above, as they are the same sort of changes in Parent/Owner etc.
401403
402404So the above example would be something like -
403405
404406**Delphi DFM**
405407
406408**(extraneous values removed)**
407409
408410**Lazarus LFM**
409411
410412**(most width, height, etc. removed)**
411413
412-``` pascal
414+``` lfm
413415object VerticalSplitter: TSplitter
414416 Height = 3
415417 Cursor = crVSplit
416418 Align = alBottom
417419end
418420object HorizontalSplitter: TSplitter
419421 Width = 3
420422 Align = alLeft
421423end
422424object BottomPanel: TPanel
423425 Height = 75
424426 Align = alBottom
425427end
426428object LeftPanel: TPanel
427429 Width = 125
428430 Align = alLeft
429431end
430432object MainPanel: TPanel
431433 Align = alClient
432434end
433435```
434436
435-``` pascal
437+``` lfm
436438object VerticalSplitter: TPairSplitter
437439 Align = alClient
438440 SplitterType = pstVertical
439441 Position = 225
440442 Height = 300
441443 Width = 400
442444 object Pairsplitterside1: TPairSplitterIde
443445 object HorizontalSplitter: TPairSplitter
444446 Align = alClient
445447 Position = 125
446448 object Pairsplitterside3: TPairSplitterIde
447449 Width = 125
448450 object LeftPanel: TPanel
449451 Align = alClient
450452 Width = 125
451453 end
452454 end
453455 object Pairsplitterside4: TPairSplitterIde
454456 object MainPanel: TPanel
455457 Align = alClient
456458 end
457459 end
458460 end
459461 end
460462 object Pairsplitterside2: TPairSplitterIde
461463 object BottomPanel: TPanel
462464 Align = alClient
463465 Height = 75
464466 end
465467 end
466468end
467469```
468470
469471### TCustomTreeView/TTreeView
470472
471473Both VCL and the LCL provide a TCustomTreeView/TTreeView component, used for tree structured lists of data with multiple nodes and advanced selection and Image lists, and while actual features are comparable, not all properties are entirely compatible. Primary differences are as follows -
472474
473475**Incomplete list, also update to include TCustomTreeView Mark functions and protected methods**
474476
4754771. The LCL provides a TCustomTreeView.Options, a set of options which can be set on the control to change its behaviour and apearance. These options are :
476478 - tvoAllowMultiselect - enables multi node select mode, equivalent to enabling TCustomTreeView.MultiSelect in the D6 VCL
477479 - tvoAutoExpand - Auto Expand nodes, equivalent to enabling TCustomTreeView.AutoExpand
478480 - tvoAutoInsertMark - Update the Drag preview on mouse move.
479481 - tvoAutoItemHeight - Adjust the item heights automatically.
480482 - tvoHideSelection - Do not mark the selected item.
481483 - tvoHotTrack - use Hot Tracking, equivalent to enabling TCustomTreeview.HotTrack
482484 - tvoKeepCollapsedNodes - When shrinking/folding nodes, keep the child nodes
483485 - tvoReadOnly - make Treeview read only, equivalent to enabling TCustomTreeview.ReadOnly
484486 - tvoRightClickSelect - allow using Mouse Right Clicks to select nodes, equivalent to enabling TCustomTreeView.RightClickSelect
485487 - tvoRowSelect - allow selecting rows, equivalent to enabling TCustomTreeView.RowSelect
486488 - tvoShowButtons - show buttons, equivalent to enabling TCustomTreeView.ShowButtons
487489 - tvoShowLines - show node lines, equivalent to enabling TCustomTreeView.ShowLines
488490 - tvoShowRoot - show root note, equivalent to enabling TCustomTreeView.ShowRoot
489491 - tvoShowSeparators - show seperators
490492 - tvoToolTips - show tooltips for individual nodes
4914932. The LCL provides additional properties:
492494 - TCustomTreeView.OnSelectionChange event
493495 - TCustomTreeView.DefaultItems, for the default number of Items
494496 - TCustomTreeView.ExpandSignType to determine sign used on expandable/collapsible nodes
4954973. While most On Drag/Dock Events are available in the LCL they do not work. For more information please see earlier section on Control Dragging/Docking.
496498
497499### Messages / Events
498500
499501The order and frequency of messages and events (OnShow, OnActivate, OnEnter, ...) differ from the VCL and depend on the [[Widgetset|widgetset]]. The LCL provides a subset of WinAPI like messages to make porting of Delphi components easier, but almost all LCL messages work a little bit different than the VCL/WinAPI counterpart. The biggest part of Delphi code using WinAPI messages uses them, because the VCL lacks a feature or for speed reasons. Such things will seldom work the same under the LCL, so they must be checked manually. That's why LCL messages are called for example LM_SIZE instead of WM_SIZE (unit lmessages).
500502
501503**Note on handling of custom messages!** As of version 0.9.26 (December 2008), way of handling custom WinApi messages (e.g. WM_HOTKEY, WM_SYSCOMMAND) differs from the way of handling these messages in Delphi. At the moment you cannot handle them via **message** directive or via overriding of *WndProc* method of the form. The only way to handle them in the form is to hook Windows *windowproc* by yourself. Read more here: [[Win32/64 Interface|Processing non-user messages in your window]]
502504
503505## See Also
504506
505507- [[Code Conversion Guide|Code Conversion Guide (from Delphi & Kylix)]]
506508- [[Compile With Delphi]]
507509
508510---
509511*From the Free Pascal wiki, page "Lazarus For Delphi Users/ko", as it stood on 2020-02-18 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