HorizontalSlider.st
changeset 49 4dd0f5c3353e
parent 48 c844acacf010
child 65 40e27e2606b5
--- a/HorizontalSlider.st	Sun Apr 30 15:40:33 1995 +0200
+++ b/HorizontalSlider.st	Wed May 03 02:43:15 1995 +0200
@@ -10,18 +10,20 @@
  hereby transferred.
 "
 
-HorizontalScroller subclass:#HorizontalSlider
-       instanceVariableNames:'sliderHeight'
-       classVariableNames:   ''
-       poolDictionaries:''
-       category:'Views-Interactors'
+'From Smalltalk/X, Version:2.10.5 on 30-apr-1995 at 1:46:29 am'!
+
+Slider subclass:#HorizontalSlider
+	 instanceVariableNames:''
+	 classVariableNames:''
+	 poolDictionaries:''
+	 category:'Views-Interactors'
 !
 
 HorizontalSlider comment:'
 COPYRIGHT (c) 1992 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libwidg2/HorizontalSlider.st,v 1.3 1995-04-30 13:40:33 claus Exp $
+$Header: /cvs/stx/stx/libwidg2/HorizontalSlider.st,v 1.4 1995-05-03 00:42:32 claus Exp $
 '!
 
 !HorizontalSlider class methodsFor:'documentation'!
@@ -42,7 +44,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libwidg2/HorizontalSlider.st,v 1.3 1995-04-30 13:40:33 claus Exp $
+$Header: /cvs/stx/stx/libwidg2/HorizontalSlider.st,v 1.4 1995-05-03 00:42:32 claus Exp $
 "
 !
 
@@ -55,65 +57,8 @@
 !HorizontalSlider methodsFor:'initialization'!
 
 initialize
-    sliderHeight := (self verticalPixelPerMillimeter:10) rounded.
     super initialize.
-    thumbHeight := 0.
-!
-
-initStyle
-    super initStyle.
-    tallyMarks := StyleSheet at:'sliderNTallyMarks' default:1.
-    tallyLevel := StyleSheet at:'sliderTallyLevel' default:-1.    
-! !
-
-!HorizontalSlider methodsFor:'accessing'!
-
-thumbHeight
-    "redefined since a slider has no height - just origin"
-
-    ^ nil
+    sliderHeight := (self horizontalPixelPerMillimeter:10) rounded.
+    orientation := #horizontal 
 ! !
 
-!HorizontalSlider methodsFor:'private'!
-
-absFromPercent:percent
-    "given a percentage, compute number of pixels"
-
-    ^ ((percent * (width - sliderHeight - (margin * 2))) / 100) rounded 
-!
-
-percentFromAbs:absValue
-    "given a number of pixels, compute percentage"
-
-    |val|
-
-    val := absValue / (width - sliderHeight - (margin * 2)) * 100.
-    val < 0 ifTrue:[^ 0].
-    val > 100 ifTrue:[^ 100].
-    ^ val
-!
-
-computeThumbFrame
-    "redefined, since the thumb-height stays constant"
-
-    |nh nw ny nx|
-
-    thumbHeight := 0.
-    nx := (self absFromPercent:thumbOrigin) + margin.
-    nw := sliderHeight.
-    ny := margin + inset.     
-    nh := height - (2 * ny).
-    "
-     do not create new Rectangle if its the same anyway
-    "
-    thumbFrame notNil ifTrue:[
-	(ny == thumbFrame top) ifTrue:[
-	  (nx == thumbFrame left) ifTrue:[
-	    (nh == thumbFrame height) ifTrue:[
-	      (nw == thumbFrame width) ifTrue:[ ^ self]
-	    ]
-	  ]
-	]
-    ].
-    thumbFrame := Rectangle left:nx top:ny width:nw height:nh
-! !