[Lazarus] TTabControl reverted to it's old implementation

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed Jul 27 09:03:09 CEST 2011


On Wed, Jul 27, 2011 at 8:41 AM, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:
> TabControl - this just paints the "tabs" part, and presents the
>             developer with a OnTabChange event. There is NO "body",
>             "panel" or "page" with this component. So there is no
>             place to add components per tab.

That's what I though initially, but it is wrong. In Delphi this
control allows other controls to be placed on it, so it effectively
has 1 sheet. Changing the tabs triggers OnTabChange but doesn't change
the visible sheet (since there is only 1 anyway)

> PageControl - is a component that has the "tabs" part and an associated
>              "page / panel" for each tab.

correct.

> NoteBook    - I have no idea what is the difference between this and
>              the PageControl. They seem the same to me. The only
>              difference I could see is how you add more tabs. One use
>              a string list property the other is a collection of
>              page objects (I think).

That's how it was implemented before I fixed it. The correct TNotebook
has no tabs, only sheets without any border. It can be used, for
example, to implement a "Assistent"-like screen without using multiple
forms. Click on a button and change the visible sheet for the whole
form.

I also use it in apps where you click on a button and then part of the
view changes to reflect which tool is selected.

I use the new and correct TNotebook quite a lot actually =)

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list