Sign in Join

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

Mailing lists / lazarus / 1999-09

TCanvas

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Shane Miller
Show quoted text 7 lines
> Anyone know of a good way of detecting WHEN to redraw the canvas? It is possible to block events and signals. You can put a block on it, do whatever you need to do, and then turn the block off. That way it will only do an update once after you turn the block off. I think that is what you are after isn't it?

No. But thanks. :-)
I am sending a REDRAW_THE_CANVAS message right now. I don't like that. See, in Windows, when I write a bunch of characters to the canvas, it doesn't redraw after each character, or if it does, it stops the redraw once you write to it again because it's fast.

Under Linux, I am telling it to redraw when I'm done sending all the text. There must be a method in Windows for controlling this, like only draw the canvas (if needed) every 500 ms or something. If I write 200 characters to the canvas, I don't want it to actually update the screen until
1) I'm done drawing
or
2) There is a pause in the drawing..

------------------------------------------------------------ Shane Miller

Get paid to surf the net!
http://alladvantage.com/go.asp?refid=DEX-870

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.miraclec.com/lazarus
----------------------------------------------------------

Earlier message 28 lines
-----Original Message----- From: Michael A. Hess To: Date: Sunday, September 12, 1999 7:36 PM Subject: Re: [lazarus] TCanvas >Shane Miller wrote: >> >> Anyone know of a good way of detecting WHEN to redraw the canvas? > >It is possible to block events and signals. You can put a block on it, >do whatever you need to do, and then turn the block off. That way it >will only do an update once after you turn the block off. I think that >is what you are after isn't it? > > >-- >==== Programming my first best destiny! ==== > >Michael A. Hess Miracle Concepts, Inc. > http://www.miraclec.com > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Samuel Liddicott
to Shane Miller
Show quoted text 11 lines
-----Original Message----- From: Shane Miller Sent: Monday, September 13, 1999 05:53 AM To: Subject: Re: [lazarus] TCanvas I am sending a REDRAW_THE_CANVAS message right now. I don't like that. See, in Windows, when I write a bunch of characters to the canvas, it doesn't redraw after each character, or if it does, it stops the redraw once you write to it again because it's fast.

In windows, when uou write characters to the canvas it is an instantaneous change to that canvas. The canvas is a context of some actual device, either the screen, or a bitmap or a metafile.

If the canvas is a screen canvas then the changes take place on screen. The operation is just a *change* and anything that may have already been there is not re-done.

Generally screen canvas's are painted in response to a WM_PAINT message. Any canvas paints which are done in other circumstances are non-permanant changes and will not be there next time the screen is pained because of WM_PAINT. (Usually there is nothing persistant about a screen image). A few controls do paint outside of WM_PAINT, mainly where: a) There are lots of small changes in a small area b) These small changes are also included in the WM_PAINT updates

examples are TEDIT and TMEMO controls.

Show quoted text 8 lines
Under Linux, I am telling it to redraw when I'm done sending all the text. There must be a method in Windows for controlling this, like only draw the canvas (if needed) every 500 ms or something. If I write 200 characters to the canvas, I don't want it to actually update the screen until 1) I'm done drawing or 2) There is a pause in the drawing..

In delphi, this is what InvalidateWindow is for.
Refresh is an Invalidate+Update which is not what you want.

A mere InvalidateWindow will tell windows that the window needs painting. Then, when there are no more other messages, windows will send out the WM_PAINT and then the window is painted.

The general method from your point of view is probably NOT to paint the window in response to key-strokes and stuff, but to instead update edit buffers and other structures so that when the paint message comes along you can paint the invalid'd region of the window.

Maybe GTK doesn't support idle anyway, but [I hate to say it] lots of Delphi stuff relies on it, so we should simulate it some way.

Does this make sense?

Sam

Reply by email

Shane Miller

Anyone know of a good way of detecting WHEN to redraw the canvas? I don't want to redraw it each time it changes because if I write to it 200 times in a row, I don't want it to redraw 200 times. I want it to redraw after it's idle.

I thought of making each canvas have a timer in it that's reset on any type of drawing to the canvas, but that's kind of a generic method...

Thoughts...?
------------------------------------------------------------ Shane Miller

Get paid to surf the net!
http://alladvantage.com/go.asp?refid=DEX-870

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.miraclec.com/lazarus
----------------------------------------------------------

Earlier message 46 lines
-----Original Message----- From: Curtis White To: Date: Sunday, September 12, 1999 3:46 PM Subject: Re: [lazarus] Q: Current progress >Michael, > >I was looking at the Notebook stuff and there is a fair amount involved with >moving it from the IntSendMessage2 function to the new IntSendMessage3 >function. I am working on it now. So you won't have to worry about migrating it >(it is taking a fair amount of work but will be much cleaner) to the new >IntSendMessage3 function. I should have it done in a little while and I will >commit it to CVS. That should fix the notebook code and then I can get going on >the TClipboard code again. > >I will leave moving it to its own directory to you, though :-) > > >Curtis > >On 12-Sep-99 Michael A. Hess wrote: >> Curtis White wrote: >>> >>> It isn't working correctly any more and I am guessing that it is >>> because it is in the middle of being moved to the new gtkint functions >>> (I haven't checked anything to see why). >> >> I only just cycled a new compiler and update Lazarus myself last night >> for the first since before I went on vacation which was 4 weeks ago. :-\ >> >> I hope to get the gtkint stuff moved over into the separate directory >> this week and cleanup the remaining code. I keep the list posted. >> > > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Michael A. Hess
to Shane Miller
Shane Miller wrote
Anyone know of a good way of detecting WHEN to redraw the canvas?

It is possible to block events and signals. You can put a block on it, do whatever you need to do, and then turn the block off. That way it will only do an update once after you turn the block off. I think that is what you are after isn't it?

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email