FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour thumb of scrollbar more big
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
thumb of scrollbar more big
Posted: Tue Oct 28, 2025 11:05 AM
One thing I asked a while ago was if there was a way to increase the thumb of the xbrowse scrollbar because scrolling with many fields (65) and for example 11,000 records became difficult and very slow. After many tests I managed to increase the length of the horizontal thumb but when I press the scrollbar button or change position the thumb goes back to being small



In TXBrowse, the “thumb” becomes small again because XBrowse only updates the range and position of the horizontal scrollbar, but not the page size (which is what determines the length of the thumb). You can see this in GetDisplayCols(), where it only does ::oHScroll:SetRange( 1, Max( nCols, 2 ) ) and then elsewhere :SetPos(...), without ever setting the “page”.

any solution ?
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: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: thumb of scrollbar more big
Posted: Wed Oct 29, 2025 09:44 AM

Dear Silvio,

> After many tests I managed to increase the length of the horizontal thumb

How did you do it ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: thumb of scrollbar more big
Posted: Mon Nov 03, 2025 09:39 AM
Antonio Linares wrote: Dear Silvio,

> After many tests I managed to increase the length of the horizontal thumb

How did you do it ?

Old question.
Software Lotto.
Archive view (dbf/array) with 11,000 records and it's growing every week. I'm using Xbrowse.
I have a lot of fields to display, about 65.
You can also try with our fivedbu, scrolling horizontally. It's fast at first, but then slows down a lot towards the middle.

local aFields := { { "NUMERO", "N", 6, 0 },;
                   { "DATA", "D", 8, 0 },;
                   { "CONCORSO", "C", 3, 0 },;
                   { "BA1", "N", 2, 0 },;
                   { "BA2", "N", 2, 0 },;
                   { "BA3", "N", 2, 0 },;
                   { "BA4", "N", 2, 0 },;
                   { "BA5", "N", 2, 0 },;
                   { "CA1", "N", 2, 0 },;
                   { "CA2", "N", 2, 0 },;
                   { "CA3", "N", 2, 0 },;
                   { "CA4", "N", 2, 0 },;
                   { "CA5", "N", 2, 0 },;
                   { "FI1", "N", 2, 0 },;
                   { "FI2", "N", 2, 0 },;
                   { "FI3", "N", 2, 0 },;
                   { "FI4", "N", 2, 0 },;
                   { "FI5", "N", 2, 0 },;
                   { "GE1", "N", 2, 0 },;
                   { "GE2", "N", 2, 0 },;
                   { "GE3", "N", 2, 0 },;
                   { "GE4", "N", 2, 0 },;
                   { "GE5", "N", 2, 0 },;
                   { "MI1", "N", 2, 0 },;
                   { "MI2", "N", 2, 0 },;
                   { "MI3", "N", 2, 0 },;
                   { "MI4", "N", 2, 0 },;
                   { "MI5", "N", 2, 0 },;
                   { "NA1", "N", 2, 0 },;
                   { "NA2", "N", 2, 0 },;
                   { "NA3", "N", 2, 0 },;
                   { "NA4", "N", 2, 0 },;
                   { "NA5", "N", 2, 0 },;
                   { "PA1", "N", 2, 0 },;
                   { "PA2", "N", 2, 0 },;
                   { "PA3", "N", 2, 0 },;
                   { "PA4", "N", 2, 0 },;
                   { "PA5", "N", 2, 0 },;
                   { "RM1", "N", 2, 0 },;
                   { "RM2", "N", 2, 0 },;
                   { "RM3", "N", 2, 0 },;
                   { "RM4", "N", 2, 0 },;
                   { "RM5", "N", 2, 0 },;
                   { "TO1", "N", 2, 0 },;
                   { "TO2", "N", 2, 0 },;
                   { "TO3", "N", 2, 0 },;
                   { "TO4", "N", 2, 0 },;
                   { "TO5", "N", 2, 0 },;
                   { "VE1", "N", 2, 0 },;
                   { "VE2", "N", 2, 0 },;
                   { "VE3", "N", 2, 0 },;
                   { "VE4", "N", 2, 0 },;
                   { "VE5", "N", 2, 0 },;
                   { "NZ1", "N", 2, 0 },;
                   { "NZ2", "N", 2, 0 },;
                   { "NZ3", "N", 2, 0 },;
                   { "NZ4", "N", 2, 0 },;
                   { "NZ5", "N", 2, 0 },;
                   { "IDX", "N", 2, 0 } }
I can send you the archive to test it

or if you want try with a test

LOCAL aData := MakeData( 11000, 55 )
@ 0,0 XBROWSE oBrw OF oChild LINES CELL PIXEL
oBrw:SetArray( aData )
AEval( aData[1], {|x,i| AddNumCol( oBrw, i ) } )


STATIC FUNCTION MakeData( nRows, nCols )
   LOCAL a := Array( nRows ), i, j
   FOR i := 1 TO nRows
      a[i] := Array( nCols )
      FOR j := 1 TO nCols
         a[i][j] := ( ( i + j ) % 100 )   // valori 0..99
      NEXT
   NEXT
   RETURN a

STATIC FUNCTION AddNumCol( oBrw, nIndex )
   LOCAL oCol := oBrw:AddCol()
   oCol:cHeader  := "C" + LTrim(Str(nIndex))
   oCol:bStrData := {|r,c| ;
      Transform( oBrw:aArrayData[ oBrw:nArrayAt ][ nIndex ], "@E 99" ) }
   oCol:nWidth   := If( nIndex <= 2, 60, 40 )
RETURN NIL

The problem is that horizontal scrolling causes problems when there are many columns and records.
I've found that by increasing the scroll bar (thumb), I can quickly view the end of the archive.
I tried enlarging the thumb, but Xbrowse refreshes the entire class and restores the old thumb.




Perhaps we can create two data and one method


oBrw:lThumbBig := .t.
oBrw:nThumbCols := 40


METHOD AdjustThumb() CLASS TXBrowse
IF ::lThumbBig .AND. ::oHScroll != NIL
LOCAL nCols := Len( ::GetVisibleCols() )
SetScrollInfo( ::hWnd, SB_HORZ, 1, Max( nCols, 2 ), ::nThumbCols, 1, .T. )
ENDIF
RETURN NIL


and call it ::AdjustThumb()

sample

::oHScroll:SetRange( 1, Max( nCols, 2 ) )
::AdjustThumb()

this after ::oHScroll:SetRange()

practically in the whole class, making just this change is a lot of work because the xbrowse class is too long
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

Continue the discussion