[Lazarus] TTabControl reverted to it's old implementation

Graeme Geldenhuys graemeg.lists at gmail.com
Wed Jul 27 09:58:13 CEST 2011


On 07/27/2011 09:03 AM, Felipe Monteiro de Carvalho wrote:
> 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.

And I believe that to be a bug in Delphi. See attachment: tabcontrol.png

Dropping a Memo onto TTabControl is indeed possible, but look at the
outcome! Components can be moved _over_ the tabs. Such behaviour should
not be allowed. Yet when you set the Memo1.Align := alClient, then in
maximizes the memo to fit underneath the tabs. This is very conflicting
behaviour - thus the reason why I think that component is rather dodgy
in behaviour.

Then again I have no idea where you guys draw the line on
Delphi-compatibility. Do you implement Delphi bugs in LCL too?

Use a tool like MWSnap 3's "window information" feature. This allows you
to move the mouse over applications (even better if they are Delphi
apps) and it tells you the components used, and outlines the component
bounds. I did this on Delphi 7 for you. See attachment of MWSnap Window
Information used on Delphi's Object Inspector window. I believe
TXTabControl to be a descendant of TTabControl (I remember having a tool
to query that as well). Note the bounds of the tab control - they do not
cover the grid in the Object Inspector. Many other applications apply
the same principle.

>> 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.

You are correct about TNotebook, but I was thinking of the
TTabbedNotebook as can bee seen in Delphi 7.  Then again, having a
Notebook, TabbedNotebook, PageControl, TabControl etc. is just damn
confusing to developers. Borland clearly had no idea what they were
trying to achieve with all those variations. Not to mention that
TNotebook and TTabbedNotebook are not related at all, if you look and
there class hierarchy.


> 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 have done similar in my Delphi 7 days with a simple TPanel and many
TFrame descendants.


> 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 simplified this whole tab/notebook mess in fpGUI. I have one
PageControl component. It's tabs can possitioned at the top, bottom,
left or right, or even show no tabs. Future improvents will be to change
the tab style to Tabs, Buttons, Flat Buttons etc. You really don't need
5 components as is done in Delphi. Even Borland noticed that, because
Delphi 7 CLX or Kylix has limited it to two components only.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tabcontrol.png
Type: image/png
Size: 511 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110727/09195695/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: delpi_object_inspector.png
Type: image/png
Size: 4290 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110727/09195695/attachment-0007.png>


More information about the Lazarus mailing list