 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Marco Cotroneo Guest
|
Posted: Wed Oct 15, 2003 10:05 am Post subject: TComponentEditor |
|
|
I have create a new property on a Panel called Buttons. It is a TCollection
property. I want to create a TComponent editor so that I can edit the
property when I right click on the panel. The problem is I don't know how to
call the property editor to edit the property in the ExecuteVerb. Can anyone
adivise me?
procedure TMyEditor.ExecuteVerb(Index: Integer);
begin
inherited;
case Index of
0 ???????? What shoud I write here to edit the property?
end;
end;
Thanks
Marco
|
|
| Back to top |
|
 |
Marcel Bestebroer Guest
|
Posted: Wed Oct 15, 2003 10:26 am Post subject: Re: TComponentEditor |
|
|
Hello, Marco!
You wrote on Wed, 15 Oct 2003 12:05:32 +0200:
MC> procedure TMyEditor.ExecuteVerb(Index: Integer);
MC> begin
MC> inherited;
MC> case Index of
MC> 0 ???????? What shoud I write here to edit the property?
MC> end;
ShowCollectionEditorClass(Designer, TCollectionEditor, Component,
TMyComponent(Component).CollectionProperty, 'CollectionProperty');
of course you have to change the TMyComponent and CollectionProperty
references to your own component class and property.
--
Marcel Bestebroer (Team JEDI) http://delphi-jedi.org
Project JEDI Help coordinator
JVCL Help team coordinator
To mail me, remove the obvious from my mail address
|
|
| Back to top |
|
 |
Marco Cotroneo Guest
|
Posted: Wed Oct 15, 2003 1:51 pm Post subject: Re: TComponentEditor |
|
|
Hello!
I forgot but I've already tried it but when I add DBReg or ColnEdit to use
ShowCollectionEditorClass it searches for DrpCtrls.dcu But I can't finde
any file DrpCtrls.* on my hd. How can I use this function?
Thanks
Marco
"Marcel Bestebroer" <marcelb.theobvious (AT) zeelandnet (DOT) nl> ha scritto nel
messaggio news:3f8d20ef$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hello, Marco!
You wrote on Wed, 15 Oct 2003 12:05:32 +0200:
MC> procedure TMyEditor.ExecuteVerb(Index: Integer);
MC> begin
MC> inherited;
MC> case Index of
MC> 0 ???????? What shoud I write here to edit the property?
MC> end;
ShowCollectionEditorClass(Designer, TCollectionEditor, Component,
TMyComponent(Component).CollectionProperty, 'CollectionProperty');
of course you have to change the TMyComponent and CollectionProperty
references to your own component class and property.
--
Marcel Bestebroer (Team JEDI) http://delphi-jedi.org
Project JEDI Help coordinator
JVCL Help team coordinator
To mail me, remove the obvious from my mail address
|
|
|
| Back to top |
|
 |
Marco Cotroneo Guest
|
Posted: Wed Oct 15, 2003 1:59 pm Post subject: Re: TComponentEditor |
|
|
I wronged on writing here it again ))
Hello!
I forgot but I've already tried it but when I add ColnEdit to use
ShowCollectionEditorClass it searches for toolwnds.dcu But I can't find
any file toolwnds.* on my hd. How can I use this function?
Thanks
Marco
|
|
| Back to top |
|
 |
Marcel Bestebroer Guest
|
Posted: Wed Oct 15, 2003 2:48 pm Post subject: Re: TComponentEditor |
|
|
Hello, Marco!
You wrote on Wed, 15 Oct 2003 15:59:23 +0200:
MC> Hello!
MC> I forgot but I've already tried it but when I add ColnEdit to use
MC> ShowCollectionEditorClass it searches for toolwnds.dcu But I can't
MC> find any file toolwnds.* on my hd. How can I use this function?
make sure the package with your editor uses the
dsnide(D5)/designide(D6+) package (this is why you *have* to put your editor
into a design time only package; it's the only package type that allows to
use the dsnide/designide package).
--
Marcel Bestebroer (Team JEDI) http://delphi-jedi.org
Project JEDI Help coordinator
JVCL Help team coordinator
To mail me, remove the obvious from my mail address
What's that noise in the background? Oh, it's Puff Daddy feat. Jimmy Page
with "Come With Me".
|
|
| Back to top |
|
 |
Marco Cotroneo Guest
|
Posted: Wed Oct 15, 2003 3:37 pm Post subject: Re: TComponentEditor |
|
|
Hi Marcel,
I am not sure what exactly do... I have put my component in a disign and
runtime package. The definition of the editor is in the same unit of the
component. Do I have to create a new design time only package with the
editor only?
For a quick try, I changed the option of my package in "disgntime only" and
added the dsnide package. I try compile and it searches for the unit where
ShowCollectionEditorClass is defined. I had to add ColnEdit unit and
rebuild the package. Everything is ok the package has been rebuilded and
installed, but when I try to compile the project that uses my componet it
raises an exception with message "File not found : 'ToolWnds.dcu'. Where did
I go wrong?
Thanks
marco
"Marcel Bestebroer" <marcelb.theobvious (AT) zeelandnet (DOT) nl> ha scritto nel
messaggio news:3f8d5e50$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hello, Marco!
You wrote on Wed, 15 Oct 2003 15:59:23 +0200:
MC> Hello!
MC> I forgot but I've already tried it but when I add ColnEdit to use
MC> ShowCollectionEditorClass it searches for toolwnds.dcu But I can't
MC> find any file toolwnds.* on my hd. How can I use this function?
make sure the package with your editor uses the
dsnide(D5)/designide(D6+) package (this is why you *have* to put your
editor
into a design time only package; it's the only package type that allows to
use the dsnide/designide package).
--
Marcel Bestebroer (Team JEDI) http://delphi-jedi.org
Project JEDI Help coordinator
JVCL Help team coordinator
To mail me, remove the obvious from my mail address
What's that noise in the background? Oh, it's Puff Daddy feat. Jimmy Page
with "Come With Me".
|
|
|
| Back to top |
|
 |
Marcel Bestebroer Guest
|
Posted: Thu Oct 16, 2003 9:50 am Post subject: Re: TComponentEditor |
|
|
Hello, Marco!
You wrote on Wed, 15 Oct 2003 17:37:16 +0200:
MC> Hi Marcel,
MC> I am not sure what exactly do... I have put my component in a disign
MC> and runtime package. The definition of the editor is in the same unit
of
MC> the component. Do I have to create a new design time only package
MC> with the editor only?
Yes. As a general rule it is always better to split the component from
it's design time code (editors).
MC> For a quick try, I changed the option of my package in "disgntime only"
MC> and added the dsnide package. I try compile and it searches for the
unit
MC> where ShowCollectionEditorClass is defined. I had to add ColnEdit
MC> unit and rebuild the package. Everything is ok the package has been
MC> rebuilded and installed, but when I try to compile the project that
uses
MC> my componet it raises an exception with message "File not found :
MC> 'ToolWnds.dcu'. Where did I go wrong?
Because you didn't split it, the application will try to build the unit
with your component again and thus tries to use the ToolWnds unit (through
the usage of ColnEdit). So to get it working you have to split the unit in
two parts: run-time (your component and classes needed by an application)
and design time (the editor to be used from within Delphi only). Create two
packages (one as run time only and one as design time only). The run time
package will contain your component unit and the design time package will
contain the component editor unit. It will also require the run time package
you just created and the design package I mentioned earlier. Build the run
time package, build and install the design time package.
--
Marcel Bestebroer (Team JEDI) http://delphi-jedi.org
Project JEDI Help coordinator
JVCL Help team coordinator
To mail me, remove the obvious from my mail address
|
|
| Back to top |
|
 |
Marco Cotroneo Guest
|
Posted: Thu Oct 16, 2003 10:05 am Post subject: Re: TComponentEditor |
|
|
Thank you very much, Marcel. Better than a Teacher!
Good Work
Marco
"Marcel Bestebroer" <marcelb.theobvious (AT) zeelandnet (DOT) nl> ha scritto nel
messaggio news:3f8e69d5 (AT) newsgroups (DOT) borland.com...
| Quote: | Hello, Marco!
You wrote on Wed, 15 Oct 2003 17:37:16 +0200:
MC> Hi Marcel,
MC> I am not sure what exactly do... I have put my component in a
disign
MC> and runtime package. The definition of the editor is in the same unit
of
MC> the component. Do I have to create a new design time only package
MC> with the editor only?
Yes. As a general rule it is always better to split the component from
it's design time code (editors).
MC> For a quick try, I changed the option of my package in "disgntime
only"
MC> and added the dsnide package. I try compile and it searches for the
unit
MC> where ShowCollectionEditorClass is defined. I had to add ColnEdit
MC> unit and rebuild the package. Everything is ok the package has been
MC> rebuilded and installed, but when I try to compile the project that
uses
MC> my componet it raises an exception with message "File not found :
MC> 'ToolWnds.dcu'. Where did I go wrong?
Because you didn't split it, the application will try to build the
unit
with your component again and thus tries to use the ToolWnds unit (through
the usage of ColnEdit). So to get it working you have to split the unit in
two parts: run-time (your component and classes needed by an application)
and design time (the editor to be used from within Delphi only). Create
two
packages (one as run time only and one as design time only). The run time
package will contain your component unit and the design time package will
contain the component editor unit. It will also require the run time
package
you just created and the design package I mentioned earlier. Build the run
time package, build and install the design time package.
--
Marcel Bestebroer (Team JEDI) http://delphi-jedi.org
Project JEDI Help coordinator
JVCL Help team coordinator
To mail me, remove the obvious from my mail address
|
|
|
| Back to top |
|
 |
|
|
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
|
|