 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Antti Kurenniemi Guest
|
Posted: Sat May 07, 2005 8:44 am Post subject: Form painting working differently in windows XP and 2000 |
|
|
Hello.
I have an app made with D2005 Pro (upd2). In it, there is a frame containing
a TImage to which I paint some stuff. This is done by setting the main forms
OnPaint at runtime to a method of the frame (there are multiple frames, only
one is visible and painted in when the main form needs painting).
All works nicely on my development machine, which is a Windows XP Pro
system. But on a Windows 2000 machine, it works differently: resizing the
form from the bottom-right corner diagonally fires the repainting nicely,
but if I just make the form smaller in width or height, it isn't repainted!
Also, if I drag the form larger in width or height, it *is* repainted.
Anyone have any ideas, or hints as to how to figure out what's happening? I
only have access to one Windows 2000 machine at the moment, and can't do
development on it (no Delphi install possible), so I'm going to make a test
app that logs the events as they occur - is there another thing I could try?
TIA,
Antti Kurenniemi
|
|
| Back to top |
|
 |
Finn Tolderlund Guest
|
Posted: Sat May 07, 2005 12:02 pm Post subject: Re: Form painting working differently in windows XP and 2000 |
|
|
"Antti Kurenniemi" <NOantti (AT) SPAManttikPLEASE (DOT) com> skrev i en meddelelse
news:427c7ff1 (AT) newsgroups (DOT) borland.com...
| Quote: | I have an app made with D2005 Pro (upd2). In it, there is a frame
containing
a TImage to which I paint some stuff. This is done by setting the main
forms
OnPaint at runtime to a method of the frame (there are multiple frames,
only
one is visible and painted in when the main form needs painting).
All works nicely on my development machine, which is a Windows XP Pro
system. But on a Windows 2000 machine, it works differently: resizing the
form from the bottom-right corner diagonally fires the repainting nicely,
but if I just make the form smaller in width or height, it isn't
repainted!
Also, if I drag the form larger in width or height, it *is* repainted.
|
Welcome to Windows.
Different windows versions handle things differently.
I guess that also includes how and when Windows thinks that a window should
be sent a WM_PAINT message.
It also depends on various user settings, such as displaying the window
content while draggin or resizing, which you can set in Display Settings.
If you want you application always to repaint when the form is resized you
can control it yourself by handling message such as WM_SIZING and/or
WM_EXITSIZEMOVE.
Use WM_SIZING if you to repaint the form constantly as it is being resized.
This can lead to severe flickering.
Use WM_EXITSIZEMOVE if you only want to repaint the form when the resizing
is finished.
Like this:
TForm1 = class(TForm)
private
{ Private declarations }
procedure WMEXITSIZEMOVE(var Msg: TMessage); message WM_EXITSIZEMOVE;
procedure WMSIZING(var Msg: TMessage); message WM_SIZING;
procedure TForm1.WMEXITSIZEMOVE(var Msg: TMessage);
begin
Invalidate;
end;
procedure TForm1.WMSIZING(var Msg: TMessage);
begin
Invalidate;
end;
procedure TForm1.FormPaint(Sender: TObject);
begin
{ do what ever painting you want }
end;
--
Finn Tolderlund
|
|
| Back to top |
|
 |
Antti Kurenniemi Guest
|
Posted: Sat May 07, 2005 4:46 pm Post subject: Re: Form painting working differently in windows XP and 2000 |
|
|
"Finn Tolderlund" <no (AT) spam (DOT) dk> wrote
| Quote: | Welcome to Windows.
Different windows versions handle things differently.
I guess that also includes how and when Windows thinks that a window
should
be sent a WM_PAINT message.
It also depends on various user settings, such as displaying the window
content while draggin or resizing, which you can set in Display Settings.
[snip] |
Thank you, I'll give this a go and see what happens.
Antti Kurenniemi
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|