Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-01

TNotebook vs TTabbedNotebook

10 messages · 6 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Shane Miller

I added two lines to TNOTEBOOK's creaate method. They are

tabposition := tpTOP;
showtabs := true;

Now, instead of using the tabnotbk.pp file and creating a TTabbedNotebook, I think we should start using extctrls.pp and create a TNotebook control. They both use TCustomNotebook and now both work exactly the same.

Shane

Reply by email

Curtis White
to Shane Miller

Shane,

In Delphi, the TNotebook component is one without tabs. This allows you to do things like a wizard. If the notebook has tabs, then you have to find another way to do wizards. That is why there is both the TNotebook and the TTabbedNotebook. They are similar, but the tabbed notebook actually shows the tabs. If they are the same, then there is no need for TTabbedNotebook. But then that is another place where we won't be compatible with Delphi. I think we should keep them the way they were. Otherwise, we need to come up with some sort of component that will allow people to create wizards and do things where they don't want tabs.

Curtis

Show quoted text 11 lines
I added two lines to TNOTEBOOK's creaate method. They are tabposition := tpTOP; showtabs := true; Now, instead of using the tabnotbk.pp file and creating a TTabbedNotebook, I think we should start using extctrls.pp and create a TNotebook control. They both use TCustomNotebook and now both work exactly the same. Shane

Reply by email

d0hb0y
to Shane Miller: I added two lines to TNOTEBOOK's creaate method. They are tabposition := tpTOP;…

Couldn't TNotebook be a subclass of TTabbedNotebook where the default value of "showtabs" was set to false? That way we get the best of both worlds I would think.

I suppose it could be reversed such that TNotebook is the base class and TTabbedNotebook is just TNotebook with showtabs set to true :)

== Ron

you wrote 36 lines
Shane, In Delphi, the TNotebook component is one without tabs. This allows you to do things like a wizard. If the notebook has tabs, then you have to find another way to do wizards. That is why there is both the TNotebook and the TTabbedNotebook. They are similar, but the tabbed notebook actually shows the tabs. If they are the same, then there is no need for TTabbedNotebook. But then that is another place where we won't be compatible with Delphi. I think we should keep them the way they were. Otherwise, we need to come up with some sort of component that will allow people to create wizards and do things where they don't want tabs. Curtis On 04-Jan-2000 Shane Miller wrote: > I added two lines to TNOTEBOOK's creaate method. They are > > tabposition := tpTOP; > showtabs := true; > > Now, instead of using the tabnotbk.pp file and creating a TTabbedNotebook, I > think we should start using extctrls.pp and create a TNotebook control. They > both use TCustomNotebook and now both work exactly the same. > > Shane > _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Marc Weustink
to Curtis White: True. But they can still be useful controls and many people do still use them. TNoteBook…

+ From:
+
+ On 09-Jan-2000 Marc Weustink wrote:
+
+ > In Delphi 4 (& 3 & 2) TNotebook is a decendant of TCustomControl and
+ > TTabbedNotebook a decendant of TCustomTabControl. Since we
+ > are trying to be Delphi compatible I think we should do
+ > the same. So TNotebook shoud be just a notebook whithout tabs,
+ > a plain control with pages. TCustomNotebook shouldn't be used
+ > anymore and TTabbedNotebook is a decendant of TCustomTabControl. +
+ The only problem with this is that much of the code to
+ implement TNotebook and TTabbedNotebook is identical.
+ If they inherit from two different components, then much
+ of that code will be duplicated. That seems kind of
+ silly to me to duplicate code just because Borland did
+ it that way. I think Borland did it that way because
+ they had to actually build the TNoteBook control from scratch
+ (they didn't use a Windows notebook control). TTabbedNotebook
+ is created specifically from a windows notebook control.
+ I don't see any reason we should build a notebook from scratch
+ like Borland did when one already exists (just have to turn off
+ the tabs).
+
+ Obviously, TCustomControl doesn't contain any notebook
+ functionality. And TCustomTabConrol contains functionality
+ specific to having tabs. So it doesn't really make sense
+ to split them that way in Lazarus (my opinion). I think we
+ could simulate Delphi's way of doing it by creating the
+ TCustomTabControl and makeing it inherit from TCustomNoteBook.
+ Then we wouldn't be duplicating code. They would both be
+ inheriting from a single component that contains most
+ of the functionality of a notebook control.

I think that one way or the other you are writing duplicate code. In the end we want to have a TNoteBook, TTabbedNotebook, TPageControl and a TTabControl.

In this case you have either common code for pages or common code for tabs and Borland choose for the common tabs. Sure we can decide to create a common ancestor, but here I can't see how. Unless you also want pages on a Ttabcontrol, something what is definitely not the purpose of the control.

+ > This brings me to my feeling of the win31 beeing a
+ > compatabiliti page, I think that in the IDE develompment
+ > we should prefer the use of the TPageControl instead of
+ > TTabbedNotebook.
+
+ I agree with this. But it is going to take a lot more work to
+ implement the TPageControl. Originally, we just wanted to
+ have a way to make a tabbed notebook. We can always switch
+ it to a TPageControl in Lazarus once that is completed.

Eh... I made that remark unter the assumption that we have a PageControl and since TPageControl an dTTabbedNoteBook both were decendents of TCustomTabControl it shouldnt be difficult to create a TPageControl ;-)

Marc

Reply by email

Kevin Berry

Marc, I'd agree with you except for one thing...

What happens if someone has designed a custom
component based on TCustomNotebook? This is just
hypothetical since I don't know of any custom
components that do inherit from TCustomNotebook...

Shouldn't we also be trying to make as many custom components work (when source code is provided) if
possible? That way people can port their Delphi apps much easier to Linux.

Cheers,
Kevin.

--- Marc Weustink wrote 30 lines
Hi, Since the TNotebook and TTabbedNotebook are on the win31 page I didn't concern much about them, but here some thoughts. The reason why Borland put them on this page is IMO only for backward compatibility. Most of them have a good and usable counter part. So in daily development I don't use them (except for TNoteBook, I havn't found a replacement). In Delphi 4 (& 3 & 2) TNotebook is a decendant of TCustomControl and TTabbedNotebook a decendant of TCustomTabControl. Since we are trying to be Delphi compatible I think we should do the same. So TNotebook shoud be just a notebook whithout tabs, a plain control with pages. TCustomNotebook shouldn't be used anymore and TTabbedNotebook is a decendant of TCustomTabControl. This brings me to my feeling of the win31 beeing a compatabiliti page, I think that in the IDE develompment we should prefer the use of the TPageControl instead of TTabbedNotebook. Marc

__________________________________________________ Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com

Reply by email

Marc Weustink
to d0hb0y: Couldn't TNotebook be a subclass of TTabbedNotebook where the default value of "showtabs"…

Hi,
Since the TNotebook and TTabbedNotebook are on the win31 page I didn't concern much about them, but here some thoughts. The reason why Borland put them on this page is IMO only for backward compatibility. Most of them have a good and usable counter part. So in daily development I don't use them (except for TNoteBook, I havn't found a replacement). In Delphi 4 (& 3 & 2) TNotebook is a decendant of TCustomControl and TTabbedNotebook a decendant of TCustomTabControl. Since we are trying to be Delphi compatible I think we should do the same. So TNotebook shoud be just a notebook whithout tabs, a plain control with pages. TCustomNotebook shouldn't be used anymore and TTabbedNotebook is a decendant of TCustomTabControl.
This brings me to my feeling of the win31 beeing a compatabiliti page, I think that in the IDE develompment we should prefer the use of the TPageControl instead of TTabbedNotebook.

Marc

Curtis wrote
On 08-Jan-2000 d0hb0y wrote: > Couldn't TNotebook be a subclass of TTabbedNotebook where the default

value

Show quoted text 19 lines
> of "showtabs" was set to false? That way we get the best of both worlds I > would think. They are both a subclass of TCustomNotebook which contains all the notebook functionality. > > I suppose it could be reversed such that TNotebook is the base class and > TTabbedNotebook is just TNotebook with showtabs set to true :) This is basically how it was. They both inherited from TCustomNotebook which contained all the functionality of the notebook. The only difference was that the TNotebook set the tabs to false and TTabbedNotebook set them to true. I think there may be some additional properties that were also different, but I don't remember for certain. It really doesn't make much sense to have two of them to do almost the same thing. It would be better to have just TNotebook with a TabsVisible property that allows you to set it to true or false and turn on and off tabs. But

if we

Show quoted text 6 lines
don't have a TTabbedNotebook, then every Delphi program that uses it will have to be converted to use TNotebook and the TabsVisible property. We could easily do this in Lazarus as long as we remember that it must be done. Between the holidays and me completely rebuilding all my computers (upgrading them all to faster processors and more RAM), I haven't had any time to

work on

Lazarus. But things are getting back to normal again and I should start

having

Show quoted text 13 lines
some time again. I am planning to make up a web page that explains what needs to be changed when converting from Delphi to FPC/Lazarus. Maybe we can just keep the single TNotebook and I will add that to the page as something that must be converted. Curtis _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Curtis White
to d0hb0y: Couldn't TNotebook be a subclass of TTabbedNotebook where the default value of "showtabs"…
Couldn't TNotebook be a subclass of TTabbedNotebook where the default value of "showtabs" was set to false? That way we get the best of both worlds I would think.

They are both a subclass of TCustomNotebook which contains all the notebook functionality.

I suppose it could be reversed such that TNotebook is the base class and TTabbedNotebook is just TNotebook with showtabs set to true :)

This is basically how it was. They both inherited from TCustomNotebook which contained all the functionality of the notebook. The only difference was that the TNotebook set the tabs to false and TTabbedNotebook set them to true. I think there may be some additional properties that were also different, but I don't remember for certain.

It really doesn't make much sense to have two of them to do almost the same thing. It would be better to have just TNotebook with a TabsVisible property that allows you to set it to true or false and turn on and off tabs. But if we don't have a TTabbedNotebook, then every Delphi program that uses it will have to be converted to use TNotebook and the TabsVisible property. We could easily do this in Lazarus as long as we remember that it must be done.

Between the holidays and me completely rebuilding all my computers (upgrading them all to faster processors and more RAM), I haven't had any time to work on Lazarus. But things are getting back to normal again and I should start having some time again. I am planning to make up a web page that explains what needs to be changed when converting from Delphi to FPC/Lazarus. Maybe we can just keep the single TNotebook and I will add that to the page as something that must be converted.

Curtis

Reply by email

Curtis White
to Marc Weustink: Since the TNotebook and TTabbedNotebook are on the win31 page I didn't concern much about…
Show quoted text 6 lines
Hi, Since the TNotebook and TTabbedNotebook are on the win31 page I didn't concern much about them, but here some thoughts. The reason why Borland put them on this page is IMO only for backward compatibility. Most of them have a good and usable counter part. So in daily development I don't use them (except for TNoteBook, I havn't found a replacement).

True. But they can still be useful controls and many people do still use them. TNoteBook is a very light weight control compared to TPageControl. If you don't need all the functionality of TPageControl then TNoteBook is much easier to use. Like you, I use TPageControl instead of TTabbedNotebook now.

Show quoted text 6 lines
In Delphi 4 (& 3 & 2) TNotebook is a decendant of TCustomControl and TTabbedNotebook a decendant of TCustomTabControl. Since we are trying to be Delphi compatible I think we should do the same. So TNotebook shoud be just a notebook whithout tabs, a plain control with pages. TCustomNotebook shouldn't be used anymore and TTabbedNotebook is a decendant of TCustomTabControl.

The only problem with this is that much of the code to implement TNotebook and TTabbedNotebook is identical. If they inherit from two different components, then much of that code will be duplicated. That seems kind of silly to me to duplicate code just because Borland did it that way. I think Borland did it that way because they had to actually build the TNoteBook control from scratch (they didn't use a Windows notebook control). TTabbedNotebook is created specifically from a windows notebook control. I don't see any reason we should build a notebook from scratch like Borland did when one already exists (just have to turn off the tabs).

Obviously, TCustomControl doesn't contain any notebook functionality. And TCustomTabConrol contains functionality specific to having tabs. So it doesn't really make sense to split them that way in Lazarus (my opinion). I think we could simulate Delphi's way of doing it by creating the TCustomTabControl and makeing it inherit from TCustomNoteBook. Then we wouldn't be duplicating code. They would both be inheriting from a single component that contains most of the functionality of a notebook control.

This brings me to my feeling of the win31 beeing a compatabiliti page, I think that in the IDE develompment we should prefer the use of the TPageControl instead of TTabbedNotebook.

I agree with this. But it is going to take a lot more work to implement the TPageControl. Originally, we just wanted to have a way to make a tabbed notebook. We can always switch it to a TPageControl in Lazarus once that is completed.

Curtis

Reply by email

Intranet User 5622
to Curtis White: They are both a subclass of TCustomNotebook which contains all the notebook functionality.

----- Original Message -----

Earlier message 65 lines
From: Curtis White To: Sent: Saturday, January 08, 2000 9:55 PM Subject: RE: [lazarus] TNotebook vs TTabbedNotebook > > On 08-Jan-2000 d0hb0y wrote: > > Couldn't TNotebook be a subclass of TTabbedNotebook where the default value > > of "showtabs" was set to false? That way we get the best of both worlds I > > would think. > > They are both a subclass of TCustomNotebook which contains all the notebook > functionality. > > > > > I suppose it could be reversed such that TNotebook is the base class and > > TTabbedNotebook is just TNotebook with showtabs set to true :) > > This is basically how it was. They both inherited from TCustomNotebook which > contained all the functionality of the notebook. The only difference was that > the TNotebook set the tabs to false and TTabbedNotebook set them to true. I > think there may be some additional properties that were also different, but I > don't remember for certain. > > It really doesn't make much sense to have two of them to do almost the same > thing. It would be better to have just TNotebook with a TabsVisible property > that allows you to set it to true or false and turn on and off tabs. But if we > don't have a TTabbedNotebook, then every Delphi program that uses it will > have to be converted to use TNotebook and the TabsVisible property. We could > easily do this in Lazarus as long as we remember that it must be done. > > Between the holidays and me completely rebuilding all my computers (upgrading > them all to faster processors and more RAM), I haven't had any time to work on > Lazarus. But things are getting back to normal again and I should start having > some time again. I am planning to make up a web page that explains what needs > to be changed when converting from Delphi to FPC/Lazarus. Maybe we can just > keep the single TNotebook and I will add that to the page as something that > must be converted. > > > Curtis > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Marc Weustink
to Kevin Berry: Marc, I'd agree with you except for one thing... What happens if someone has designed a…
Kevin Berry wrote 6 lines
Marc, I'd agree with you except for one thing... What happens if someone has designed a custom component based on TCustomNotebook? This is just hypothetical since I don't know of any custom components that do inherit from TCustomNotebook...

As far as I know TCustomNoteBook is no Delphi component. So it only affects LCL components (and there aren't many custom LCL components ;-)

Show quoted text 5 lines
Shouldn't we also be trying to make as many custom components work (when source code is provided) if possible? That way people can port their Delphi apps much easier to Linux.

This is not the main issue now, but it might be a good poijnt for the future.

MArc

Reply by email