Flickering

Flickering

Postby Enrico Maria Giordano » Tue Jan 19, 2010 10:37 am

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

Code: Select all  Expand view  RUN
#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
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Flickering

Postby Colin Haig » Tue Jan 19, 2010 1:19 pm

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
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: Flickering

Postby Enrico Maria Giordano » Tue Jan 19, 2010 2:15 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Flickering

Postby nageswaragunupudi » Tue Jan 19, 2010 2:46 pm

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
nageswaragunupudi
 
Posts: 10681
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Re: Flickering

Postby Antonio Linares » Tue Jan 19, 2010 7:19 pm

Enrico,

A solution could be to "paint" the groups instead of using real group controls:
Code: Select all  Expand view  RUN
#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
Antonio Linares
Site Admin
 
Posts: 42149
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Flickering

Postby Enrico Maria Giordano » Tue Jan 19, 2010 10:15 pm

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
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Flickering

Postby nageswaragunupudi » Tue Jan 19, 2010 10:34 pm

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
nageswaragunupudi
 
Posts: 10681
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Flickering

Postby Enrico Maria Giordano » Tue Jan 19, 2010 11:18 pm

It flickers in my sample for me.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Flickering

Postby Otto » Mon Nov 13, 2017 7:43 am

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
Otto
 
Posts: 6353
Joined: Fri Oct 07, 2005 7:07 pm

Re: Flickering

Postby Enrico Maria Giordano » Mon Nov 13, 2017 9:31 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Flickering

Postby Enrico Maria Giordano » Mon Nov 13, 2017 9:32 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Flickering

Postby Otto » Tue Nov 14, 2017 2:05 pm

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
********************************************************************
User avatar
Otto
 
Posts: 6353
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Marc Venken and 49 guests