Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Provider Controls

0 views
Skip to first unread message

Darren Guy

unread,
Nov 7, 2003, 6:30:06 AM11/7/03
to
In the Nov 2003 issue of MSDN Magazine, Dino Esposito's Cutting Edge column
talks about using Provider Controls instead of creating new controls thru
inheritence.
LinkBelow
http://msdn.microsoft.com/msdnmag/issues/03/11/CuttingEdge/default.aspx

Now i know that the article is about .net and C#, but was wondering if this
could be done in Delphi. as this could help me no end if it could be done.

I am using Delphi7.

Thanks in advance


Darren


Marc Rohloff

unread,
Nov 7, 2003, 9:45:35 AM11/7/03
to
On Fri, 7 Nov 2003 11:30:06 -0000, Darren
Guy<darre...@no.spam.idesk.com> said ...

> In the Nov 2003 issue of MSDN Magazine, Dino Esposito's Cutting Edge column
> talks about using Provider Controls instead of creating new controls thru
> inheritence.
> LinkBelow
> http://msdn.microsoft.com/msdnmag/issues/03/11/CuttingEdge/default.aspx

> Now i know that the article is about .net and C#, but was wondering if this
> could be done in Delphi. as this could help me no end if it could be done.

It can't be done cleanly (the way .net does it the new properties appear
in the inspector as properties of the original control)

The only way I know of doing this is to create a component which has
collection of controls which it should link up.
For example:
type
TProviderItem = class(TCollectionItem)
published control:TWinControl;
published color :TColor;
end;

Then in the IDE you would have to bring up the collection editor for your
provider component and create an item for each control.

At run-time you would have to link the OnEnter and OnExit events for the
controls. YOu have to make sure that your event handlers call the
original event handlers.

This is pretty much what the .NET version does except for the way .NET
integrates the properties into the property list.

One caveat with Delphi is that events are only single cast so you need to
hope that noone else changes the event after you have got to it.

Marc

Solerman Kaplon

unread,
Nov 7, 2003, 1:16:24 PM11/7/03
to
Take a look at the JVCL website and CVS (http://jvcl.sourceforge.net),
Marcel Bestebroer is implementing it to avoid the bunch of custom
controles that actualy exists in the JVCL 2.0, He writes a good article
about it talking about his implementation and how to make new
provider-awere controls, providers and consumers. I guess it was only
posted at the newsgroup, not sure.

Marc Rohloff

unread,
Nov 7, 2003, 2:22:34 PM11/7/03
to
On Fri, 07 Nov 2003 16:16:24 -0200, Solerman
Kaplon<sole...@wonder.com.br> said ...

> He writes a good article
> about it talking about his implementation and how to make new
> provider-awere controls, providers and consumers. I guess it was only
> posted at the newsgroup, not sure.
Do you have a link for this or at least know which controls to look at?

Marc

Solerman Kaplon

unread,
Dec 10, 2003, 8:46:35 AM12/10/03
to
Sorry for the very late response :), its article it's on their binary
newsgroup, hosted at forums.talkto.net. The article provides an sample
implementation
0 new messages