[lazarus] CreateComponent

Samuel Liddicott sam at campbellsci.co.uk
Mon Aug 16 10:51:43 EDT 1999


I can do it if I can be given CVS write access? Please? Someone?

HandleNeeded is recursive over control parents as the parent needs a handle
(or GTK first), then it creates its own handle using CreateHandle.

CreateHandle is virtual over TWinControl.  It actually creates the window,
AND THEN - and we need this - it stores a pointer to the delphi control in
some windows per-handle storage (SetProp).  This is used in (I think) the
stdwndproc - but also used by the FindControl function, which returns the
delphi control associated with a given handle.  Can we store tags inside a
given GTK control?

CreateWnd actually sets up the CreateParams (which may be arguable GUI
dependant) and then calls CreateWindowEx (via CreateWindowHande).

I am all for keeping things the same up the final routine which consists of
ONLY CreateWindowEx - and then we have our own copy which breaks apart the
CreateParams and THEN calls the right GTK create function.

Does this sound OK?

Much of this IS needed to support the ReCreateWndFunction.

Sam

> -----Original Message-----
> From: Shane Miller [mailto:SMiller1 at stvgb.org]
> Sent: 16 August 1999 03:09 PM
> To: lazarus at miraclec.com
> Subject: Re: [lazarus] CreateComponent
>
>
> Can we?  SURE!  We did it this way because that's how it worked
> best for GTK.  If someone wants to add the handleneeded procedure
> in TCONTROL and do the creation there, that would be fine.  We
> just have to make sure that we are using the "parent" property
> then and having the user set it (Lazarus will set it eventually).
>  Then when the parent is set, I assume that HANDLENEEDED is
> called if no handle exists....
>
> Anyone want to implement this?  You will have to move any
> CREATECOMPONENT calls out of the specific components into the
> handleneeded.....
>
> Shane
>
>
> >>> "Samuel Liddicott" <sam at campbellsci.co.uk> 08/16 8:33 AM >>>
> It seems like (to pick an example) TLabel makes it's GTK object in the
> contructor.  This is a bit early.
>
> Can't we delay gtk-creation until HandleNeeded is called?  Its the Delphi
> way.
> In fact can't we do it in the CreateWindow function?
>
> Am I being too fussy spotting windows divergances here? - but this one is
> important to me.
>
> Sam
>
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>     archives at http://www.miraclec.com/list_archives/lazarus
>
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>     archives at http://www.miraclec.com/list_archives/lazarus






More information about the Lazarus mailing list