 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Bokini Guest
|
Posted: Sat Nov 08, 2003 7:39 pm Post subject: TComponent |
|
|
Hello,
I have one main control and child controls (TComponent desc.)
I have PropertyEditor for working with this childrens too.
When I want to add new child component into main component I simply Create
this component with setting Parent to main component. And I have one:
Items[x]: TMyChildComponent
property for accesing to this child components.
And that work fine in design and run-time. In design time I add component
same as in run-time by calling Add method of main component.
But how to make that when user set name of this child component in
ObjectInspector using PropertyEditor to this component is inserted in code
like all delphi components? And how to acces to this component with their
name in code.
type
TForm1 = class(TForm)
< my child component to be placed here >
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
Currently I can acces to my child component only by my own
MainControl.Items[x]; but how to do ChildControlName.Something;
Also, when I create event for child component all work fine until I delete
body of this event and click on run or save. In this moment event disapear
(normal) but my child control still point to this event and delphi show
error when start program.
How to solve all this, do I need to use something in IDesigner? When I add
component in DesignTime with calling Create why this component is not added
to code editor too.
Thanks
Bokini
|
|
| Back to top |
|
 |
Ignacio Vazquez Guest
|
Posted: Sat Nov 08, 2003 8:05 pm Post subject: Re: TComponent |
|
|
Hello, Bokini!
You wrote on Sat, 8 Nov 2003 20:39:37 +0100:
| Quote: | Currently I can acces to my child component only by my own
MainControl.Items[x]; but how to do ChildControlName.Something;
|
You can't since it's dynamically created.
Cheers,
Ignacio
|
|
| Back to top |
|
 |
Bokini Guest
|
Posted: Sat Nov 08, 2003 8:27 pm Post subject: Re: TComponent |
|
|
Hello,
So, how to solve this, I saw in other components that this is possible
(Toolbar2000 for example)
Best regards
Bokini
"Ignacio Vazquez" <ivazquezATorioncommunications.com> wrote
| Quote: | Hello, Bokini!
You wrote on Sat, 8 Nov 2003 20:39:37 +0100:
Currently I can acces to my child component only by my own
MainControl.Items[x]; but how to do ChildControlName.Something;
You can't since it's dynamically created.
Cheers,
Ignacio
|
|
|
| Back to top |
|
 |
Ignacio Vazquez Guest
|
Posted: Sat Nov 08, 2003 8:32 pm Post subject: Re: TComponent |
|
|
Hello, Bokini!
You wrote on Sat, 8 Nov 2003 21:27:56 +0100:
| Quote: | So, how to solve this, I saw in other components that this is possible
(Toolbar2000 for example)
|
It fakes it by using descendants of TCollection and TCollectionItem along
with a custom property editor.
Cheers,
Ignacio
|
|
| Back to top |
|
 |
Bokini Guest
|
Posted: Sat Nov 08, 2003 9:08 pm Post subject: Re: TComponent |
|
|
Hello
I don't think so. TTBItem is TComponent desc.
check on www.jrsoftware.org
"Ignacio Vazquez" <ivazquezATorioncommunications.com> wrote
| Quote: | Hello, Bokini!
You wrote on Sat, 8 Nov 2003 21:27:56 +0100:
So, how to solve this, I saw in other components that this is possible
(Toolbar2000 for example)
It fakes it by using descendants of TCollection and TCollectionItem along
with a custom property editor.
Cheers,
Ignacio
|
|
|
| Back to top |
|
 |
Ignacio Vazquez Guest
|
Posted: Sat Nov 08, 2003 10:11 pm Post subject: Re: TComponent |
|
|
Hello, Bokini!
You wrote on Sat, 8 Nov 2003 22:08:02 +0100:
| Quote: | I don't think so. TTBItem is TComponent desc.
|
In that case they don't use a TCollection, but they still use a custom
property editor.
Cheers,
Ignacio
|
|
| Back to top |
|
 |
Bokini Guest
|
Posted: Sat Nov 08, 2003 11:02 pm Post subject: Re: TComponent |
|
|
Hello,
Yes I know, and as I have write in my first post and I am using custom
property editor (TDesignWindow), so that is not a problem
"Ignacio Vazquez" <ivazquezATorioncommunications.com> wrote
| Quote: | Hello, Bokini!
You wrote on Sat, 8 Nov 2003 22:08:02 +0100:
I don't think so. TTBItem is TComponent desc.
In that case they don't use a TCollection, but they still use a custom
property editor.
Cheers,
Ignacio
|
|
|
| Back to top |
|
 |
Ignacio Vazquez Guest
|
Posted: Sat Nov 08, 2003 11:15 pm Post subject: Re: TComponent |
|
|
Hello, Bokini!
You wrote on Sun, 9 Nov 2003 00:02:44 +0100:
| Quote: | Yes I know, and as I have write in my first post and I am using custom
property editor (TDesignWindow), so that is not a problem
|
Ah, sorry. Missed that bit.
Wait, I think I know now. You probably have to set the owner of the
component to the form itself instead of the component. Give that a try.
Cheers,
Ignacio
|
|
| Back to top |
|
 |
Ignacio Vazquez Guest
|
Posted: Mon Nov 10, 2003 9:07 pm Post subject: Re: TComponent |
|
|
"Bokini" <nikolicbojanat (AT) hotmail (DOT) com> wrote in message
[email]3fad46a1 (AT) newsgroups (DOT) borland.com[/email]...
| Quote: | How to solve all this, do I need to use something in IDesigner? When I add
component in DesignTime with calling Create why this component is not
added to code editor too.
|
I found the answer when looking for one of my own:
http://delphi.about.com/library/bluc/text/uc092501d.htm
Check the section entitled "Advanced property editors".
Cheers,
Ignacio
--
The strange part isn't so much that he had an accent. No accent was
detectable. It was just sounds and burbs and gurgles coming from him. He
was a like a chubby, old R2-D2.
- La Üter
|
|
| 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
|
|