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 

Compound components (Panels inside Panels)?!

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing
View previous topic :: View next topic  
Author Message
mekko
Guest





PostPosted: Tue Jun 13, 2006 8:13 am    Post subject: Compound components (Panels inside Panels)?! Reply with quote



Hi there,
the component I try to write contains a panel which itself contains 2
more panels. I need to be able to drop other components onto theses
nested panels at design time which works fine but at runtime the
components on the nested panels are gone...

I came across different solutions with the setsubcomponent method and
having the form as the owner of all the panels but these solutions
didn't really work out. A solution that worked fine for me for having
all sorts of components on the top panel in my component was
overwriting the getchildren and getchildparent methods as described
here:

http://groups.google.com.au/group/borland.public.delphi.vcl.components.writing/browse_thread/thread/24ed75778e94c0a/e08c80c7cfaf10e2?lnk=st&q=delphi+panel+getchildren&rnum=1&hl=en#e08c80c7cfaf10e2

I am sorry if this is a stupid question but this my first try to write
my own component and I am stuck now when trying to use this solution
for having more than 1 nested panel as the following (as suggested
under the link above) won't work anymore:

procedure TTestPanel.GetChildren(Proc: TGetChildProc; Root:
TComponent);
begin
FNestedPanel.GetChildren(Proc,Root);
end;

function TTestPanel.GetChildParent: TComponent; override;
begin
Result := FNestedPanel;
end;

I would think to have a loop within the getchildren procedure to call
getchildren for each of the nested panels as I saw in some solutions
for finsing components on a panel. But what do I do with the
getChildParent function when having 2 or more nested panels on the
"master" panel inside my component? The getChildParent method cannot
return FNestedPanel anymore as I don't know which nested panel should
be the parent when a component is dropped on any of my nested panels at
design time.

Many thanks for your help in advance!!!
Back to top
mekko
Guest





PostPosted: Tue Jun 13, 2006 8:13 am    Post subject: Re: Compound components (Panels inside Panels)?! Reply with quote



hey, I forgot to mention that I use Delphi 6.


mekko wrote:
Quote:
Hi there,
the component I try to write contains a panel which itself contains 2
more panels. I need to be able to drop other components onto theses
nested panels at design time which works fine but at runtime the
components on the nested panels are gone...

I came across different solutions with the setsubcomponent method and
having the form as the owner of all the panels but these solutions
didn't really work out. A solution that worked fine for me for having
all sorts of components on the top panel in my component was
overwriting the getchildren and getchildparent methods as described
here:

http://groups.google.com.au/group/borland.public.delphi.vcl.components.writing/browse_thread/thread/24ed75778e94c0a/e08c80c7cfaf10e2?lnk=st&q=delphi+panel+getchildren&rnum=1&hl=en#e08c80c7cfaf10e2

I am sorry if this is a stupid question but this my first try to write
my own component and I am stuck now when trying to use this solution
for having more than 1 nested panel as the following (as suggested
under the link above) won't work anymore:

procedure TTestPanel.GetChildren(Proc: TGetChildProc; Root:
TComponent);
begin
FNestedPanel.GetChildren(Proc,Root);
end;

function TTestPanel.GetChildParent: TComponent; override;
begin
Result := FNestedPanel;
end;

I would think to have a loop within the getchildren procedure to call
getchildren for each of the nested panels as I saw in some solutions
for finsing components on a panel. But what do I do with the
getChildParent function when having 2 or more nested panels on the
"master" panel inside my component? The getChildParent method cannot
return FNestedPanel anymore as I don't know which nested panel should
be the parent when a component is dropped on any of my nested panels at
design time.

Many thanks for your help in advance!!!
Back to top
Riki Wiki
Guest





PostPosted: Sat Jun 17, 2006 12:38 am    Post subject: Re: Compound components (Panels inside Panels)?! Reply with quote



Hoi Mekko

You need to repost your question on the Borland news server to make
everybody see it and possibly answer your question. Further, this news
group do not officially exist, the group to use is
b.p.d.vcl.components.writing.win32.

How to post to Delphi newsgroups:
<http://delphi.wikia.com/wiki/Delphi_Newsgroups>
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing 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.