[lazarus] More Native Win32 stuff(Pascal,canyouhelphere?)

Michael A. Hess mhess at miraclec.com
Tue Aug 10 16:47:49 EDT 1999


Shane Miller wrote:
> 
> Here is a basic map of how it's done:
> 
> We call gtkint.pp and send it a "message" or "command" LM_CREATE.
> gtkint.pp says 'Hey, I received a LM_CREATE so they want me to create
> something!" (That's the English version of gtkint.pp talking of
> course)
> 
> gtkint then checks the SELF parameter (as a tcontrol) and check's it's
> compstyle and says "Hey, it's a compstyle is csFORM so I'll create a
> FORM!'.  (gtkint.pp is very excitable, that's why it talks that way.)
> 
> So, now in order to detect when someone clicks on the form, TControl
> (for TForm) calls SetCAllBack(LM_CLICKED) and that's passed onto
> gtkint.pp.

All of this is easy to do and he won't have any problems doing what is
indicated above. However .....

> GtKINT.PP get's it's SetCallBack called with a SELF and a LM_CLICKED
> so it sets a callback procedure up to be called when a clicked event
> occurs.  In that callback, it uses the SELF to call
> DISPATCH(LM_CLICKED).

this is the problem. At present I don't see an easy way to get the value
Self back to the callback. The other issue is that ALL messages for a
given window (which in windows means buttons, scrollbars, just about
everything) goes through only ONE callback for that control. So the
callback must determine which message it is getting and then tranlate
the message to an LM_XXX message and call Dispatch. However since Self
isn't readily available something tricky needs to take place to
determine which "Self" the passed HWND represents. The only really,
really nice thing about this is that ALL and I mean ALL of the messages
from ALL of the controls will go through just ONE callback routine. It
will make that part of the win32int a whole lot cleaner and smaller than
the GTK version.

That is assuming we can figure out a clean and easy way to get the
"Self" value to the callback.


-- 
==== Programming my first best destiny! ====

Michael A. Hess      Miracle Concepts, Inc.
mhess at miraclec.com   http://www.miraclec.com






More information about the Lazarus mailing list