Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-07

DefaultHandler

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Micha Nelissen

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.

Regards,

Micha.

Reply by email

Mattias Gaertner
to Micha Nelissen
Show quoted text 7 lines
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.

Mattias

Reply by email

Mattias Gaertner
to Micha Nelissen: There are several calls to DefaultHandler in the LCL. Notably, TWinControl.PaintWindow,…
Show quoted text 23 lines
Mattias Gaertner wrote: > On Thu, 3 Jul 2003 23:03:24 +0200 > "Micha Nelissen" 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 ? 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

Reply by email

Micha Nelissen
to Micha Nelissen: There are several calls to DefaultHandler in the LCL. Notably, TWinControl.PaintWindow,…
Mattias Gaertner wrote 18 lines
On Thu, 3 Jul 2003 23:03:24 +0200 "Micha Nelissen" 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 ? 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.

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.

Regards,

Micha.

Reply by email