--- a/HorizontalScroller.st Sun Apr 30 15:40:03 1995 +0200
+++ b/HorizontalScroller.st Wed May 03 02:30:14 1995 +0200
@@ -1,30 +1,20 @@
-"
- COPYRIGHT (c) 1989 by Claus Gittinger
- All Rights Reserved
-
- This software is furnished under a license and may be used
- only in accordance with the terms of that license and with the
- inclusion of the above copyright notice. This software may not
- be provided or otherwise made available to, or used by, any
- other person. No title to or ownership of the software is
- hereby transferred.
-"
+'From Smalltalk/X, Version:2.10.5 on 30-apr-1995 at 1:46:18 am'!
Scroller subclass:#HorizontalScroller
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- category:'Views-Interactors'
+ instanceVariableNames:''
+ classVariableNames:''
+ poolDictionaries:''
+ category:'Views-Interactors'
!
HorizontalScroller comment:'
COPYRIGHT (c) 1989 by Claus Gittinger
- All Rights Reserved
+ All Rights Reserved
the scroller part of a horizontal scrollbar
-$Header: /cvs/stx/stx/libwidg/HorizontalScroller.st,v 1.5 1994-08-07 13:22:36 claus Exp $
+$Header: /cvs/stx/stx/libwidg/HorizontalScroller.st,v 1.6 1995-05-03 00:29:44 claus Exp $
written spring/summer 89 by claus
'!
@@ -32,96 +22,18 @@
initialize
super initialize.
- moveDirection := #x
+ orientation := #horizontal
! !
!HorizontalScroller methodsFor:'accessing'!
-thumbOrigin:newOrigin
- "set the thumbs origin (in percent)"
-
- |realNewOrigin oldFrame oldLeft oldRight thumbLeft thumbRight
- tH tW delta top|
-
- ((newOrigin + thumbHeight) > 100) ifTrue:[
- realNewOrigin := 100 - thumbHeight
- ] ifFalse: [
- realNewOrigin := newOrigin
- ].
- (realNewOrigin > 100) ifTrue:[
- realNewOrigin := 100
- ] ifFalse: [
- (realNewOrigin < 0) ifTrue:[
- realNewOrigin := 0
- ]
- ].
- (realNewOrigin = thumbOrigin) ifFalse:[
- thumbOrigin := realNewOrigin.
-
- shown ifTrue:[
- oldFrame := thumbFrame.
- self computeThumbFrame.
- (thumbHeight = 100) ifTrue:[^ self].
-
- (thumbFrame ~~ oldFrame) ifTrue:[
- oldFrame isNil ifTrue:[
- self drawThumb.
- ^ self
- ].
- tH := thumbFrame height.
- tW := thumbFrame width.
- oldLeft := oldFrame left.
- oldRight := oldLeft + tW.
-
- thumbLeft := thumbFrame left.
- thumbRight := thumbLeft + tW.
-
- top := thumbFrame top.
-
- (oldRight >= width) ifTrue:[
- "cannot copy - thumb was behind end"
- self drawThumbBackgroundInX:oldLeft y:top
- width:(width - oldLeft" - 1") height:tH.
- self drawThumb.
- ^ self
- ].
-
- self catchExpose.
- self copyFrom:self x:oldLeft y:top
- toX:thumbLeft y:top
- width:tW height:tH.
-
- oldLeft > thumbLeft ifTrue:[
- delta := oldLeft - thumbLeft.
- oldLeft > thumbRight ifTrue:[
- self drawThumbBackgroundInX:oldLeft y:top
- width:(tW + 1) height:tH
- ] ifFalse:[
- self drawThumbBackgroundInX:thumbRight y:top
- width:delta height:tH
- ]
- ] ifFalse:[
- delta := thumbLeft - oldLeft.
- oldRight < thumbLeft ifTrue:[
- self drawThumbBackgroundInX:oldLeft y:top
- width:tW + 1 height:tH
- ] ifFalse:[
- self drawThumbBackgroundInX:oldLeft y:top
- width:delta height:tH
- ]
- ].
- self waitForExpose
- ]
- ]
- ]
+scrollRightAction:aBlock
+ "ignored -
+ but implemented, so that scroller can be used in place of a scrollbar"
!
scrollLeftAction:aBlock
"ignored -
but implemented, so that scroller can be used in place of a scrollbar"
-!
+! !
-scrollRightAction:aBlock
- "ignored -
- but implemented, so that scroller can be used in place of a scrollbar"
-! !