 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
mekko Guest
|
Posted: Tue Jun 13, 2006 8:13 am Post subject: Compound components (Panels inside Panels)?! |
|
|
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
|
Posted: Tue Jun 13, 2006 8:13 am Post subject: Re: Compound components (Panels inside Panels)?! |
|
|
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
|
Posted: Sat Jun 17, 2006 12:38 am Post subject: Re: Compound components (Panels inside Panels)?! |
|
|
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 |
|
 |
|
|
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
|
|