The implementation of the TTabControl seems to cause headaches, and reveals wrong…
Hans-Peter Diettrich wroteIMO we should accept that a Delphi compatible TTabControl doesn't exist yet, for widgetsets other than Win32. What can/should we do, when it turns out that such a control can not be implemented in all widgetsets?
I bet that it can be implemented in all widgetsets. I don't use TTabControl, so I could be wrong, but I think that you could implement it like this in Gtk2:
gtk_widget
->gtk_notebook
->gtk_widget
3 widgets put together. This should work fine if you can make gtk_notebook show only the tabs without a client area.
Another idea: Override all methods which use WS routines and create a handle for TCustomControl instead and custom draw the entire control.
Show quoted text 5 lines
We cannot have a control in the LCL which works in only 1 platform, if it is really like that, then the current implementation is better.
And since the old TTabControl and TNotebook effectively share the same code, except for the control that shows the tabs, it would be a good idea to merge both into a common base class.
A very bad idea, they are not even located in the same unit... plus their class hierarchy is not even remotely similar. In fact, I don't see anything common between them. TNotebook many pages and no tabs and no border. TTabControl has 1 page, has border and has tabs.
Making unrelated stuff together because they look similar from a first view to save code duplication can bring a heavy penalty in terms of code stability and maintenability. Just think that someone tryes in the future to fix TTabControl and by accident breaks TNotebook... This lesson was learned with the gtk1/gtk2 mess.
In fact, I already predict that even sharing code between TTabControl and TPageControl is a huge risk, changes could break TPageControl. The safest would be starting a new WS object for TTabControl ...
Show quoted text 6 lines
Why *only* in bold. TCustomTabControl has only 2 descendents, so TPageControl is 50% of it's descendents.
