On Sat, 10 Nov 2007 15:55:38 +0300
Al Boldi <[EMAIL PROTECTED]> wrote:
> Mattias Gaertner wrote:
> > I think ParentWindow is very widgetset specific (see below).
> > Probably it will work cross platform very limited. See at end for an
> > alternative solution.
> >
> > - AFAIK under winapi you can stack handles even of different
> > processes. gtk does not allow this. I don't know about qt, carbon,
> > fpgui, but probably they all have some limitations of child/parent
> > relationships.
>
> Actually the gtk does support this, but in a really hacky way, using
> GTKSocket/GTKPlug.
I see. So, you need special handles under gtk, while winapi allows
nearly any window handle. Then I guess, ParentWindow will be far too
complicated to implement cross platform in a generic way.
>
> > - the LCL handles messages and delegates them downwards and upwards
> > to parents/childs TControls. But if the Handle has no associated
> > TWinControl then messages can not be passed this way. Only the
> > widgetset knows how to handle this. You must check every place
> > where a handle is used if it is a normal LCL handle or a foreign
> > handle. This will be a lot of work.
> >
> > Solution:
> > It is probably easier to create a wrapper TWinControl / TCustomForm
> > with the ability to use the foreign Handle.
>
> Correct; all that is needed is a SetParent(hWnd) method.
Huh?
Maybe my statement was not clear: The Parent/Child connection is the
main problem. It would be easier to handle the child/parent
relationship by the LCL and keep the 1:1 mapping between controls and
handles.
So, all that is needed is a TForeignHandleControl with a SetHandle
method.
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives