Sign in Join

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

Mailing lists / lazarus / 2003-07

Patch: window subclassing, paint messages

10 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,

Attached is a patch to implement proper window subclassing and paint messages. This will enable _LARGE_ parts of the lcl code with respect to the interface because we actually get messages like listbox insertitem etc. Speedbuttons will now also be drawn correctly, groupboxes are drawn correctly...etc.

In wincontrol.inc I have changed the defaulthandler to send a message. This is still up for debate, and I don't know the effects on the GTK. Comments are welcome.

Diff was taken from the root of lazarus.

Regards,

Micha.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00053.bin
Type: application/octet-stream
Size: 2446 bytes
Desc: "subclass.patch.gz"
Url : http://localhost/pipermail/lazarus/attachments/20030704/aaccfb42/bin00053.bin

Reply by email

Mattias Gaertner
to Micha Nelissen
Show quoted text 25 lines
Mattias Gaertner wrote: > On Fri, 4 Jul 2003 11:36:47 +0200 > "Micha Nelissen" wrote: > >> Hi, >> >> Attached is a patch to implement proper window subclassing and paint >> messages. This will enable _LARGE_ parts of the lcl code with >> respect to the interface because we actually get messages like >> listbox insertitem etc. Speedbuttons will now also be drawn >> correctly, groupboxes are drawn correctly...etc. >> >> In wincontrol.inc I have changed the defaulthandler to send a >> message. This is still up for debate, and I don't know the effects >> on the GTK. Comments are welcome. > > I didn't found this behaviour in the VCL. So, I changed them back to > calling the DefaultHandler and added a TWinControl.DefaultHandler, > that calls the new interface procedure CallDefaultWndHandler. The > win32 interface then sends the paint message. > Please test it. We can also add an interface method of its own for > the paint message, if you like. Also: 1) make it a function to return a result

The TWinControl.DefaultHandler is a procedure and does not need and does not expect any result. The interface will better know, what a result means, so it can handle it.

2) more typing on the Message? 'const Message: TLMessage' maybe?

Messages have different size. It must be untyped.

Mattias

Reply by email

Mattias Gaertner
to Micha Nelissen: Attached is a patch to implement proper window subclassing and paint messages. This will…
Show quoted text 11 lines
Hi, Attached is a patch to implement proper window subclassing and paint messages. This will enable _LARGE_ parts of the lcl code with respect to the interface because we actually get messages like listbox insertitem etc. Speedbuttons will now also be drawn correctly, groupboxes are drawn correctly...etc. In wincontrol.inc I have changed the defaulthandler to send a message. This is still up for debate, and I don't know the effects on the GTK. Comments are welcome.

I didn't found this behaviour in the VCL. So, I changed them back to calling the DefaultHandler and added a TWinControl.DefaultHandler, that calls the new interface procedure CallDefaultWndHandler. The win32 interface then sends the paint message.
Please test it. We can also add an interface method of its own for the paint message, if you like.

Diff was taken from the root of lazarus.

yes, but not of the current cvs. For example the csSpeedbutton deletion part, was already deleted. There were 3 failed hunks. I hope I applied them correct.

Mattias

Reply by email

Micha Nelissen
to Micha Nelissen: Attached is a patch to implement proper window subclassing and paint messages. This will…
Mattias Gaertner wrote 21 lines
On Fri, 4 Jul 2003 11:36:47 +0200 "Micha Nelissen" wrote: > Hi, > > Attached is a patch to implement proper window subclassing and paint > messages. This will enable _LARGE_ parts of the lcl code with > respect to the interface because we actually get messages like > listbox insertitem etc. Speedbuttons will now also be drawn > correctly, groupboxes are drawn correctly...etc. > > In wincontrol.inc I have changed the defaulthandler to send a > message. This is still up for debate, and I don't know the effects > on the GTK. Comments are welcome. I didn't found this behaviour in the VCL. So, I changed them back to calling the DefaultHandler and added a TWinControl.DefaultHandler, that calls the new interface procedure CallDefaultWndHandler. The win32 interface then sends the paint message. Please test it. We can also add an interface method of its own for the paint message, if you like.

This patch ought to work.

Regards,

Micha.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00056.bin
Type: application/octet-stream
Size: 2110 bytes
Desc: "defaulthandler.patch"
Url : http://localhost/pipermail/lazarus/attachments/20030704/cba6ff6f/bin00056.bin

Reply by email

Mattias Gaertner
to Micha Nelissen: Attached is a patch to implement proper window subclassing and paint messages. This will…
Show quoted text 24 lines
Mattias Gaertner wrote: > On Fri, 4 Jul 2003 11:36:47 +0200 > "Micha Nelissen" wrote: > >> Hi, >> >> Attached is a patch to implement proper window subclassing and paint >> messages. This will enable _LARGE_ parts of the lcl code with >> respect to the interface because we actually get messages like >> listbox insertitem etc. Speedbuttons will now also be drawn >> correctly, groupboxes are drawn correctly...etc. >> >> In wincontrol.inc I have changed the defaulthandler to send a >> message. This is still up for debate, and I don't know the effects >> on the GTK. Comments are welcome. > > I didn't found this behaviour in the VCL. So, I changed them back to > calling the DefaultHandler and added a TWinControl.DefaultHandler, > that calls the new interface procedure CallDefaultWndHandler. The > win32 interface then sends the paint message. > Please test it. We can also add an interface method of its own for > the paint message, if you like. This patch ought to work.

Too late. I already applied the other one. Was just too busy to reply.

Mattias

Reply by email

Micha Nelissen
to Micha Nelissen: Attached is a patch to implement proper window subclassing and paint messages. This will…
Micha Nelissen wrote 27 lines
Mattias Gaertner wrote: > On Fri, 4 Jul 2003 11:36:47 +0200 > "Micha Nelissen" wrote: > >> Hi, >> >> Attached is a patch to implement proper window subclassing and paint >> messages. This will enable _LARGE_ parts of the lcl code with >> respect to the interface because we actually get messages like >> listbox insertitem etc. Speedbuttons will now also be drawn >> correctly, groupboxes are drawn correctly...etc. >> >> In wincontrol.inc I have changed the defaulthandler to send a >> message. This is still up for debate, and I don't know the effects >> on the GTK. Comments are welcome. > > I didn't found this behaviour in the VCL. So, I changed them back to > calling the DefaultHandler and added a TWinControl.DefaultHandler, > that calls the new interface procedure CallDefaultWndHandler. The > win32 interface then sends the paint message. > Please test it. We can also add an interface method of its own for > the paint message, if you like. Okay, that's good. I'd vote for handling message in the defaulthandler then, too. Patch for that is attached. Also included is a 'DoSubClass := true' for the scrolling window. Probably a failed hunk.

Sorry for that broken patch. Please disregard it.

Regards,

Micha.

Reply by email

Micha Nelissen
to Micha Nelissen: Attached is a patch to implement proper window subclassing and paint messages. This will…
Mattias Gaertner wrote 30 lines
On Fri, 4 Jul 2003 13:15:15 +0200 "Micha Nelissen" wrote: > Mattias Gaertner wrote: >> On Fri, 4 Jul 2003 11:36:47 +0200 >> "Micha Nelissen" wrote: >> >>> Hi, >>> >>> Attached is a patch to implement proper window subclassing and >>> paint messages. This will enable _LARGE_ parts of the lcl code with >>> respect to the interface because we actually get messages like >>> listbox insertitem etc. Speedbuttons will now also be drawn >>> correctly, groupboxes are drawn correctly...etc. >>> >>> In wincontrol.inc I have changed the defaulthandler to send a >>> message. This is still up for debate, and I don't know the effects >>> on the GTK. Comments are welcome. >> >> I didn't found this behaviour in the VCL. So, I changed them back to >> calling the DefaultHandler and added a TWinControl.DefaultHandler, >> that calls the new interface procedure CallDefaultWndHandler. The >> win32 interface then sends the paint message. >> Please test it. We can also add an interface method of its own for >> the paint message, if you like. > > 2) more typing on the Message? 'const Message: TLMessage' maybe? Messages have different size. It must be untyped.

But you cast it to a TLMessage anyway? To get the Msg field?

