[Lazarus] TTabControl (d)evolution

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Sat Aug 6 08:36:48 CEST 2011


On Fri, Aug 5, 2011 at 7:27 PM, Hans-Peter Diettrich
<DrDiettrich1 at aol.com> wrote:
> I don't like endless work, when something gets into the way on other
> widgetsets. That's why I want you (or somebody else) prepare the widgetsets
> first, so that the remaining LCL code will work everywhere, once it has been
> made work.

My solution does not require any work in the widgetsets.

>> 1> Override the handle and create a TCustomControl handle
>
> I still don't understand the purpose of that procedure.

To make it uses WSCustomControl as it's widget, so the control can be
implemented like this:

TTabControl (WSCustomControl handle)
-> TPageControl over it's child area
-> child controls are put here, inside the TTabControl, but over the
TPageControl

>> 2> Put a TPageControl in the bottom of the control, redirect all
>> methods to work on it
>
> That's the old implementation, no need to reinvent the wheel.

The idea is to work only on TNewTabControl and only make the change
when it is finished.

The current implementation descends from TCustomControl, it needs to
be changed to descend from TCustomTabControl. Of course you can copy
it on top of the current TNewTabControl. But that's not as trivial as
it sounds, such a control will have a lot of inconsistensy because of
duplicate methods all over the place. This needs to be fixed.

>> 3> Make sure it is compatible with the current TTabControl
>
> I thought that we should make the old (current) implementation more Delphi
> compatible?

You can copy the old implementation on top of TNewTabControl, then
change the inheritance and then fix all the errors. That's one
solution. The other is to start clean in TNewTabControl and gradually
add code from TTabControl.

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list