[Lazarus] TCustomNotebook

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Tue Jul 5 10:36:31 CEST 2011


On Tue, Jul 5, 2011 at 3:05 AM, Hans-Peter Diettrich
<DrDiettrich1 at aol.com> wrote:
> Unfortunately I cannot provide my solution right now, due to your move of
> TCustomNotebook etc. into ComCtrls. Before I do more superfluous work, can
> you please specify how I should proceed:
>
> Should I retain T[Custom]TabControl as is, and add another flyweight TTabs
> control,
> or should I replace the old implementation by the new one?

I think you should do it like this:

General concepts:
1> Avoid changing the current TPageControl as much as possible,
because it is extensively used and changes here might cause a pletora
of problems
2> I think it is no problem to introduce heavy changes to TTabControl
because it is rarely used
3> Use exactly the same class hierarchy as Delphi:

TCustomNotebook (in Delphi called TCustomTabControl)
--> TPageControl
--> TTabControl

However I would do one thing differently from your idea: Let
TCustomTabControl still have a notion of pages so that it can fully
implement TPageControl, but allow it to be able to display tabs
without pages too. Hide page properties and let TPageControl increase
their visibility.

Just because this hard distinction of a control with pages and one
without makes sense in Windows it doesn't mean at all that it makes
sense in all widgetsets. Plus, just 1 implementation is better then 2
spread across various classes for the widgetset interfaces.

And I would make smaller patches implementing the following actions:

1> Make sure TCustomNotebook can implement TTabControl, add an option
that it can work without tabs and test in all widgetsets (maybe it can
already do that, you would need to check this)
2> Change TTabControl to inherit from TCustomNotebook
3> Fix all problems found in the new TTabControl
4> Remove the current completely wrong class TCustomTabControl
5> Rename TCustomNotebok to TCustomTabControl, remove all
implementations relative to it in widgetsets

Also give some time so that other developers can say if they have a
different oppinion on that.

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list