From 636bc4aae1587d4460e2e9ea0c87bec994f4b133 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 12 May 2008 09:56:33 +0000 Subject: [PATCH] 2008-05-12 11:54 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * source/rtl/scrollbr.prg ! Fixed :Update(). Submitted by Edmer. ! Fixed formula in :CalcThumbPos(). Reported by Edmer. ! Fixed assigment in :CalcThumbPos() to not interfere with ::lOverride. Reported by Edmer. ; Please test. --- harbour/ChangeLog | 8 ++++++++ harbour/source/rtl/scrollbr.prg | 18 +++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2cb5e38fe5..56661ac821 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,14 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-05-12 11:54 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * source/rtl/scrollbr.prg + ! Fixed :Update(). Submitted by Edmer. + ! Fixed formula in :CalcThumbPos(). Reported by Edmer. + ! Fixed assigment in :CalcThumbPos() to not interfere + with ::lOverride. Reported by Edmer. + ; Please test. + 2008-05-12 18:20 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * contrib/rddads/ads1.c + Added DBOI_SKIPUNIQUE (C5.3 ordSkipUnique()) implementation diff --git a/harbour/source/rtl/scrollbr.prg b/harbour/source/rtl/scrollbr.prg index 2a90f08bc4..b9771f6bdf 100644 --- a/harbour/source/rtl/scrollbr.prg +++ b/harbour/source/rtl/scrollbr.prg @@ -178,7 +178,7 @@ METHOD update() CLASS SCROLLBAR LOCAL nOldCol LOCAL lOldMCur - LOCAL nThumbPos + LOCAL nThumbPos := ::nThumbPos IF ISBLOCK( ::bSBlock ) Eval( ::bSBlock ) @@ -186,22 +186,22 @@ METHOD update() CLASS SCROLLBAR IF ::CalcThumbPos() .AND. nThumbPos != ::nThumbPos - nOldRow := Row() - nOldCol := Col() + nOldRow := Row() + nOldCol := Col() lOldMCur := MSetCursor( .F. ) DispBegin() - nThumbPos := ::nThumbPos - IF ::nOrient == SCROLL_VERTICAL - DispOutAt( ::nStart + nThumbPos, ::nOffSet, SubStr( ::cStyle, 2, 1 ), hb_ColorIndex( ::cColorSpec, 0 ) ) - DispOutAt( ::nStart + nThumbPos, ::nOffset, SubStr( ::cStyle, 3, 1 ), hb_ColorIndex( ::cColorSpec, 1 ) ) + DispOutAt( ::nStart + nThumbPos, ::nOffSet, SubStr( ::cStyle, 2, 1), hb_ColorIndex( ::cColorSpec, 0 ) ) + DispOutAt( ::nStart + ::nThumbPos, ::nOffset, SubStr( ::cStyle, 3, 1 ), hb_ColorIndex( ::cColorSpec, 1 ) ) ELSE DispOutAt( ::nOffset, ::nStart + nThumbPos, SubStr( ::cStyle, 2, 1 ), hb_ColorIndex( ::cColorSpec, 0 ) ) - DispOutAt( ::nOffset, ::nStart + nThumbPos, SubStr( ::cStyle, 3, 1 ), hb_ColorIndex( ::cColorSpec, 1 ) ) + DispOutAt( ::nOffset, ::nStart + ::nThumbPos, SubStr( ::cStyle, 3, 1 ), hb_ColorIndex( ::cColorSpec, 1 ) ) ENDIF + nThumbPos := ::nThumbPos + DispEnd() MSetCursor( lOldMCur ) @@ -411,7 +411,7 @@ METHOD CalcThumbPos() CLASS SCROLLBAR ENDIF IF !::lOverride - ::ThumbPos := Min( Max( Round( ( ( nBarLength - 1 ) * ::nCurrent + nTotal - 2 * nBarLength + 1 ) / ( nTotal - nBarLength ), 0 ), 1 ), nBarLength ) + ::nThumbPos := Min( Max( Round( ::nCurrent * ( ( nBarLength - 1 ) / nTotal ) + 1, 0 ), 1 ), nBarLength ) ENDIF RETURN .T.