Thread View: borland.public.cppbuilder.oodesign
3 messages
3 total messages
Started by Sabetay Toros
Sun, 11 Jul 2004 20:36
class design
Author: Sabetay Toros
Date: Sun, 11 Jul 2004 20:36
Date: Sun, 11 Jul 2004 20:36
10 lines
1109 bytes
1109 bytes
Hi, I need a class which will have the functionality of TCustomPanel and TTabSheet. Both these classes are derived from TWinControl. Since I'm using C5 Builder and does not have multiple inheritance how can I solve this problem. Any suggestions Thanks Sabetay
Re: class design
Author: Alisdair Meredith (TeamB)
Date: Mon, 12 Jul 2004 10:28
Date: Mon, 12 Jul 2004 10:28
26 lines
1877 bytes
1877 bytes
Sabetay Toros wrote: > I need a class which will have the functionality of TCustomPanel and > TTabSheet. Both these classes are derived from TWinControl. Since I'm > using C5 Builder and does not have multiple inheritance how can I > solve this problem. Any suggestions Which functionality can you only achieve through inheritance, and what can you manage with composition? For instance, if you need your control to appear as part of a tab-set, then you probably need to derive from TTabSheet. However, you can give your control a single TCustomPanel as a data member, and forward all calls you want to support. If you could explain a little more about what you want to achieve, it would be easier to guess the best compromise solution <g> Mixing a Panel and a TabSheet does not sound too difficult from the things I can imagine doing with it, but I don't like to limit applications to just my own imagination!! Note: Just because it may be 'simple' does not mean it will not be a lot of seemingly-redundant work with a lot of call forwarding!! AlisdairM(TeamB)
Re: class design
Author: Sabetay Toros
Date: Mon, 12 Jul 2004 14:53
Date: Mon, 12 Jul 2004 14:53
41 lines
2619 bytes
2619 bytes
Alisdair, > Mixing a Panel and a TabSheet does not sound too difficult from the > things I can imagine doing with it, but I don't like to limit > applications to just my own imagination!! > Thank you very much for your contrubitions. Mixing a panel and a TabSheet is not difficult and I've made it. This question was a silly one. Again thanks Sabetay "Alisdair Meredith (TeamB)" <alisdair.NO.SPAM.PLEASE.meredith@uk.renaultf1.com> wrote in message news:40f267dd@newsgroups.borland.com... > Sabetay Toros wrote: > > > I need a class which will have the functionality of TCustomPanel and > > TTabSheet. Both these classes are derived from TWinControl. Since I'm > > using C5 Builder and does not have multiple inheritance how can I > > solve this problem. Any suggestions > > Which functionality can you only achieve through inheritance, and what > can you manage with composition? > > For instance, if you need your control to appear as part of a tab-set, > then you probably need to derive from TTabSheet. However, you can give > your control a single TCustomPanel as a data member, and forward all > calls you want to support. > > If you could explain a little more about what you want to achieve, it > would be easier to guess the best compromise solution <g> > > Mixing a Panel and a TabSheet does not sound too difficult from the > things I can imagine doing with it, but I don't like to limit > applications to just my own imagination!! > > Note: Just because it may be 'simple' does not mean it will not be a > lot of seemingly-redundant work with a lot of call forwarding!! > > AlisdairM(TeamB)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads