Bug in TScrollBar

Post Reply
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Bug in TScrollBar

Post by Enrico Maria Giordano »

This is a sample of the problem. Please drag the scrollbar thumb to the middle of the scrollbar itself. Then look at the number in the DIALOG title (it is the scrollbar position). Then click below the thumb to step one page down and look at the number again. It is unchanged while it should be +10. If you click again then the number is increased.

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg, oScr

    DEFINE DIALOG oDlg

    oScr = TScrollBar():New( 0, 0, 0, 255, 10, .T., oDlg, 10, 50,;
                             { || oDlg:cTitle := LTrim( Str( oScr:GetPos() ) ) },;
                             { || oDlg:cTitle := LTrim( Str( oScr:GetPos() ) ) },;
                             { || oDlg:cTitle := LTrim( Str( oScr:GetPos() ) ) },;
                             { || oDlg:cTitle := LTrim( Str( oScr:GetPos() ) ) } )

    oScr:bTrack = { | nPos | oScr:SetPos( nPos ),;
                             oDlg:cTitle := LTrim( Str( oScr:GetPos() ) ) }

    ACTIVATE DIALOG oDlg;
             CENTER

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

Post by Antonio Linares »

Enrico,

This code looks equivalent and seems to work ok:

Code: Select all

    @ 0, 0 SCROLLBAR oScr ;
       VERTICAL ;
       RANGE 0, 255 ;
       PAGESTEP 10 ;
       SIZE 10, 50 ;
       ON UP oDlg:cTitle := LTrim( Str( oScr:GetPos() ) ) ;
       ON DOWN oDlg:cTitle := LTrim( Str( oScr:GetPos() ) ) ; 
       ON PAGEUP oDlg:cTitle := LTrim( Str( oScr:GetPos() ) ) ;
       ON PAGEDOWN oDlg:cTitle := LTrim( Str( oScr:GetPos() ) ) ;
       ON THUMBPOS ( oScr:SetPos( nPos ), oDlg:cTitle := LTrim( Str( 

oScr:GetPos() ) ) ) 
regards, saludos

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

Post by Antonio Linares »

Enrico,

Do you mean that the first pagedown click after the drag & drop, does not respond ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply