Talk:LCL Internals

From Lazarus wiki
Jump to navigationJump to search

The trayintf.pas unit is not too well explained. If I read this document correctly, it is suposed to be the counterpart of the interfaces unit from the LCL. In this case, I don't think it is necessary to have such a unit, since the registering of the TWSXXXTrayIcon class does all that is needed. (I am not completely sure though) Vincent 19:34, 22 Dec 2005 (CET)

We can change it then. The example is suposed to be very simple and show how the LCL chooses different widgets without IFDEFS. Any work on it will help. --Sekelsenmat 20:37, 22 Dec 2005 (CET)
On the LCL all those files would be used. wstrayicon would even be on a extra /widgetset/ directory. --Sekelsenmat 14:19, 26 Dec 2005 (CET)
the trayintf.pas file is only needed if you need "flat" (non object) calls to some widgetset functions defined in the TxxxWidgetset object. It is at the same level as the winapi files. --Marc 10:50, 12 October 2006 (CEST)

Some remarks

  • TQtWidgetSet = Class(TWidgetSet):

In the example of the declaration for TQtWidgetSet, the following functions might be removed in the future:

 procedure SetDesigning(AComponent: TComponent); override;
 function CreateComponent(Sender : TObject): THandle; override; // deprecated
 function CreateTimer(Interval: integer; TimerFunc: TFNTimerProc): integer; override;
 function DestroyTimer(TimerHandle: integer): boolean; override;
  • TQtWSWinControl.ShowHide:

Please add the next line as first for every TxxxWSyyy.SomeProcUsingAWincontrolHandle

 if not WSCheckHandleAllocated(AWincontrol, 'SomeProcUsingAWincontrolHandle')
 then Exit;
  • TQtWidgetSet.ShowWindow:

Functions like this might move to corntol implementation itself -> TxxxWSControl.Show

  • gtkwstrayicon.pas

If needed, someone may want to link a private internal class to a WSwidget, like:

 RegisterWSComponent(TCustomTrayIcon, TGtkWSTrayIcon, TGtkWSTrayIconPrivate)

This private class can have its own (true) inheritence, and it will propagate to all "derived" TxxxWSyyy classes

--Marc 10:39, 12 October 2006 (CEST)


  • The section about Adding a new unit to the LCL looks outdated.

--Bart (talk) 22:59, 22 October 2017 (CEST)