Dialog controls are flickering when resized..

Re: Dialog controls are flickering when resized..

Postby fraxzi » Mon Jun 07, 2010 9:48 am

Dear Mr. Antonio,

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


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Dialog controls are flickering when resized..

Postby James Bott » Mon Jun 07, 2010 10:52 am

Antonio,

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

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Dialog controls are flickering when resized..

Postby fraxzi » Wed Jun 09, 2010 7:59 am

Dear Mr. Antonio,

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


Regards,
Frances
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Dialog controls are flickering when resized..

Postby fraxzi » Tue Jun 19, 2018 3:39 am

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 :?: :?: :?:
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Dialog controls are flickering when resized..

Postby Otto » Tue Jun 19, 2018 9:12 am

Hello Frances,
can you try to remove manifest for testing purpose.
Is it still flickering.
Thank you and best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6077
Joined: Fri Oct 07, 2005 7:07 pm

Re: Dialog controls are flickering when resized..

Postby nageswaragunupudi » Tue Jun 19, 2018 10:01 am

fraxzi wrote:Dear All,

As with the above..

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

Code: Select all  Expand view

   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 view
#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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10313
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Dialog controls are flickering when resized..

Postby byte-one » Tue Jun 19, 2018 10:39 am

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!
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Dialog controls are flickering when resized..

Postby nageswaragunupudi » Tue Jun 19, 2018 1:11 pm

MDI
Code: Select all  Expand view
#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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10313
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Dialog controls are flickering when resized..

Postby fraxzi » Wed Jun 20, 2018 12:13 am

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:
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Dialog controls are flickering when resized..

Postby fraxzi » Wed Jun 20, 2018 12:15 am

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 view
#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
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Dialog controls are flickering when resized..

Postby fraxzi » Wed Jun 20, 2018 1:59 am

Mr. Rao,

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

:?:
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Dialog controls are flickering when resized..

Postby nageswaragunupudi » Wed Jun 20, 2018 2:11 am

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?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10313
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Dialog controls are flickering when resized..

Postby fraxzi » Wed Jun 20, 2018 5:42 am

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:
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Dialog controls are flickering when resized..

Postby nageswaragunupudi » Wed Jun 20, 2018 7:43 am

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10313
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Dialog controls are flickering when resized..

Postby fraxzi » Wed Jun 20, 2018 8:00 am

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..

:(
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 45 guests