Page 2 of 3

Re: Dialog controls are flickering when resized..

Posted: Mon Jun 07, 2010 9:48 am
by fraxzi
Dear Mr. Antonio,

In my recent sample above.. SAY, GET and GROUPBOX are flickering.
It is strange.


Regards,
Frances

Re: Dialog controls are flickering when resized..

Posted: Mon Jun 07, 2010 10:52 am
by James Bott
Antonio,

Could you implement double-buffering in TControl so all the controls inherit it?

James

Re: Dialog controls are flickering when resized..

Posted: Wed Jun 09, 2010 7:59 am
by fraxzi
Dear Mr. Antonio,

Can this be possible? any workaround I can start with?


Regards,
Frances

Re: Dialog controls are flickering when resized..

Posted: Tue Jun 19, 2018 3:39 am
by fraxzi
Hi All,

A long time ago...

Today with FWH1804 (latest build), still struggling how redefined dialog (with its controls) not to flicker on MDI Child window... :?: :?: :?:

When I resize the MDI Child Window... everything on it flickers...

Perhaps I am missing a new technique :?: :?: :?:

Re: Dialog controls are flickering when resized..

Posted: Tue Jun 19, 2018 9:12 am
by Otto
Hello Frances,
can you try to remove manifest for testing purpose.
Is it still flickering.
Thank you and best regards,
Otto

Re: Dialog controls are flickering when resized..

Posted: Tue Jun 19, 2018 10:01 am
by nageswaragunupudi
fraxzi wrote:Dear All,

As with the above..

When I resize Dialog controls are flickering with backround gradient..

Code: Select all | Expand


   DEFINE DIALOG oDlg TRANSPARENT

     
          ...standard controls here..  say, get, folder, xbrowse...

          oDlg:SetBrush( TBrush():New()  )


   ACTIVATE DIALOG oDlg NOWAIT;
            ON PAINT uDialogGradient( hDC, oDlg, { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }, .F. )

....


FUNCTION uDialogGradient( hDC, oDlg, aGrad, lPos )

 GradientFill( hDC,  0, 0, oDlg:nHeight, oDlg:nWidth, aGrad, lPos )
 ReleaseDC( hDC )

RETURN NIL
 



Any thoughts?

Regards,
Frances


First, let us handle the case of simple dialog.
Please run this sample. Try resizing the dialog and you will not find any flickering.

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oDlg, oBrw, oFont, oBrush
   local aGet[ 3 ], aVar := { "Hello World        ", 2345678, Date() }

   USE CUSTOMER
   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14

   DEFINE BRUSH oBrush GRADIENT { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }
   DEFINE DIALOG oDlg SIZE 800,600 PIXEL TRUEPIXEL FONT oFont BRUSH oBrush TRANSPARENT RESIZABLE

   @  20,20 GROUP TO 180,400 PIXEL OF oDlg

   @  40,40 SAY "Try Resizing this Dialog" SIZE 300,20 PIXEL OF oDlg

   @  70,40 GET aGet[ 1 ] VAR aVar[ 1 ] SIZE 300,24 PIXEL OF oDlg
   @ 110,40 GET aGet[ 2 ] VAR aVar[ 2 ] SIZE 100,24 PIXEL OF oDlg
   @ 140,40 GET aGet[ 3 ] VAR aVar[ 3 ] SIZE 100,24 PIXEL OF oDlg

   @ 200,40 XBROWSE oBrw SIZE 400,200 PIXEL OF oDlg DATASOURCE "CUSTOMER" ;
      AUTOCOLS CELL LINES NOBORDER
   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont
   RELEASE BRUSH oBrush

return nil
 

Please let me know if you experience any flickering while resizing.

Re: Dialog controls are flickering when resized..

Posted: Tue Jun 19, 2018 10:39 am
by byte-one
You should not call uDialogGradient( hDC, oDlg, { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }, .F. ) in ON PAINT. Every change of size from dialog call ON PAINT and so every move from 1 pixel the function is called. -> And dialog is flickering!

Re: Dialog controls are flickering when resized..

Posted: Tue Jun 19, 2018 1:11 pm
by nageswaragunupudi
MDI

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oWnd, oBar

   DEFINE WINDOW oWnd MDI
   DEFINE BUTTONBAR oBar of oWnd 2007
   DEFINE BUTTON OF oBar ACTION DialogOnMDIChild()

   ACTIVATE WINDOW oWnd MAXIMIZED

return nil

function DialogOnMDIChild()

   local oWnd, oDlg, oBrush, oFont, oGet
   local cGet := 'themed apps'

   DEFINE BRUSH oBrush GRADIENT { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }
   DEFINE WINDOW oWnd MDICHILD OF WndMain() BRUSH oBrush
   RELEASE BRUSH oBrush
   ACTIVATE WINDOW oWnd ON INIT BuildDialog( oWnd )

return nil

function BuildDialog( oWnd )

   local oDlg, oFont, oGet
   local cGet := "Hello World     "

   DEFINE FONT oFont NAME "Verdana" SIZE 0, -16
   DEFINE DIALOG oDlg RESOURCE 'DLG_CONTENT' OF oWnd FONT oFont
   RELEASE FONT oFont

//   REDEFINE GROUP ID 1001 OF oDlg TRANSPARENT
   REDEFINE SAY ID 1003 OF oDlg TRANSPARENT
   REDEFINE SAY ID 1004 OF oDlg TRANSPARENT
   REDEFINE GET oGet VAR cGet ID 1002 OF oDlg UPDATE

   ACTIVATE DIALOG oDlg NOWAIT ON INIT ( ChangeParent( oDlg, oWnd ) )
   oDlg:End()

return nil

function ChangeParent( oDlg, oWnd )

   local n

   for n = 1 to Len( oDlg:aControls )
      SetParent( oDlg:aControls[ n ]:hWnd, oWnd:hWnd )
      AAdd( oWnd:aControls, oDlg:aControls[ n ] )
      oDlg:aControls[ n ]:oWnd = oWnd
   next

return nil


Groupbox does not flicker but transparency does not work well. Better to avoid group boxes here.

Re: Dialog controls are flickering when resized..

Posted: Wed Jun 20, 2018 12:13 am
by fraxzi
Otto wrote:Hello Frances,
can you try to remove manifest for testing purpose.
Is it still flickering.
Thank you and best regards,
Otto


Hi Mr. Otto,

I removed and build the entire project.. The flickering the same with or without the my "WindowsXP.Manifest"..

:cry:

Re: Dialog controls are flickering when resized..

Posted: Wed Jun 20, 2018 12:15 am
by fraxzi
First, let us handle the case of simple dialog.
Please run this sample. Try resizing the dialog and you will not find any flickering.

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local oDlg, oBrw, oFont, oBrush
   local aGet[ 3 ], aVar := { "Hello World        ", 2345678, Date() }

   USE CUSTOMER
   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14

   DEFINE BRUSH oBrush GRADIENT { { 1, RGB( 216, 230, 238 ), RGB( 103, 154, 194 ) } }
   DEFINE DIALOG oDlg SIZE 800,600 PIXEL TRUEPIXEL FONT oFont BRUSH oBrush TRANSPARENT RESIZABLE

   @  20,20 GROUP TO 180,400 PIXEL OF oDlg

   @  40,40 SAY "Try Resizing this Dialog" SIZE 300,20 PIXEL OF oDlg

   @  70,40 GET aGet[ 1 ] VAR aVar[ 1 ] SIZE 300,24 PIXEL OF oDlg
   @ 110,40 GET aGet[ 2 ] VAR aVar[ 2 ] SIZE 100,24 PIXEL OF oDlg
   @ 140,40 GET aGet[ 3 ] VAR aVar[ 3 ] SIZE 100,24 PIXEL OF oDlg

   @ 200,40 XBROWSE oBrw SIZE 400,200 PIXEL OF oDlg DATASOURCE "CUSTOMER" ;
      AUTOCOLS CELL LINES NOBORDER
   oBrw:CreateFromCode()

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont
   RELEASE BRUSH oBrush

return nil
 

Please let me know if you experience any flickering while resizing.



Hi Mr. Rao,

No flickering at all.

:D

Re: Dialog controls are flickering when resized..

Posted: Wed Jun 20, 2018 1:59 am
by fraxzi
Mr. Rao,

Massive flickering of objects occurs when resizing window with child redefined dialog.. even if object's parent changed from dialog to windows.

:?:

Re: Dialog controls are flickering when resized..

Posted: Wed Jun 20, 2018 2:11 am
by nageswaragunupudi
I prepared MDI sample based on the rc file you posted. Flickering, if any, is negligible.
1) If you find massive flickering, please post a sample rc file.
2) If you say there is flickering in 18.04 but there was no flickering with an earlier version, please indicate the version number.

I have one question. Why should we use a dialog from resource to build a mdichild window? Why can we not use the dialog itself directly? In what way a nomodal dialog different from mdichild in functionality?

Re: Dialog controls are flickering when resized..

Posted: Wed Jun 20, 2018 5:42 am
by fraxzi
nageswaragunupudi wrote:I prepared MDI sample based on the rc file you posted. Flickering, if any, is negligible.
1) If you find massive flickering, please post a sample rc file.
2) If you say there is flickering in 18.04 but there was no flickering with an earlier version, please indicate the version number.

I have one question. Why should we use a dialog from resource to build a mdichild window? Why can we not use the dialog itself directly? In what way a nomodal dialog different from mdichild in functionality?



Mr. Rao,

I managed to reduced the flickering by:

1. removing the STYLE clause in DEFINE WINDOW (with style clause, the entire objects flickers irretably :) )
2. removing WS_EX_TRANSPARENT property in .RC (except for the GROUP Object, which has to be really transparent)

The only control objects flickering now are GROUP and SysDateTimePick32 :P :P :P

As for your question #2, I have been experiencing the flickering ever since when now I realized removing the STYLE clause did it.
And for your last question, it is easier for me to define it in Resource as Dialog then re-assign the object's parent to Child window.. User can open multiple window and just cascade or tile whatever suits their style in data encoding/analysis.. or maybe it just me. :P

Maybe there is a way not to flicker the Group :?:

:idea:

Re: Dialog controls are flickering when resized..

Posted: Wed Jun 20, 2018 7:43 am
by nageswaragunupudi
I did not find any flickering with Groupbox. The only issue I found was that the transparency does not work correctly on gradient and image brushes, when resized.

Re: Dialog controls are flickering when resized..

Posted: Wed Jun 20, 2018 8:00 am
by fraxzi
nageswaragunupudi wrote:I did not find any flickering with Groupbox. The only issue I found was that the transparency does not work correctly on gradient and image brushes, when resized.


I got this with GroupBox .. at least the SAYs and GETs are not affected.

Image

If you noticed, the xBrowse inside the FoldereX also flickers..

:(