Compound components (Panels inside Panels)?!
Posted on 2006-06-13
the Delphi component I try to write (using Delphi 6) 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:
procedure TTestPanel.GetChildren(Proc: TGetChildProc; Root:
function TTestPanel.GetChildParent: TComponent; override;
Result := FNestedPanel;
I am sorry if this is a stupid question but this is my first try to write
my own component plus I'm fairly new to Delphi as well and I am stuck now when trying to use this solution
for having more than 1 nested panel as I cannot return Result := FNestedPanel anymore because I don't know which of my nested panels is the correct parent.
I hope anyone can help as I searched several newsgroups and came across different answers but none solved my problem and it is getting quite urgent now!
Many thanks for your help in advance!!!