Re: [Lazarus] flickering on statusbar panel

2009-03-03 Thread Andrea Mauri
I saw that the bug (ID 0012816) related to this thread has been closed.
But I still encounter the same problem as described in my first e-mail. 
The statusbar panel still flickers.
Andrea

Sergei Gorelkin ha scritto:
> Michael Van Canneyt wrote:
>
>   
>> As far as I know, in Delphi the statusbar updates immediatly, contrary to a 
>> label.
>>
>> 
> There is a bug in VCL that causes statusbars flicker. It can be fixed by 
> something like not passing WM_ERASEBKGND to DefWindowProc ("something 
> like" is because it was a long time ago, and I cannot remember exactly). 
> All common controls are doublebuffered natively by Windows, so they 
> shouldn't flicker even without doublebuffering in LCL.
>
> Regards,
> Sergei
> ___
> Lazarus mailing list
> Lazarus@lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>   

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-19 Thread Sergei Gorelkin
Michael Van Canneyt wrote:

> As far as I know, in Delphi the statusbar updates immediatly, contrary to a 
> label.
> 
There is a bug in VCL that causes statusbars flicker. It can be fixed by 
something like not passing WM_ERASEBKGND to DefWindowProc ("something 
like" is because it was a long time ago, and I cannot remember exactly). 
All common controls are doublebuffered natively by Windows, so they 
shouldn't flicker even without doublebuffering in LCL.

Regards,
Sergei
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-19 Thread Michael Van Canneyt


On Fri, 19 Dec 2008, Mattias Gaertner wrote:

> On Fri, 19 Dec 2008 11:52:18 +0100
> Andrea Mauri  wrote:
> 
> > The code I wrote in the e-mail is just a sample!
> > Anyway, create a new project, drop a label, a statusbar and a button
> > on the form. Create a panel on the statusbar.
> > On buttonclick drop the following code:
> > 
> > procedure TForm1.Button1Click(Sender: TObject);
> > var
> > i: integer;
> > begin
> > i:= 0;
> > while i < 1 do
> > begin
> > //  Application.ProcessMessages;
> >   label1.Caption:= Format('Number: %d', [i]);
> >   statusbar1.Panels[0].Text:= Format('Number: %d', [i]);
> >   Inc(i);
> > end;   
> > 
> > Clicking on the button the text in the statusbar panel start to be 
> > updated, and it flickers. The text in the caption is updated only at
> > the end of the while do cycle.
> 
> Great. There you have the bug. The statusbar should not update, just
> like the label.

As far as I know, in Delphi the statusbar updates immediatly, contrary to a 
label.

Michael.
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-19 Thread Andrea Mauri
Bug report created.
Andrae

Mattias Gaertner ha scritto:
> On Fri, 19 Dec 2008 11:52:18 +0100
> Andrea Mauri  wrote:
>
>   
>> The code I wrote in the e-mail is just a sample!
>> Anyway, create a new project, drop a label, a statusbar and a button
>> on the form. Create a panel on the statusbar.
>> On buttonclick drop the following code:
>>
>> procedure TForm1.Button1Click(Sender: TObject);
>> var
>> i: integer;
>> begin
>> i:= 0;
>> while i < 1 do
>> begin
>> //  Application.ProcessMessages;
>>   label1.Caption:= Format('Number: %d', [i]);
>>   statusbar1.Panels[0].Text:= Format('Number: %d', [i]);
>>   Inc(i);
>> end;   
>>
>> Clicking on the button the text in the statusbar panel start to be 
>> updated, and it flickers. The text in the caption is updated only at
>> the end of the while do cycle.
>> 
>
> Great. There you have the bug. The statusbar should not update, just
> like the label.
>
>
>   
>> If I uncomment the line Application.ProcessMessages both texts in
>> label and in statusbar panel are updated during the while do cycle.
>> The text in the label does not flicker while the text in the
>> statusbar panel flickers.
>> 
>
> It probably flickers because of above bug.
>
>
>   
>> I tested it on WinXP with lazarus v0.9.27 r17856
>> i386-win32-win32/win64 and fpc 2.2.2
>> The same code works on Linux with lazarus svn and fpc 2.2.2
>> (statusbar and label do not flicker).
>> I hope that I well explained the problem.
>> 
>
> Yes, although I'm not a win32 intf developer. Please create a bug
> report with the above example.
>
>
> Mattias
> ___
> Lazarus mailing list
> Lazarus@lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>   

-- 
Dr. Andrea Mauri, PhD
Milano Chemometrics and QSAR Research Group
Department of Environmental Sciences
University of Milano-Bicocca 
P.zza della Scienza, 1
20126 Milano - Italy

Tel: ++39 02 64482801
mailto:andrea.mauri...@gmail.com
http://michem.disat.unimib.it/chm/ 

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-19 Thread Mattias Gaertner
On Fri, 19 Dec 2008 11:52:18 +0100
Andrea Mauri  wrote:

> The code I wrote in the e-mail is just a sample!
> Anyway, create a new project, drop a label, a statusbar and a button
> on the form. Create a panel on the statusbar.
> On buttonclick drop the following code:
> 
> procedure TForm1.Button1Click(Sender: TObject);
> var
> i: integer;
> begin
> i:= 0;
> while i < 1 do
> begin
> //  Application.ProcessMessages;
>   label1.Caption:= Format('Number: %d', [i]);
>   statusbar1.Panels[0].Text:= Format('Number: %d', [i]);
>   Inc(i);
> end;   
> 
> Clicking on the button the text in the statusbar panel start to be 
> updated, and it flickers. The text in the caption is updated only at
> the end of the while do cycle.

Great. There you have the bug. The statusbar should not update, just
like the label.


> If I uncomment the line Application.ProcessMessages both texts in
> label and in statusbar panel are updated during the while do cycle.
> The text in the label does not flicker while the text in the
> statusbar panel flickers.

It probably flickers because of above bug.


> I tested it on WinXP with lazarus v0.9.27 r17856
> i386-win32-win32/win64 and fpc 2.2.2
> The same code works on Linux with lazarus svn and fpc 2.2.2
> (statusbar and label do not flicker).
> I hope that I well explained the problem.

Yes, although I'm not a win32 intf developer. Please create a bug
report with the above example.


Mattias
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-19 Thread Andrea Mauri

The code I wrote in the e-mail is just a sample!
Anyway, create a new project, drop a label, a statusbar and a button on 
the form. Create a panel on the statusbar.

On buttonclick drop the following code:

procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
begin
i:= 0;
while i < 1 do
begin
//  Application.ProcessMessages;
 label1.Caption:= Format('Number: %d', [i]);
 statusbar1.Panels[0].Text:= Format('Number: %d', [i]);
 Inc(i);
end;   

Clicking on the button the text in the statusbar panel start to be 
updated, and it flickers. The text in the caption is updated only at the 
end of the while do cycle.
If I uncomment the line Application.ProcessMessages both texts in label 
and in statusbar panel are updated during the while do cycle. The text 
in the label does not flicker while the text in the statusbar panel 
flickers.
I tested it on WinXP with lazarus v0.9.27 r17856 i386-win32-win32/win64 
and fpc 2.2.2
The same code works on Linux with lazarus svn and fpc 2.2.2 (statusbar 
and label do not flicker).

I hope that I well explained the problem.
Best regards,
Andrea


Reenen Laurie ha scritto:

i:= 0;
while condition do
begin
 readln(f, str);
 label1.Caption:= Format('Number: %d', [i]);
 statusbar1.Panels[0].Text:= Format('Number: %d', [i]);
 Inc(i);
end;

If condition stays true, then statusbar will flicker continuously... 
(being updated continuously)


you don't have an "exit" condition here (like "while not EOF(F) do")

Maybe this will help?

Also, just for information:
Which OS are you on, which version of that OS and which SVN version 
(or Lazarus release version)?


Regards,
-Reenen



On Fri, Dec 19, 2008 at 11:17 AM, Andrea Mauri 
mailto:andrea.mauri...@gmail.com>> wrote:



Mattias Gaertner ha scritto:
> On Thu, 18 Dec 2008 14:58:58 +0100
> Andrea Mauri mailto:andrea.mauri...@gmail.com>> wrote:
>
>
>> But why, same monitor, same application, labels do not flicker
while
>> statusbar flickers?
>>
>
> If statusbar text and properties do not change and it still flickers
> when it is repainted, then there is a bug in the double buffering.
> Please create a bug report.
>
> Mattias
>

As I wrote in my first e-mail in this thread the statusbar
flickers when
the text changes.
This is what I wrote in my first e-mail:

"
Dear all,
I encountered a flickering problem when using a statusbar under winxp
(lazarus v0.9.27 r17839 i386-win32-win32/win64 fpc 2.2.2)
Using a code similar to the following:

i:= 0;
while condition do
begin
 readln(f, str);
 label1.Caption:= Format('Number: %d', [i]);
 statusbar1.Panels[0].Text:= Format('Number: %d', [i]);
 Inc(i);
end;

The text in the status bar panel flickers a lot while the same text in
the label does not flicker.
On Linux Ubuntu also the statusbar works fine.
Another issue, but I am not sure because I made just some few
tests, it
seems that writing on the statusbar is a little slower than
writing on a
label.
"

So the text changes (not all the text, 'Number: ' string is fixed)
in the statusbar, no other properties change.
I encounter this problem only on windows. Labels work properly.
Confirm that I have to create a bug report.
Thanks,
Andrea


> ___
> Lazarus mailing list
> Lazarus@lazarus.freepascal.org

> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>

--
Dr. Andrea Mauri, PhD
Milano Chemometrics and QSAR Research Group
Department of Environmental Sciences
University of Milano-Bicocca
P.zza della Scienza, 1
20126 Milano - Italy

Tel: ++39 02 64482801
mailto:andrea.mauri...@gmail.com 
http://michem.disat.unimib.it/chm/

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org 
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus




--
o__
,_.>/ _
(_)_\(_)___
...speed is good
___
I believe five out of four people have a problem with fractions.


___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
  


--
Dr. Andrea Mauri, PhD
Milano Chemometrics and QSAR Research Group
Department of Environmental Sciences
University of Milano-Bicocca 
P.zza della Scienza, 1

20126 Milano - Italy

Tel: ++39 02 64482801
mailto:andrea.mauri...@gmail.com
http://michem.disat.unimib.it/chm/ 

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-19 Thread Reenen Laurie
i:= 0;
while condition do
begin
 readln(f, str);
 label1.Caption:= Format('Number: %d', [i]);
 statusbar1.Panels[0].Text:= Format('Number: %d', [i]);
 Inc(i);
end;

If condition stays true, then statusbar will flicker continuously... (being
updated continuously)

you don't have an "exit" condition here (like "while not EOF(F) do")

Maybe this will help?

Also, just for information:
Which OS are you on, which version of that OS and which SVN version (or
Lazarus release version)?

Regards,
-Reenen



On Fri, Dec 19, 2008 at 11:17 AM, Andrea Mauri wrote:

>
> Mattias Gaertner ha scritto:
> > On Thu, 18 Dec 2008 14:58:58 +0100
> > Andrea Mauri  wrote:
> >
> >
> >> But why, same monitor, same application, labels do not flicker while
> >> statusbar flickers?
> >>
> >
> > If statusbar text and properties do not change and it still flickers
> > when it is repainted, then there is a bug in the double buffering.
> > Please create a bug report.
> >
> > Mattias
> >
>
> As I wrote in my first e-mail in this thread the statusbar flickers when
> the text changes.
> This is what I wrote in my first e-mail:
>
> "
> Dear all,
> I encountered a flickering problem when using a statusbar under winxp
> (lazarus v0.9.27 r17839 i386-win32-win32/win64 fpc 2.2.2)
> Using a code similar to the following:
>
> i:= 0;
> while condition do
> begin
>  readln(f, str);
>  label1.Caption:= Format('Number: %d', [i]);
>  statusbar1.Panels[0].Text:= Format('Number: %d', [i]);
>  Inc(i);
> end;
>
> The text in the status bar panel flickers a lot while the same text in
> the label does not flicker.
> On Linux Ubuntu also the statusbar works fine.
> Another issue, but I am not sure because I made just some few tests, it
> seems that writing on the statusbar is a little slower than writing on a
> label.
> "
>
> So the text changes (not all the text, 'Number: ' string is fixed) in the
> statusbar, no other properties change.
> I encounter this problem only on windows. Labels work properly.
> Confirm that I have to create a bug report.
> Thanks,
> Andrea
>
>
> > ___
> > Lazarus mailing list
> > Lazarus@lazarus.freepascal.org
> > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
> >
> >
>
> --
> Dr. Andrea Mauri, PhD
> Milano Chemometrics and QSAR Research Group
> Department of Environmental Sciences
> University of Milano-Bicocca
> P.zza della Scienza, 1
> 20126 Milano - Italy
>
> Tel: ++39 02 64482801
> mailto:andrea.mauri...@gmail.com
> http://michem.disat.unimib.it/chm/
>
> ___
> Lazarus mailing list
> Lazarus@lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>



-- 
o__
,_.>/ _
(_)_\(_)___
...speed is good
___
I believe five out of four people have a problem with fractions.
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-19 Thread Andrea Mauri

Mattias Gaertner ha scritto:
> On Thu, 18 Dec 2008 14:58:58 +0100
> Andrea Mauri  wrote:
>
>   
>> But why, same monitor, same application, labels do not flicker while 
>> statusbar flickers?
>> 
>
> If statusbar text and properties do not change and it still flickers
> when it is repainted, then there is a bug in the double buffering.
> Please create a bug report.
>
> Mattias
>   

As I wrote in my first e-mail in this thread the statusbar flickers when 
the text changes.
This is what I wrote in my first e-mail:

"
Dear all,
I encountered a flickering problem when using a statusbar under winxp 
(lazarus v0.9.27 r17839 i386-win32-win32/win64 fpc 2.2.2)
Using a code similar to the following:

i:= 0;
while condition do
begin
  readln(f, str);
  label1.Caption:= Format('Number: %d', [i]);
  statusbar1.Panels[0].Text:= Format('Number: %d', [i]);
  Inc(i);
end;

The text in the status bar panel flickers a lot while the same text in 
the label does not flicker.
On Linux Ubuntu also the statusbar works fine.
Another issue, but I am not sure because I made just some few tests, it 
seems that writing on the statusbar is a little slower than writing on a 
label.
"

So the text changes (not all the text, 'Number: ' string is fixed) in the 
statusbar, no other properties change.
I encounter this problem only on windows. Labels work properly.
Confirm that I have to create a bug report.
Thanks,
Andrea


> ___
> Lazarus mailing list
> Lazarus@lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>   

-- 
Dr. Andrea Mauri, PhD
Milano Chemometrics and QSAR Research Group
Department of Environmental Sciences
University of Milano-Bicocca 
P.zza della Scienza, 1
20126 Milano - Italy

Tel: ++39 02 64482801
mailto:andrea.mauri...@gmail.com
http://michem.disat.unimib.it/chm/ 

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-18 Thread Mattias Gaertner
On Thu, 18 Dec 2008 14:58:58 +0100
Andrea Mauri  wrote:

> But why, same monitor, same application, labels do not flicker while 
> statusbar flickers?

If statusbar text and properties do not change and it still flickers
when it is repainted, then there is a bug in the double buffering.
Please create a bug report.

Mattias
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-18 Thread Andrea Mauri
But why, same monitor, same application, labels do not flicker while 
statusbar flickers?
Andrea

Mattias Gärtner ha scritto:
> Zitat von Andrea Mauri :
>
>   
>> Yes, but the flickering remains both with DoubleBuffered:= True and
>> DoubleBuffered:= False.
>> The only difference is that using DoubleBuffered:= True the statusbar
>> seems to be repainted faster.
>> 
>
> TWinControl.DoubleBuffered can only fix the flickering when repainting the 
> same
> (erasing plus painting the same content as the last time).
> It can not fix the flickering when the text on the statusbar changes. To fix
> this flickering your painting must be in sync with your monitor. See the
> vertical sync option for your graphic card.
>
>
> Mattias
>
> ___
> Lazarus mailing list
> Lazarus@lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>   

-- 
Dr. Andrea Mauri, PhD
Milano Chemometrics and QSAR Research Group
Department of Environmental Sciences
University of Milano-Bicocca 
P.zza della Scienza, 1
20126 Milano - Italy

Tel: ++39 02 64482801
mailto:andrea.mauri...@gmail.com
http://michem.disat.unimib.it/chm/ 

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-18 Thread Mattias Gärtner
Zitat von Andrea Mauri :

> Yes, but the flickering remains both with DoubleBuffered:= True and
> DoubleBuffered:= False.
> The only difference is that using DoubleBuffered:= True the statusbar
> seems to be repainted faster.

TWinControl.DoubleBuffered can only fix the flickering when repainting the same
(erasing plus painting the same content as the last time).
It can not fix the flickering when the text on the statusbar changes. To fix
this flickering your painting must be in sync with your monitor. See the
vertical sync option for your graphic card.


Mattias

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-18 Thread Andrea Mauri
Yes, but the flickering remains both with DoubleBuffered:= True and 
DoubleBuffered:= False.
The only difference is that using DoubleBuffered:= True the statusbar 
seems to be repainted faster.
Andrea

Bart ha scritto:
> On 12/17/08, Andrea Mauri  wrote:
>   
>> any suggestions?
>> 
>
> Does TStatusBar have a DoubleBuffer property (I cannot test here at
> this place: no Lazarus available)
>
> Bart
> ___
> Lazarus mailing list
> Lazarus@lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>   

-- 
Dr. Andrea Mauri, PhD
Milano Chemometrics and QSAR Research Group
Department of Environmental Sciences
University of Milano-Bicocca 
P.zza della Scienza, 1
20126 Milano - Italy

Tel: ++39 02 64482801
mailto:andrea.mauri...@gmail.com
http://michem.disat.unimib.it/chm/ 

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-18 Thread Bart
On 12/17/08, Andrea Mauri  wrote:
> any suggestions?

Does TStatusBar have a DoubleBuffer property (I cannot test here at
this place: no Lazarus available)

Bart
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] flickering on statusbar panel

2008-12-17 Thread Andrea Mauri
any suggestions?

Andrea Mauri ha scritto:
> Dear all,
> I encountered a flickering problem when using a statusbar under winxp 
> (lazarus v0.9.27 r17839 i386-win32-win32/win64 fpc 2.2.2)
> Using a code similar to the following:
>
> i:= 0;
> while condition do
> begin
>   readln(f, str);
>   label1.Caption:= Format('Number: %d', [i]);
>   statusbar1.Panels[0].Text:= Format('Number: %d', [i]);
>   Inc(i);
> end;
>
> The text in the status bar panel flickers a lot while the same text in 
> the label does not flicker.
> On Linux Ubuntu also the statusbar works fine.
> Another issue, but I am not sure because I made just some few tests, it 
> seems that writing on the statusbar is a little slower than writing on a 
> label.
> Regards,
> Andrea
> ___
> Lazarus mailing list
> Lazarus@lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>   

-- 
Dr. Andrea Mauri, PhD
Milano Chemometrics and QSAR Research Group
Department of Environmental Sciences
University of Milano-Bicocca 
P.zza della Scienza, 1
20126 Milano - Italy

Tel: ++39 02 64482801
mailto:andrea.mauri...@gmail.com
http://michem.disat.unimib.it/chm/ 

___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] flickering on statusbar panel

2008-12-15 Thread Andrea Mauri
Dear all,
I encountered a flickering problem when using a statusbar under winxp 
(lazarus v0.9.27 r17839 i386-win32-win32/win64 fpc 2.2.2)
Using a code similar to the following:

i:= 0;
while condition do
begin
  readln(f, str);
  label1.Caption:= Format('Number: %d', [i]);
  statusbar1.Panels[0].Text:= Format('Number: %d', [i]);
  Inc(i);
end;

The text in the status bar panel flickers a lot while the same text in 
the label does not flicker.
On Linux Ubuntu also the statusbar works fine.
Another issue, but I am not sure because I made just some few tests, it 
seems that writing on the statusbar is a little slower than writing on a 
label.
Regards,
Andrea
___
Lazarus mailing list
Lazarus@lazarus.freepascal.org
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus