[lazarus] Some (major) changes

Michael A. Hess mhess at miraclec.com
Sun Nov 14 18:03:10 EST 1999


Marc Weustink wrote:
> 
> If you look in another way, what's the diference between
> InterfaceObject.Sendmessage(LM_DrawRect...) and

Actually I would hope you are not doing it this way. You should just be
calling:

SendMessage(LM_DrawRect...);

The SendMessage routine is located in the controls.pp file. It isn't a
part of TControl it is just located in this file since 95% of the time
all components needs to use the controls unit. If you are calling
InterfaceObject.whatever then that means your file must know about the
Interface unit. The only unit that SHOULD know about and call it is the
controls unit unless there is some overwhelming reason you must call
interfaceobject yourself. This should be avoided.

> InterfaceObject.Rectangle(...) ?

You wouldn't want to do this for the above reason. It would be better to
create a Rectangle routine in controls.pp that called the interface
unit. If we can keep all calls to the underlying GUI API going through
just one place we can more easily adapt the LCL to other APIs.

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