FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Xbrowse Flickering
Posts: 7348
Joined: Thu Oct 18, 2012 07:17 PM

Xbrowse Flickering

Posted: Fri Jun 05, 2026 01:05 PM

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

#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
Posts: 7348
Joined: Thu Oct 18, 2012 07:17 PM

Re: Xbrowse Flickering

Posted: Fri Jun 05, 2026 02:06 PM

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

#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
Posts: 7348
Joined: Thu Oct 18, 2012 07:17 PM

Re: Xbrowse Flickering

Posted: Thu Jun 11, 2026 06:30 AM

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
Posts: 44508
Joined: Thu Oct 06, 2005 05:47 PM

Re: Xbrowse Flickering

Posted: Thu Jun 11, 2026 06:46 AM

Dear Silvio,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44508
Joined: Thu Oct 06, 2005 05:47 PM

Re: Xbrowse Flickering

Posted: Thu Jun 11, 2026 08:08 AM

Working fine! (using the new Anthropic Fable!)

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

// 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
Posts: 7348
Joined: Thu Oct 18, 2012 07:17 PM

Re: Xbrowse Flickering

Posted: Fri Jun 12, 2026 02:43 PM

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
Posts: 7020
Joined: Fri Oct 07, 2005 07:07 PM

Re: Xbrowse Flickering

Posted: Sat Jun 13, 2026 06:12 AM

I read: Anthropic has suspended its powerful new AI model

Posts: 44508
Joined: Thu Oct 06, 2005 05:47 PM

Re: Xbrowse Flickering

Posted: Sat Jun 13, 2026 06:24 AM

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
Posts: 7020
Joined: Fri Oct 07, 2005 07:07 PM

Re: Xbrowse Flickering

Posted: Sat Jun 13, 2026 06:56 AM
Posts: 44508
Joined: Thu Oct 06, 2005 05:47 PM

Re: Xbrowse Flickering

Posted: Sat Jun 13, 2026 07:07 AM

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

Continue the discussion