Sign in Join

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

Mailing lists / lazarus / 2000-05

Form repaintis when painting speedbuton glyph

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Vincent Snijders
to Marc Weustink: + From: Shane Miller + + It could be that after I did the paint I called repaint or +…

I did give it an extra look, but stepping through the code, I didn't see a paint or invalidate.

I know this:
When I comment out the line
gdk_draw_pixmap(PDeviceContext(DestDC)^.Drawable,
PDeviceContext(DestDC)^.GC, PDeviceContext(SrcDC)^.Drawable, XSrc, YSrc, X, Y, Width, Height);
in TgtkObject.StretchBlt, the repainting doesn't happen. Of course, the glyph on the speedbutton doesn't get painted either.

I give up. :-( This is for the real developers, not for lurkers.

Vincent.

Earlier message 27 lines
----- Original Message ----- From: Marc Weustink To: Sent: Wednesday, May 03, 2000 5:05 PM Subject: RE: [lazarus] Form repaintis when painting speedbuton glyph > + From: Shane Miller > + > + It could be that after I did the paint I called repaint or > + invalidate or something. Maybe that causes it. > > Hmm... > > + Are you going to look further into it? If not, I guess I can > + look at it to see if that's the case. Problem is I do my > + development under LINUX, not windows. > > If it is a problem I can have a look, some small win32 development is > possible. > > Marc > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Vincent Snijders

Hi,

I have been looking at the problem with the speedbuttons in win32. I haven't found a solution but I know more or less what is hapening, not the reason why.

The problem is in painting the glyph on the button face. This paint action (a copyrect on a canvas) causes gtk to emit (is that the right word) an expose-event on the form and the form get repainted, which includes repainting the speedbutton etc, etc.

Commenting out
TButtonGlyph(FGlyph).Draw(Canvas, PaintRect, Offset, Caption, FLayout, FMargin, FSpacing, FState, Transparent, (0));
in the Procedure TSpeedbutton.Paint stops the repainting.

The reason why I can't solve this problem is a huge lack of knowledge on graphics (DC etc) and gtk's interface to the graphics. You might take a look at the stretchBlt function in gtkwinapi.inc. The problem might be solved there.

I hope this helps somebody.

Regards,
Vincent Snijders.

Reply by email

Marc Weustink
to Vincent Snijders
Vincent Snijders wrote 10 lines
Hi, I have been looking at the problem with the speedbuttons in win32. I haven't found a solution but I know more or less what is hapening, not the reason why. The problem is in painting the glyph on the button face. This paint action (a copyrect on a canvas) causes gtk to emit (is that the right word) an expose-event on the form and the form get repainted, which includes repainting the speedbutton etc, etc.

Hmmm.... In order to get a paint message on the first exposure of a form I generated a LM_Paint message on an expose-event. At least on Linux you don't get a paint event when a form is shown for the first time (you will get an expose).

If a draw results in an expose on the win32 platform I think it might be a bug in the libs, or I don't understand what an expose event means and it doesnt work on a Linux platform

Show quoted text 11 lines
Commenting out TButtonGlyph(FGlyph).Draw(Canvas, PaintRect, Offset, Caption, FLayout, FMargin, FSpacing, FState, Transparent, (0)); in the Procedure TSpeedbutton.Paint stops the repainting. The reason why I can't solve this problem is a huge lack of knowledge on graphics (DC etc) and gtk's interface to the graphics. You might take a look at the stretchBlt function in gtkwinapi.inc. The problem might be solved there. I hope this helps somebody.

Thanks, it gives a point to look at.

Marc

Reply by email

Marc Weustink
to Shane Miller: It could be that after I did the paint I called repaint or invalidate or something. …

+ From: Shane Miller
+
+ It could be that after I did the paint I called repaint or
+ invalidate or something. Maybe that causes it.

Hmm...

+ Are you going to look further into it? If not, I guess I can
+ look at it to see if that's the case. Problem is I do my
+ development under LINUX, not windows.

If it is a problem I can have a look, some small win32 development is possible.

Marc

Reply by email

Shane Miller

It could be that after I did the paint I called repaint or invalidate or something. Maybe that causes it.

Are you going to look further into it? If not, I guess I can look at it to see if that's the case. Problem is I do my development under LINUX, not windows. Shane

>> 05/02/00 04:53PM >>>

Hi,

I have been looking at the problem with the speedbuttons in win32. I haven't found a solution but I know more or less what is hapening, not the reason why.

The problem is in painting the glyph on the button face. This paint action (a copyrect on a canvas) causes gtk to emit (is that the right word) an expose-event on the form and the form get repainted, which includes repainting the speedbutton etc, etc.

Commenting out
TButtonGlyph(FGlyph).Draw(Canvas, PaintRect, Offset, Caption, FLayout, FMargin, FSpacing, FState, Transparent, (0));
in the Procedure TSpeedbutton.Paint stops the repainting.

The reason why I can't solve this problem is a huge lack of knowledge on graphics (DC etc) and gtk's interface to the graphics. You might take a look at the stretchBlt function in gtkwinapi.inc. The problem might be solved there.

I hope this helps somebody.

Regards,
Vincent Snijders.

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email