Hi Przemek & Viktor,
Some point regarding scrollbar:
1. I need to comment out the reference to ::lOverride in ThumbPos() method
as any subsequent reference to CalcThumbPos() method would not update
::ThumPos var because the moment you invoke ThumbPos() method you would
normally set ::lOverride to .T. unless nThumbPos == 0 which happens
seldomly.
2. I made some changes in the Update() method, Could you please check it ?
*-----------
METHOD update() CLASS SCROLLBAR
LOCAL nOldRow
LOCAL nOldCol
LOCAL lOldMCur
LOCAL nThumbPos := ::nThumbPos
IF ISBLOCK( ::bSBlock )
Eval( ::bSBlock )
ENDIF
IF ::CalcThumbPos() .AND. nThumbPos != ::nThumbPos
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 ) )
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 ) )
ENDIF
nThumbPos := ::nThumbPos
DispEnd()
MSetCursor( lOldMCur )
SetPos( nOldRow, nOldCol )
RETURN .T.
ENDIF
RETURN .F.
*-----------
BTW, The following is my test prg:
*---
#include "c:\hrb\include\inkey.ch"
#include "c:\hrb\include\set.ch"
#include "c:\hrb\include\button.ch"
PROCEDURE Main
local scroll1, scroll2
scroll1 := ScrollBar(1,22,78,,SCROLL_VERTICAL)
scroll2 := ScrollBar(1,78,23,,SCROLL_HORIZONTAL)
//cls
scroll1:total(20)
scroll2:total(76)
scroll1:display()
scroll2:display()
inkey(0)
scroll1:current(11)
scroll1:update()
scroll2:current(38)
scroll2:update()
inkey(0)
RETURN
*---
Cheers,
Ed
--
View this message in context:
http://www.nabble.com/Some-corrections-regarding-scrollbar-tp17180616p17180616.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour