# HG changeset patch # User claus # Date 806469190 -7200 # Node ID 40e27e2606b54b6748fa024609f6a337cc74041a # Parent 10910b8b003a2037ec102a0fab9267bd5c614a53 . diff -r 10910b8b003a -r 40e27e2606b5 HSlider.st --- a/HSlider.st Mon Jul 03 04:35:33 1995 +0200 +++ b/HSlider.st Sun Jul 23 05:13:10 1995 +0200 @@ -23,7 +23,7 @@ COPYRIGHT (c) 1992 by Claus Gittinger All Rights Reserved -$Header: /cvs/stx/stx/libwidg2/Attic/HSlider.st,v 1.4 1995-05-03 00:42:32 claus Exp $ +$Header: /cvs/stx/stx/libwidg2/Attic/HSlider.st,v 1.5 1995-07-23 03:12:40 claus Exp $ '! !HorizontalSlider class methodsFor:'documentation'! @@ -44,7 +44,7 @@ version " -$Header: /cvs/stx/stx/libwidg2/Attic/HSlider.st,v 1.4 1995-05-03 00:42:32 claus Exp $ +$Header: /cvs/stx/stx/libwidg2/Attic/HSlider.st,v 1.5 1995-07-23 03:12:40 claus Exp $ " ! @@ -62,3 +62,12 @@ orientation := #horizontal ! ! +!HorizontalSlider methodsFor:'queries'! + +preferredExtent + |w h| + + w := self class defaultExtent x. + h := (device verticalPixelPerMillimeter asFloat * 6) rounded. + ^ w @ h. +! ! diff -r 10910b8b003a -r 40e27e2606b5 HStepSlider.st --- a/HStepSlider.st Mon Jul 03 04:35:33 1995 +0200 +++ b/HStepSlider.st Sun Jul 23 05:13:10 1995 +0200 @@ -13,7 +13,7 @@ 'From Smalltalk/X, Version:2.10.3 on 27-sep-1994 at 12:56:30'! HorizontalScrollBar subclass:#HorizontalSteppingSlider - instanceVariableNames:'' + instanceVariableNames:'stepIncrement' classVariableNames:'' poolDictionaries:'' category:'Views-Interactors' @@ -23,7 +23,7 @@ COPYRIGHT (c) 1994 by Claus Gittinger All Rights Reserved -$Header: /cvs/stx/stx/libwidg2/Attic/HStepSlider.st,v 1.2 1995-05-03 00:42:35 claus Exp $ +$Header: /cvs/stx/stx/libwidg2/Attic/HStepSlider.st,v 1.3 1995-07-23 03:12:43 claus Exp $ '! !HorizontalSteppingSlider class methodsFor:'documentation'! @@ -44,7 +44,7 @@ version " -$Header: /cvs/stx/stx/libwidg2/Attic/HStepSlider.st,v 1.2 1995-05-03 00:42:35 claus Exp $ +$Header: /cvs/stx/stx/libwidg2/Attic/HStepSlider.st,v 1.3 1995-07-23 03:12:43 claus Exp $ " ! @@ -80,20 +80,69 @@ initialize super initialize. - self scrollDownAction:[|nO| - nO := (thumb thumbOrigin + 1) min:100. - thumb thumbOrigin:nO. - thumb tellOthers "scrollAction value:nO"]. - self scrollUpAction:[|nO| - nO := (thumb thumbOrigin - 1) max:0. - thumb thumbOrigin:nO. - thumb tellOthers "scrollAction value:nO"]. + stepIncrement := 1. + self scrollDownAction:[self scrollStepUp]. + self scrollUpAction:[self scrollStepDown]. ! ! !HorizontalSteppingSlider methodsFor:'accessing'! model:aModel thumb model:aModel +! + +stepIncrement:aNumber + "set the value used for stepping (defaults to 1)" + + stepIncrement := aNumber +! + +step:aNumber + "same as stepIncrement; + set the value used for stepping (defaults to 1)" + + stepIncrement := aNumber +! + +step + ^ stepIncrement +! + +start:start stop:stop step:step + thumb start:start stop:stop. + stepIncrement := step +! ! + +!HorizontalSteppingSlider methodsFor:'events'! + +keyPress:key x:x y:y + key == #CursorRight ifTrue:[ + self scrollStepUp. + ^ self + ]. + key == #CursorLeft ifTrue:[ + self scrollStepDown. + ^ self + ]. + super keyPress:key x:x y:y +! ! + +!HorizontalSteppingSlider methodsFor:'private'! + +scrollStepUp + |nO| + + nO := (thumb thumbOrigin + stepIncrement) min:thumb stop. + thumb thumbOrigin:nO. + thumb tellOthers. +! + +scrollStepDown + |nO| + + nO := (thumb thumbOrigin - stepIncrement) max:thumb start. + thumb thumbOrigin:nO. + thumb tellOthers. ! ! !HorizontalSteppingSlider methodsFor:'misc'! diff -r 10910b8b003a -r 40e27e2606b5 HorizontalSlider.st --- a/HorizontalSlider.st Mon Jul 03 04:35:33 1995 +0200 +++ b/HorizontalSlider.st Sun Jul 23 05:13:10 1995 +0200 @@ -23,7 +23,7 @@ COPYRIGHT (c) 1992 by Claus Gittinger All Rights Reserved -$Header: /cvs/stx/stx/libwidg2/HorizontalSlider.st,v 1.4 1995-05-03 00:42:32 claus Exp $ +$Header: /cvs/stx/stx/libwidg2/HorizontalSlider.st,v 1.5 1995-07-23 03:12:40 claus Exp $ '! !HorizontalSlider class methodsFor:'documentation'! @@ -44,7 +44,7 @@ version " -$Header: /cvs/stx/stx/libwidg2/HorizontalSlider.st,v 1.4 1995-05-03 00:42:32 claus Exp $ +$Header: /cvs/stx/stx/libwidg2/HorizontalSlider.st,v 1.5 1995-07-23 03:12:40 claus Exp $ " ! @@ -62,3 +62,12 @@ orientation := #horizontal ! ! +!HorizontalSlider methodsFor:'queries'! + +preferredExtent + |w h| + + w := self class defaultExtent x. + h := (device verticalPixelPerMillimeter asFloat * 6) rounded. + ^ w @ h. +! ! diff -r 10910b8b003a -r 40e27e2606b5 HorizontalSteppingSlider.st --- a/HorizontalSteppingSlider.st Mon Jul 03 04:35:33 1995 +0200 +++ b/HorizontalSteppingSlider.st Sun Jul 23 05:13:10 1995 +0200 @@ -13,7 +13,7 @@ 'From Smalltalk/X, Version:2.10.3 on 27-sep-1994 at 12:56:30'! HorizontalScrollBar subclass:#HorizontalSteppingSlider - instanceVariableNames:'' + instanceVariableNames:'stepIncrement' classVariableNames:'' poolDictionaries:'' category:'Views-Interactors' @@ -23,7 +23,7 @@ COPYRIGHT (c) 1994 by Claus Gittinger All Rights Reserved -$Header: /cvs/stx/stx/libwidg2/HorizontalSteppingSlider.st,v 1.2 1995-05-03 00:42:35 claus Exp $ +$Header: /cvs/stx/stx/libwidg2/HorizontalSteppingSlider.st,v 1.3 1995-07-23 03:12:43 claus Exp $ '! !HorizontalSteppingSlider class methodsFor:'documentation'! @@ -44,7 +44,7 @@ version " -$Header: /cvs/stx/stx/libwidg2/HorizontalSteppingSlider.st,v 1.2 1995-05-03 00:42:35 claus Exp $ +$Header: /cvs/stx/stx/libwidg2/HorizontalSteppingSlider.st,v 1.3 1995-07-23 03:12:43 claus Exp $ " ! @@ -80,20 +80,69 @@ initialize super initialize. - self scrollDownAction:[|nO| - nO := (thumb thumbOrigin + 1) min:100. - thumb thumbOrigin:nO. - thumb tellOthers "scrollAction value:nO"]. - self scrollUpAction:[|nO| - nO := (thumb thumbOrigin - 1) max:0. - thumb thumbOrigin:nO. - thumb tellOthers "scrollAction value:nO"]. + stepIncrement := 1. + self scrollDownAction:[self scrollStepUp]. + self scrollUpAction:[self scrollStepDown]. ! ! !HorizontalSteppingSlider methodsFor:'accessing'! model:aModel thumb model:aModel +! + +stepIncrement:aNumber + "set the value used for stepping (defaults to 1)" + + stepIncrement := aNumber +! + +step:aNumber + "same as stepIncrement; + set the value used for stepping (defaults to 1)" + + stepIncrement := aNumber +! + +step + ^ stepIncrement +! + +start:start stop:stop step:step + thumb start:start stop:stop. + stepIncrement := step +! ! + +!HorizontalSteppingSlider methodsFor:'events'! + +keyPress:key x:x y:y + key == #CursorRight ifTrue:[ + self scrollStepUp. + ^ self + ]. + key == #CursorLeft ifTrue:[ + self scrollStepDown. + ^ self + ]. + super keyPress:key x:x y:y +! ! + +!HorizontalSteppingSlider methodsFor:'private'! + +scrollStepUp + |nO| + + nO := (thumb thumbOrigin + stepIncrement) min:thumb stop. + thumb thumbOrigin:nO. + thumb tellOthers. +! + +scrollStepDown + |nO| + + nO := (thumb thumbOrigin - stepIncrement) max:thumb start. + thumb thumbOrigin:nO. + thumb tellOthers. ! ! !HorizontalSteppingSlider methodsFor:'misc'! diff -r 10910b8b003a -r 40e27e2606b5 Make.proto --- a/Make.proto Mon Jul 03 04:35:33 1995 +0200 +++ b/Make.proto Sun Jul 23 05:13:10 1995 +0200 @@ -1,4 +1,4 @@ -# $Header: /cvs/stx/stx/libwidg2/Make.proto,v 1.22 1995-06-27 02:25:33 claus Exp $ +# $Header: /cvs/stx/stx/libwidg2/Make.proto,v 1.23 1995-07-23 03:13:10 claus Exp $ # # -------------- no need to change anything below ---------- @@ -49,7 +49,7 @@ -rm -f *.c *.H clean:: - -rm -f *.c *.H abbrev.stc classList.stc + -rm -f [A-Z]*.o *.c *.H abbrev.stc classList.stc clobber:: -rm -f *.c *.H abbrev.stc classList.stc diff -r 10910b8b003a -r 40e27e2606b5 StepSlider.st --- a/StepSlider.st Mon Jul 03 04:35:33 1995 +0200 +++ b/StepSlider.st Sun Jul 23 05:13:10 1995 +0200 @@ -23,7 +23,7 @@ COPYRIGHT (c) 1994 by Claus Gittinger All Rights Reserved -$Header: /cvs/stx/stx/libwidg2/Attic/StepSlider.st,v 1.3 1995-05-12 18:40:34 claus Exp $ +$Header: /cvs/stx/stx/libwidg2/Attic/StepSlider.st,v 1.4 1995-07-23 03:12:59 claus Exp $ '! !SteppingSlider class methodsFor:'documentation'! @@ -44,7 +44,7 @@ version " -$Header: /cvs/stx/stx/libwidg2/Attic/StepSlider.st,v 1.3 1995-05-12 18:40:34 claus Exp $ +$Header: /cvs/stx/stx/libwidg2/Attic/StepSlider.st,v 1.4 1995-07-23 03:12:59 claus Exp $ " ! @@ -117,14 +117,8 @@ initialize super initialize. stepIncrement := 1. - self scrollDownAction:[|nO| - nO := (thumb thumbOrigin + stepIncrement) min:100. - thumb thumbOrigin:nO. - thumb tellOthers "scrollAction value:nO"]. - self scrollUpAction:[|nO| - nO := (thumb thumbOrigin - stepIncrement) max:0. - thumb thumbOrigin:nO. - thumb tellOthers "scrollAction value:nO"]. + self scrollDownAction:[self scrollStepUp]. + self scrollUpAction:[self scrollStepDown]. ! ! !SteppingSlider methodsFor:'accessing'! @@ -137,6 +131,54 @@ "set the value used for stepping (defaults to 1)" stepIncrement := aNumber +! + +step:aNumber + "same as stepIncrement; + set the value used for stepping (defaults to 1)" + + stepIncrement := aNumber +! + +step + ^ stepIncrement +! + +start:start stop:stop step:step + thumb start:start stop:stop. + stepIncrement := step +! ! + +!SteppingSlider methodsFor:'events'! + +keyPress:key x:x y:y + key == #CursorRight ifTrue:[ + self scrollStepUp. + ^ self + ]. + key == #CursorLeft ifTrue:[ + self scrollStepDown. + ^ self + ]. + super keyPress:key x:x y:y +! ! + +!SteppingSlider methodsFor:'private'! + +scrollStepUp + |nO| + + nO := (thumb thumbOrigin + stepIncrement) min:thumb stop. + thumb thumbOrigin:nO. + thumb tellOthers. +! + +scrollStepDown + |nO| + + nO := (thumb thumbOrigin - stepIncrement) max:thumb start. + thumb thumbOrigin:nO. + thumb tellOthers. ! ! !SteppingSlider methodsFor:'misc'! diff -r 10910b8b003a -r 40e27e2606b5 SteppingSlider.st --- a/SteppingSlider.st Mon Jul 03 04:35:33 1995 +0200 +++ b/SteppingSlider.st Sun Jul 23 05:13:10 1995 +0200 @@ -23,7 +23,7 @@ COPYRIGHT (c) 1994 by Claus Gittinger All Rights Reserved -$Header: /cvs/stx/stx/libwidg2/SteppingSlider.st,v 1.3 1995-05-12 18:40:34 claus Exp $ +$Header: /cvs/stx/stx/libwidg2/SteppingSlider.st,v 1.4 1995-07-23 03:12:59 claus Exp $ '! !SteppingSlider class methodsFor:'documentation'! @@ -44,7 +44,7 @@ version " -$Header: /cvs/stx/stx/libwidg2/SteppingSlider.st,v 1.3 1995-05-12 18:40:34 claus Exp $ +$Header: /cvs/stx/stx/libwidg2/SteppingSlider.st,v 1.4 1995-07-23 03:12:59 claus Exp $ " ! @@ -117,14 +117,8 @@ initialize super initialize. stepIncrement := 1. - self scrollDownAction:[|nO| - nO := (thumb thumbOrigin + stepIncrement) min:100. - thumb thumbOrigin:nO. - thumb tellOthers "scrollAction value:nO"]. - self scrollUpAction:[|nO| - nO := (thumb thumbOrigin - stepIncrement) max:0. - thumb thumbOrigin:nO. - thumb tellOthers "scrollAction value:nO"]. + self scrollDownAction:[self scrollStepUp]. + self scrollUpAction:[self scrollStepDown]. ! ! !SteppingSlider methodsFor:'accessing'! @@ -137,6 +131,54 @@ "set the value used for stepping (defaults to 1)" stepIncrement := aNumber +! + +step:aNumber + "same as stepIncrement; + set the value used for stepping (defaults to 1)" + + stepIncrement := aNumber +! + +step + ^ stepIncrement +! + +start:start stop:stop step:step + thumb start:start stop:stop. + stepIncrement := step +! ! + +!SteppingSlider methodsFor:'events'! + +keyPress:key x:x y:y + key == #CursorRight ifTrue:[ + self scrollStepUp. + ^ self + ]. + key == #CursorLeft ifTrue:[ + self scrollStepDown. + ^ self + ]. + super keyPress:key x:x y:y +! ! + +!SteppingSlider methodsFor:'private'! + +scrollStepUp + |nO| + + nO := (thumb thumbOrigin + stepIncrement) min:thumb stop. + thumb thumbOrigin:nO. + thumb tellOthers. +! + +scrollStepDown + |nO| + + nO := (thumb thumbOrigin - stepIncrement) max:thumb start. + thumb thumbOrigin:nO. + thumb tellOthers. ! ! !SteppingSlider methodsFor:'misc'!