Flickering

Post Reply
User avatar
Enrico Maria Giordano
Posts: 8770
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 7 times
Contact:

Flickering

Post by Enrico Maria Giordano »

Dear friends, is there a way to get a flickering-free resize in the following sample?

Code: Select all | Expand

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    oDlg:nStyle = NOR( oDlg:nStyle, WS_THICKFRAME )

    @ 0, 0 TO 0, 0

    @ 2, 2 SAY "This is a test"

    oDlg:bResized = { || ResizeDlg( oDlg ) }

    ACTIVATE DIALOG oDlg;
             ON INIT ResizeDlg( oDlg );
             CENTER

    RETURN NIL


STATIC FUNCTION RESIZEDLG( oDlg )

    LOCAL oGrp := oDlg:aControls[ 1 ]

    oGrp:Move( 20, 20, oDlg:nWidth() - 40, oDlg:nHeight() - 60, .T. )

    RETURN NIL


Thank you in advance.

EMG
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: Flickering

Post by Colin Haig »

Hi Enrico

STATIC FUNCTION RESIZEDLG( oDlg )

LOCAL oGrp := oDlg:aControls[ 1 ]

oGrp:Hide()
oGrp:Move( 20, 20, oDlg:nWidth() - 40, oDlg:nHeight() - 60, .T. )
oGrp:Show()

RETURN NIL

Colin
User avatar
Enrico Maria Giordano
Posts: 8770
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 7 times
Contact:

Re: Flickering

Post by Enrico Maria Giordano »

Thank you. I just tried your suggestion but it's still flickering.

EMG
User avatar
nageswaragunupudi
Posts: 10733
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 11 times
Contact:

Re: Flickering

Post by nageswaragunupudi »

Group box flickers when resized.
Even when the group box is not resized, it flickers when the container window is resized.
Known issue since long.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: Flickering

Post by Antonio Linares »

Enrico,

A solution could be to "paint" the groups instead of using real group controls:

Code: Select all | Expand

#include "Fivewin.ch"

FUNCTION MAIN()

    LOCAL oDlg

    DEFINE DIALOG oDlg

    oDlg:nStyle = NOR( oDlg:nStyle, WS_THICKFRAME )

    @ 2, 2 SAY "This is a test"
   
    oDlg:bResized := { || oDlg:Refresh() }

    ACTIVATE DIALOG oDlg;
        ON PAINT WndBox( hDC, 10, 10, oDlg:nHeight() - 49, oDlg:nWidth() - 26 ) ;
        CENTER

RETURN NIL
 

This is just a test. We could use FWH nicer functions to paint the groups.

Also keep in mind that Class TSay does not use double buffer painting, so it will flicker too.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 8770
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 7 times
Contact:

Re: Flickering

Post by Enrico Maria Giordano »

Antonio Linares wrote:This is just a test. We could use FWH nicer functions to paint the groups.


That would be great.

Antonio Linares wrote:Also keep in mind that Class TSay does not use double buffer painting, so it will flicker too.


Can't you implement double buffer painting for TSay?

EMG
User avatar
nageswaragunupudi
Posts: 10733
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 11 times
Contact:

Re: Flickering

Post by nageswaragunupudi »

Group control in window can act as a container of controls also.
It has its own advantages to use group as control. We need not code ON PAINT.

Will it help to have a paint method for group control with double buffering?

By the way, TSay does not flicker when window is resized.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Enrico Maria Giordano
Posts: 8770
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 7 times
Contact:

Re: Flickering

Post by Enrico Maria Giordano »

It flickers in my sample for me.

EMG
User avatar
Otto
Posts: 6416
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 35 times
Been thanked: 2 times
Contact:

Re: Flickering

Post by Otto »

Hello,
any news on this.

Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Enrico Maria Giordano
Posts: 8770
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 7 times
Contact:

Re: Flickering

Post by Enrico Maria Giordano »

I can't reproduce the problem anymore. It seems it has been fixed somehow.

EMG
User avatar
Enrico Maria Giordano
Posts: 8770
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 7 times
Contact:

Re: Flickering

Post by Enrico Maria Giordano »

And I don't remember what I was need it for... :-(

EMG
User avatar
Otto
Posts: 6416
Joined: Fri Oct 07, 2005 7:07 pm
Has thanked: 35 times
Been thanked: 2 times
Contact:

Re: Flickering

Post by Otto »

Hello,
in my case when resizing is finished the controls flicker till they are in the right position.
Is there any solution for this.
Thanks in advance
Otto


Image

Image

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Post Reply