Regards,

Micha.

Reply by email

Mattias Gaertner
to Micha Nelissen: Attached is a patch to implement proper window subclassing and paint messages. This will…
Show quoted text 33 lines
Mattias Gaertner wrote: > On Fri, 4 Jul 2003 13:15:15 +0200 > "Micha Nelissen" wrote: > >> Mattias Gaertner wrote: >>> On Fri, 4 Jul 2003 11:36:47 +0200 >>> "Micha Nelissen" wrote: >>> >>>> Hi, >>>> >>>> Attached is a patch to implement proper window subclassing and >>>> paint messages. This will enable _LARGE_ parts of the lcl code with >>>> respect to the interface because we actually get messages like >>>> listbox insertitem etc. Speedbuttons will now also be drawn >>>> correctly, groupboxes are drawn correctly...etc. >>>> >>>> In wincontrol.inc I have changed the defaulthandler to send a >>>> message. This is still up for debate, and I don't know the effects >>>> on the GTK. Comments are welcome. >>> >>> I didn't found this behaviour in the VCL. So, I changed them back to >>> calling the DefaultHandler and added a TWinControl.DefaultHandler, >>> that calls the new interface procedure CallDefaultWndHandler. The >>> win32 interface then sends the paint message. >>> Please test it. We can also add an interface method of its own for >>> the paint message, if you like. >> > >> 2) more typing on the Message? 'const Message: TLMessage' maybe? > > Messages have different size. It must be untyped. But you cast it to a TLMessage anyway? To get the Msg field?

That's how messages are defined. They have the same start as TLMessage.

Mattias

Reply by email

Micha Nelissen
to Micha Nelissen: Attached is a patch to implement proper window subclassing and paint messages. This will…
Mattias Gaertner wrote 21 lines
On Fri, 4 Jul 2003 11:36:47 +0200 "Micha Nelissen" wrote: > Hi, > > Attached is a patch to implement proper window subclassing and paint > messages. This will enable _LARGE_ parts of the lcl code with > respect to the interface because we actually get messages like > listbox insertitem etc. Speedbuttons will now also be drawn > correctly, groupboxes are drawn correctly...etc. > > In wincontrol.inc I have changed the defaulthandler to send a > message. This is still up for debate, and I don't know the effects > on the GTK. Comments are welcome. I didn't found this behaviour in the VCL. So, I changed them back to calling the DefaultHandler and added a TWinControl.DefaultHandler, that calls the new interface procedure CallDefaultWndHandler. The win32 interface then sends the paint message. Please test it. We can also add an interface method of its own for the paint message, if you like.

Okay, that's good. I'd vote for handling message in the defaulthandler then, too. Patch for that is attached. Also included is a 'DoSubClass := true' for the scrolling window. Probably a failed hunk.

Regards,

Micha.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00055.bin
Type: application/octet-stream
Size: 1843 bytes
Desc: "defaulthandler.patch"
Url : http://localhost/pipermail/lazarus/attachments/20030704/25439729/bin00055.bin

Reply by email

Micha Nelissen
to Micha Nelissen: Attached is a patch to implement proper window subclassing and paint messages. This will…
Mattias Gaertner wrote 21 lines
On Fri, 4 Jul 2003 11:36:47 +0200 "Micha Nelissen" wrote: > Hi, > > Attached is a patch to implement proper window subclassing and paint > messages. This will enable _LARGE_ parts of the lcl code with > respect to the interface because we actually get messages like > listbox insertitem etc. Speedbuttons will now also be drawn > correctly, groupboxes are drawn correctly...etc. > > In wincontrol.inc I have changed the defaulthandler to send a > message. This is still up for debate, and I don't know the effects > on the GTK. Comments are welcome. I didn't found this behaviour in the VCL. So, I changed them back to calling the DefaultHandler and added a TWinControl.DefaultHandler, that calls the new interface procedure CallDefaultWndHandler. The win32 interface then sends the paint message. Please test it. We can also add an interface method of its own for the paint message, if you like.

Also:
1) make it a function to return a result
2) more typing on the Message? 'const Message: TLMessage' maybe?

Regards,

Micha.

Reply by email