🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.oodesign
Article #28

Re: class design

#28
From: Alisdair Meredith (TeamB)
Date: Mon, 12 Jul 2004 10:28
26 lines
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)
Technical Details
Message-ID: <40f267dd@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <40f1a4df@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10db1e,55fe9bb22bccde9c
X-Google-Attributes: gid10db1e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Alisdair Meredith (TeamB)" <alisdair.NO.SPAM.PLEASE.meredith@uk.renaultf1.com>
Subject: Re: class design
Newsgroups: borland.public.cppbuilder.oodesign
References:  <40f1a4df@newsgroups.borland.com>
Organization: Renault F1 Team Ltd.
User-Agent: XanaNews/1.16.3.1
NNTP-Posting-Host: 195.153.139.2
Message-ID: <40f267dd@newsgroups.borland.com>
Date: 12 Jul 2004 03:28:45 -0700
X-Trace: newsgroups.borland.com 1089628125 195.153.139.2 (12 Jul 2004 03:28:45 -0700)
Lines: 26
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.linkpendium.com!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail