[lazarus] Patches to Shanes files

Michael A. Hess mhess at miraclec.com
Wed Jul 7 17:11:52 EDT 1999


Shane Miller wrote:
> 
> I chagned all the SetCallBack functions to send a LM_MESSAGE instead
> of a string.  As I was in the middle of doing this I realized a
> problem.  The declaration of the methods use "message 'resize'" in
> them  So of course the next thought I had was why not use "message
> LM_RESIZE" and then we could use Dispatch(LM_RESIZE) instead of
> DispatchStr('resize');
> 
> I ask because I'm not that familiar with Dispatch.  But I assume
> that's how it's meant to be used in the first place.

As long as you use the same value in the procedure declaration, ie.

procedure DoClick(var msg); message LM_CLICK;

Then you can do DispatchStr(LM_CLICK);

When you define the message with the procedure it creates a table that
contains the string that is indicated. In this case it is whatever
LM_CLICK would be set to.

Then when you call DispatchStr(LM_CLICK) it is taking the value being
given it in the case LM_CLICK and scanning through the table until it
finds a match and then calls the pointer that was set in the table to
match that string. It can be whatever we want. It can be numbers '123'
just so long as it is a distinct string value.

-- 
==== 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