Sign in Join

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

Mailing lists / lazarus / 2003-09

Patch win32 intf/lcl: brush init

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Micha Nelissen
to Micha Nelissen: It seems sometimes the brush is not initialized when referenced in win32callback.…
Mattias Gaertner wrote 31 lines
On Thu, 25 Sep 2003 15:17:23 +0200 "Marc Weustink" wrote: >+ From: Micha Nelissen >+ Sent: donderdag 25 september 2003 8:01 >+ To: >+ Subject: [lazarus] Patch win32 intf/lcl: brush init >+ >+ >+ Hi, >+ >+ It seems sometimes the brush is not initialized when referenced in >+ win32callback. Therefore I had to move the CreateBrush method from >+ protected to public and call it. Attached is a patch for this, apply in >+ lcl/. > >Hmm... I don't know it this is the correct way to do it. I don't like the >idea that the interface it creating object for the LCL. The LCL should >handle that itself. > >+ It's also possible to write a GetBrush method to initialize on demand. > >That is a better way. > >In Delphi the Wincontrol.Brush is always created. In the LCL it is by >default nil since onle a few components need it. In that case we need a >GetBrush to create it Dynamic. Or BrushNeeded.

Isn't that the same as calling CreateBrush? Ie. as it is now?

Regards,

Micha.

Reply by email

Marc Weustink
to Mattias Gaertner: On Thu, 25 Sep 2003 15:17:23 +0200 Or BrushNeeded. Mattias

+ From: Mattias Gaertner
+ Sent: donderdag 25 september 2003 17:25
+
+ On Thu, 25 Sep 2003 15:17:23 +0200
+ "Marc Weustink" wrote:
+
+ > + From: Micha Nelissen
+ > + Sent: donderdag 25 september 2003 8:01
+ > + To:
+ > + Subject: [lazarus] Patch win32 intf/lcl: brush init
+ > +
+ > +
+ > + Hi,

[Snip]
+ >
+ > + It's also possible to write a GetBrush method to initialize
+ > on demand.
+ >
+ > That is a better way.
+ >
+ > In Delphi the Wincontrol.Brush is always created. In the LCL it is by
+ > default nil since onle a few components need it. In that case
+ > we need a GetBrush to create it Dynamic.
+
+ Or BrushNeeded.

That's something internal.

You need a GetBrush anyhow as reader for the Brush property. Now it reads FBrush.

As a user, if I need the public Wincontrol.Brush, I don't want to get annoyed with an extra call to BrushNeeded by me :)

Marc

Reply by email

Marc Weustink
to Micha Nelissen: It seems sometimes the brush is not initialized when referenced in win32callback.…

+ From: Micha Nelissen
+ Sent: donderdag 25 september 2003 8:01
+ To:
+ Subject: [lazarus] Patch win32 intf/lcl: brush init +
+
+ Hi,
+
+ It seems sometimes the brush is not initialized when referenced in
+ win32callback. Therefore I had to move the CreateBrush method from
+ protected to public and call it. Attached is a patch for this, apply in
+ lcl/.

Hmm... I don't know it this is the correct way to do it. I don't like the idea that the interface it creating object for the LCL. The LCL should handle that itself.

+ It's also possible to write a GetBrush method to initialize on demand.

That is a better way.

In Delphi the Wincontrol.Brush is always created. In the LCL it is by default nil since onle a few components need it. In that case we need a GetBrush to create it Dynamic.

Marc

Reply by email

Mattias Gaertner
to Micha Nelissen: It seems sometimes the brush is not initialized when referenced in win32callback.…
Show quoted text 24 lines
+ From: Micha Nelissen + Sent: donderdag 25 september 2003 8:01 + To: + Subject: [lazarus] Patch win32 intf/lcl: brush init + + + Hi, + + It seems sometimes the brush is not initialized when referenced in + win32callback. Therefore I had to move the CreateBrush method from + protected to public and call it. Attached is a patch for this, apply in + lcl/. Hmm... I don't know it this is the correct way to do it. I don't like the idea that the interface it creating object for the LCL. The LCL should handle that itself. + It's also possible to write a GetBrush method to initialize on demand. That is a better way. In Delphi the Wincontrol.Brush is always created. In the LCL it is by default nil since onle a few components need it. In that case we need a GetBrush to create it Dynamic.

Or BrushNeeded.

Mattias

Reply by email

Micha Nelissen

Hi,

It seems sometimes the brush is not initialized when referenced in win32callback. Therefore I had to move the CreateBrush method from protected to public and call it. Attached is a patch for this, apply in lcl/.

It's also possible to write a GetBrush method to initialize on demand.

Regards,

Micha.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00071.bin
Type: application/octet-stream
Size: 777 bytes
Desc: "brush.patch.gz"
Url : http://localhost/pipermail/lazarus/attachments/20030925/995af963/bin00071.bin

Reply by email

Mattias Gaertner
to Mattias Gaertner: On Thu, 25 Sep 2003 15:17:23 +0200 Or BrushNeeded. Mattias
Show quoted text 34 lines
+ From: Mattias Gaertner + Sent: donderdag 25 september 2003 17:25 + + On Thu, 25 Sep 2003 15:17:23 +0200 + "Marc Weustink" wrote: + + > + From: Micha Nelissen + > + Sent: donderdag 25 september 2003 8:01 + > + To: + > + Subject: [lazarus] Patch win32 intf/lcl: brush init + > + + > + + > + Hi, [Snip] + > + > + It's also possible to write a GetBrush method to initialize + > on demand. + > + > That is a better way. + > + > In Delphi the Wincontrol.Brush is always created. In the LCL it is by + > default nil since onle a few components need it. In that case + > we need a GetBrush to create it Dynamic. + + Or BrushNeeded. That's something internal. You need a GetBrush anyhow as reader for the Brush property. Now it reads FBrush. As a user, if I need the public Wincontrol.Brush, I don't want to get annoyed with an extra call to BrushNeeded by me :)

Implemented GetBrush.

Mattias

Reply by email