--- a/HorizontalSteppingSlider.st Wed May 28 12:25:55 1997 +0200
+++ b/HorizontalSteppingSlider.st Wed May 28 16:00:37 1997 +0200
@@ -10,8 +10,8 @@
hereby transferred.
"
-HorizontalScrollBar subclass:#HorizontalSteppingSlider
- instanceVariableNames:'stepIncrement'
+SteppingSlider subclass:#HorizontalSteppingSlider
+ instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'Views-Interactors'
@@ -46,116 +46,22 @@
top := StandardSystemView extent:200@200.
sl := HorizontalSteppingSlider in:top.
- sl origin:(0.0@0.0) corner:(1.0@sl height).
+ sl origin:(0.0@0.0) corner:(1.0@(sl preferredExtent y)).
sl scrollAction:[:pos | Transcript showCR:pos].
top open
"
! !
-!HorizontalSteppingSlider methodsFor:'accessing'!
-
-model:aModel
- "set the model; this will get the thumbs origin
- via #value: messages"
-
- thumb model:aModel
-!
-
-start:start stop:stop step:step
- "set the range and stepIncrement"
-
- thumb start:start stop:stop.
- stepIncrement := step
-!
-
-step
- "retrieve the stepIncrement"
-
- ^ stepIncrement
-!
-
-step:aNumber
- "same as stepIncrement;
- set the value used for stepping (defaults to 1)"
-
- stepIncrement := aNumber
-!
-
-stepIncrement:aNumber
- "set the value used for stepping (defaults to 1)"
-
- stepIncrement := aNumber
-! !
-
-!HorizontalSteppingSlider methodsFor:'events'!
-
-keyPress:key x:x y:y
- (key == #CursorRight or:[key == #CursorUp]) ifTrue:[
- self scrollStepUp.
- ^ self
- ].
- (key == #CursorLeft or:[key == #CursorDown]) ifTrue:[
- self scrollStepDown.
- ^ self
- ].
- super keyPress:key x:x y:y
-! !
+!HorizontalSteppingSlider methodsFor:'queries'!
-!HorizontalSteppingSlider methodsFor:'initialization'!
-
-createElements
- button1 := ArrowButton leftIn:self.
- button1 name:'LeftButton'.
- button2 := ArrowButton rightIn:self.
- button2 name:'RightButton'.
- thumb := HorizontalSlider in:self.
-!
-
-initialize
- super initialize.
- stepIncrement := 1.
- self scrollDownAction:[self scrollStepUp].
- self scrollUpAction:[self scrollStepDown].
-! !
-
-!HorizontalSteppingSlider methodsFor:'misc'!
-
-doesNotUnderstand:aMessage
- "delegate any unknown messages to my thumb"
-
- ^ aMessage sendTo:thumb
-! !
+orientation
+ ^ #horizontal
-!HorizontalSteppingSlider methodsFor:'private'!
-
-scrollStep:delta
- "step by some delta"
-
- |oldOrg newOrg|
-
- oldOrg := thumb thumbOrigin.
- newOrg := ((oldOrg + delta) max:thumb start) min:thumb stop.
- oldOrg ~= newOrg ifTrue:[
- thumb thumbOrigin:newOrg.
- thumb tellOthers.
- ]
-!
-
-scrollStepDown
- "stepDown"
-
- self scrollStep:stepIncrement negated
-!
-
-scrollStepUp
- "step up"
-
- self scrollStep:stepIncrement
-
+ "Created: 28.5.1997 / 15:10:16 / cg"
! !
!HorizontalSteppingSlider class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/HorizontalSteppingSlider.st,v 1.9 1996-12-12 13:35:26 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/HorizontalSteppingSlider.st,v 1.10 1997-05-28 14:00:27 cg Exp $'
! !