BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

deriving from existing components

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Jeff Kish
Guest





PostPosted: Wed Nov 26, 2003 6:27 pm    Post subject: deriving from existing components Reply with quote



Greetings.

I'm a bit confused here.
I see an example on the borland site (at:
http://community.borland.com/article/0,1410,21743,00.html) that
has a class derived from TListBox (.h file looks like this):

class PACKAGE TActiveListBox : public TListBox
:
:

Now normally if I want to use a TListBox I'll drag it onto my form
and away I go.

If I want to use the above mentioned code, then what are
the mechanics involved? Do I still drag a TListBox onto
a form and name it "TActiveListBox", then include the code
mentioned above?

Thanks
Jeff

Jeff Kish
Back to top
Dennis Jones
Guest





PostPosted: Wed Nov 26, 2003 6:37 pm    Post subject: Re: deriving from existing components Reply with quote




"Jeff Kish" <jeff.kish (AT) mro (DOT) com> wrote

Quote:
Greetings.

I'm a bit confused here.
I see an example on the borland site (at:
http://community.borland.com/article/0,1410,21743,00.html) that
has a class derived from TListBox (.h file looks like this):

class PACKAGE TActiveListBox : public TListBox
:
:

Now normally if I want to use a TListBox I'll drag it onto my form
and away I go.

If I want to use the above mentioned code, then what are
the mechanics involved? Do I still drag a TListBox onto
a form and name it "TActiveListBox", then include the code
mentioned above?

If you do not have TActiveListBox installed as a component, BCB will not let
you change a TListBox's type into a TActiveListBox because the
TActiveListBox class must be known to BCB in order for it to exist on the
form at design-time. If the component *is* installed, then you can modify
the .cpp, .h, and .dfm files manually (outside the IDE -- in notepad, for
example) and change every instance of TListBox to TActiveListBox and reload
the project.

If you do not indend to compile the new component into a package and put it
on the component palette, your only option is to create the component at
runtime with, "new TActiveListBox".

- Dennis



Back to top
Jeff Kish
Guest





PostPosted: Wed Nov 26, 2003 7:09 pm    Post subject: Re: deriving from existing components Reply with quote



On Wed, 26 Nov 2003 10:37:43 -0800, "Dennis Jones" <djones (AT) nospam (DOT) com>
wrote:

Quote:

snip

If you do not indend to compile the new component into a package and put it
on the component palette, your only option is to create the component at
runtime with, "new TActiveListBox".

- Dennis

So I either create a component and install it, or do it at run time?

If I create it at run time, then how would I "link" it to a listbox on
my form?

Thanks,

Jeff Kish

Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed Nov 26, 2003 9:10 pm    Post subject: Re: deriving from existing components Reply with quote


"Jeff Kish" <jeff.kish (AT) mro (DOT) com> wrote


Quote:
If I want to use the above mentioned code, then what
are the mechanics involved?

In order to use the component at design-time, you need to put it into a
runtime package and then create a designtime package for registering the
component onto the Component Palette. Then you can use it like any other
component. Please have a look at the help files, there are sections on
writing and instaling custom components.

Quote:
Do I still drag a TListBox onto a form and name it "TActiveListBox",

No. When everything is done, you would drag a TActiveListBox instead.


Gambit



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed Nov 26, 2003 9:11 pm    Post subject: Re: deriving from existing components Reply with quote


"Jeff Kish" <jeff.kish (AT) mro (DOT) com> wrote


Quote:
If I create it at run time, then how would I "link" it to a
listbox on my form?

You don't. It *is* the ListBox. You would have to use the new class as a
replacement for the TListBox, not as a companion to it.


Gambit



Back to top
Jeff Kish
Guest





PostPosted: Fri Nov 28, 2003 1:45 am    Post subject: Re: deriving from existing components Reply with quote

On Wed, 26 Nov 2003 13:10:29 -0800, "Remy Lebeau (TeamB)"
<gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote:

Quote:

"Jeff Kish" <jeff.kish (AT) mro (DOT) com> wrote in message
news:7vr9svsfrs0l58clasitopaiunrttsf71l (AT) 4ax (DOT) com...

If I want to use the above mentioned code, then what
are the mechanics involved?

In order to use the component at design-time, you need to put it into a
runtime package and then create a designtime package for registering the
component onto the Component Palette. Then you can use it like any other
component. Please have a look at the help files, there are sections on
writing and instaling custom components.

Do I still drag a TListBox onto a form and name it "TActiveListBox",

No. When everything is done, you would drag a TActiveListBox instead.


Gambit

Thanks Gambit. So would you say that writing the component and

installing it is the best way to go here?

Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Nov 28, 2003 6:11 am    Post subject: Re: deriving from existing components Reply with quote


"Jeff Kish" <kishjjrjj (AT) provide (DOT) net> wrote


Quote:
So would you say that writing the component
and installing it is the best way to go here?

It is for you to decide what is best for your own needs. Whether you
install the component on the Palette or instantiate it dynamically at
runtime, either way is going to involve some work on your part. The main
difference is that one allow for setups at design-time while the other is
for setups at runtime.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.