Xbrowse Flickering

Post Reply
User avatar
Silvio.Falconi
Posts: 7348
Joined: Thu Oct 18, 2012 7:17 pm

Xbrowse Flickering

Post by Silvio.Falconi »

I have to raise and lower an xbrowse, is there a way to avoid flickering of the xbrowse dialog?
Is There a correct FiveWin method to resize an XBrowse without flickering ?

Try the small test pls

Code: Select all | Expand


#include "FiveWin.ch"
#include "xbrowse.ch"

FUNCTION Main()

   LOCAL oDlg
   LOCAL oBrw
   LOCAL oBtnUp
   LOCAL oBtnDown
   local nHeightIni := 350

   USE Customer NEW SHARED

   DEFINE DIALOG oDlg ;
      SIZE 800,500 PIXEL TRUEPIXEL ;
      TITLE "Test Resize XBrowse"

   @ 10,10 XBROWSE oBrw OF oDlg ;
      SIZE 760,nHeightIni PIXEL ;
      AUTOCOLS ALIAS "CUSTOMER"

   oBrw:CreateFromCode()

   @ 370,10 BUTTON oBtnUp ;
      PROMPT "Up" ;
      SIZE 80,25 PIXEL ;
      OF oDlg ;
      ACTION AlzaBrowse( oBrw,nHeightIni )

   @ 370,100 BUTTON oBtnDown ;
      PROMPT "Down" ;
      SIZE 80,25 PIXEL ;
      OF oDlg ;
      ACTION AbbassaBrowse( oBrw,nHeightIni )

   ACTIVATE DIALOG oDlg CENTERED

RETURN NIL


FUNCTION AlzaBrowse( oBrw, nHeightIni )

   LOCAL nChecked:= 2
   LOCAL nDecrement

nDecrement   := nChecked * 30
oBrw:nHeight := nHeightIni - nDecrement

oBrw:Refresh(.f.)

RETURN NIL


FUNCTION AbbassaBrowse( oBrw, nHeightIni )

   LOCAL nChecked := 0
   LOCAL nDecrement

   nDecrement := nChecked * 30

   oBrw:nHeight := nHeightIni - nDecrement

   oBrw:Refresh(.F.)

RETURN NI
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
Posts: 7348
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse Flickering

Post by Silvio.Falconi »

Second test with a class to rewrite methos resize with no refresh()
the flickering is minimal but unfortunately it is still there so I think xbrowse has another function with the refresh active

Code: Select all | Expand


#include "FiveWin.ch"
#include "xbrowse.ch"

FUNCTION Main()

   LOCAL oDlg
   LOCAL oBrw
   LOCAL oBtnUp
   LOCAL oBtnDown
   local nHeightIni := 350

   USE Customer NEW SHARED

   DEFINE DIALOG oDlg ;
      SIZE 800,500 PIXEL TRUEPIXEL ;
      TITLE "Test Resize XBrowse"

   @ 10,10 XBROWSE oBrw OF oDlg ;
      SIZE 760,nHeightIni PIXEL ;
      AUTOCOLS ALIAS "CUSTOMER" CLASS TXBrwNoFlicker()

   oBrw:CreateFromCode()

   @ 370,10 BUTTON oBtnUp ;
      PROMPT "UP" ;
      SIZE 80,25 PIXEL ;
      OF oDlg ;
      ACTION AlzaBrowse( oBrw,nHeightIni )

   @ 370,100 BUTTON oBtnDown ;
      PROMPT "Down" ;
      SIZE 80,25 PIXEL ;
      OF oDlg ;
      ACTION AbbassaBrowse( oBrw,nHeightIni )

   ACTIVATE DIALOG oDlg CENTERED

RETURN NIL


FUNCTION AlzaBrowse( oBrw, nHeightIni )

   LOCAL nChecked:= 2
   LOCAL nDecrement

nDecrement   := nChecked * 30
oBrw:nHeight := nHeightIni - nDecrement



RETURN NIL


FUNCTION AbbassaBrowse( oBrw, nHeightIni )

   LOCAL nChecked := 0
   LOCAL nDecrement

   nDecrement := nChecked * 30

   oBrw:nHeight := nHeightIni - nDecrement


   RETURN NIL











                                                      
CLASS TXBrwNoFlicker FROM TXBrowse
CLASSDATA lRegistered AS LOGICAL METHOD New()
METHOD Resize( nSizeType, nWidth, nHeight )
ENDCLASS
METHOD New() CLASS TXBrwNoFlicker
return ::Super:New()
METHOD Resize( nSizeType, nWidth, nHeight ) CLASS TXBrwNoFlicker
::MakeBrush()
::ColStretch()
::Super:Resize( nSizeType, nWidth, nHeight )
// no refresh
RETURN NIL
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
Posts: 7348
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse Flickering

Post by Silvio.Falconi »

a solution please ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Xbrowse Flickering

Post by Antonio Linares »

Dear Silvio,

I tried it for more than an hour with no success, sorry

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Xbrowse Flickering

Post by Antonio Linares »

Working fine! (using the new Anthropic Fable!)

flicker-free XBrowse resize in FiveWin. Solution (WM_SETREDRAW + WS_CLIPCHILDREN) verified, sample testrsz.prg

Code: Select all | Expand

// Interactive test: XBrowse resize without flicker (WM_SETREDRAW)
// Click Up / Down repeatedly and watch for flicker.
// "Old Up/Down" buttons use the plain method for comparison.

#include "FiveWin.ch"
#include "xbrowse.ch"

#define WM_SETREDRAW     11
#define GWL_STYLE       -16
#define WS_CLIPCHILDREN  0x2000000

//----------------------------------------------------------------------------//

function Main()

   local oDlg, oBrw
   local nHeightIni := 350

   USE data\Customer NEW SHARED

   DEFINE DIALOG oDlg ;
      SIZE 800,500 PIXEL TRUEPIXEL ;
      TITLE "Test Resize XBrowse - new method left, old method right"

   @ 10,10 XBROWSE oBrw OF oDlg ;
      SIZE 760,nHeightIni PIXEL ;
      AUTOCOLS ALIAS "CUSTOMER"

   oBrw:CreateFromCode()

   @ 420,10 BUTTON "Up" SIZE 80,25 PIXEL OF oDlg ;
      ACTION SetBrwHeight( oDlg, oBrw, nHeightIni - 60 )

   @ 420,100 BUTTON "Down" SIZE 80,25 PIXEL OF oDlg ;
      ACTION SetBrwHeight( oDlg, oBrw, nHeightIni )

   @ 420,600 BUTTON "Old Up" SIZE 80,25 PIXEL OF oDlg ;
      ACTION ( oBrw:nHeight := nHeightIni - 60, oBrw:Refresh( .f. ) )

   @ 420,690 BUTTON "Old Down" SIZE 80,25 PIXEL OF oDlg ;
      ACTION ( oBrw:nHeight := nHeightIni, oBrw:Refresh( .f. ) )

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT SetWindowLong( oDlg:hWnd, GWL_STYLE, ;
              nOr( GetWindowLong( oDlg:hWnd, GWL_STYLE ), WS_CLIPCHILDREN ) )

return nil

//----------------------------------------------------------------------------//

static function SetBrwHeight( oDlg, oBrw, nHeight )

   oDlg:SendMsg( WM_SETREDRAW, 0, 0 )
   oBrw:nHeight := nHeight
   oDlg:SendMsg( WM_SETREDRAW, 1, 0 )
   oDlg:Refresh()
   oBrw:Refresh()

return nil

//----------------------------------------------------------------------------//
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 7348
Joined: Thu Oct 18, 2012 7:17 pm

Re: Xbrowse Flickering

Post by Silvio.Falconi »

GOOD

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Otto
Posts: 7020
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Xbrowse Flickering

Post by Otto »

I read: Anthropic has suspended its powerful new AI model

User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Xbrowse Flickering

Post by Antonio Linares »

Fortunately we have been using Fable till today at 2 am

  1. Is has removed all warnings from FWH C files, solved also Hakan's Turkish issue
  2. Implemented php support on Github static web pages ( https://fivetechsoft.github.io/Agents/ )
  3. Implemented a githubDB database engine with vectors support ( https://github.com/FiveTechSoft/githubdb )

So all works were completed 👍🏻😉

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Xbrowse Flickering

Post by Antonio Linares »

Cause and effect

They warned everybody about the dangers, now they have to act consequently

I have the same concern. A simple jailbreak could unsleash all Mythos power...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply