[lazarus] DefaultHandler

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Jul 4 03:10:38 EDT 2003


On Fri, 4 Jul 2003 07:57:26 +0200
"Micha Nelissen" <mdvpost at hotmail.com> wrote:

> Mattias Gaertner wrote:
> > On Thu, 3 Jul 2003 23:03:24 +0200
> > "Micha Nelissen" <mdvpost at hotmail.com> wrote:
> >
> >> Hi,
> >>
> >> There are several calls to DefaultHandler in the LCL. Notably,
> >> TWinControl.PaintWindow, but there are more. Currently these do
> >> nothing. Shouldn't they be replaced with IntSendMessage or something
> >> alike? Or implement the DefaultHandler function? I guess that would
> >> call IntSendMessage after all, so we don't need the extra step.
> >
> > Hmm.
> > The messages are a problem. They make it harder to create new
> > interfaces, they are hardly extendable, they are not smart linkable
> > and last but not least they make debugging more difficult. There are
> > already far too many of them. I think, we should try to keep only the
> > most common needed for delphi compatibility and replace the rest with
> > methods.
> 
> Could you take (or have you taken) a look at TWinControl.PaintWindow? The
> code suggests that it's on it's 'way' to go send a message. It prepares
> message with type, wparam, lparam, etc. so that's why I suggested it.

Where is the difference to the VCL?

 
> If these messages are annoying way of programming, which I think too,
> (large cases and such), why not remove them completely and replace with
> virtual functions all together? It'll make it a lot clearer and
> extendable, as you said.

Many Delphi components rely on them. IMO messages like WM_Paint, WM_Size,
WM_Move should be kept. Messages like LM_Create, LM_SetPixel, LM_xx_xxx
should be replaced.


Mattias






More information about the Lazarus mailing list