SteppingSlider.st
changeset 49 4dd0f5c3353e
parent 23 1e6bf473d863
child 57 126745871373
--- a/SteppingSlider.st	Sun Apr 30 15:40:33 1995 +0200
+++ b/SteppingSlider.st	Wed May 03 02:43:15 1995 +0200
@@ -1,6 +1,6 @@
 "
  COPYRIGHT (c) 1994 by Claus Gittinger
-              All Rights Reserved
+	      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
@@ -21,9 +21,9 @@
 
 SteppingSlider comment:'
 COPYRIGHT (c) 1994 by Claus Gittinger
-              All Rights Reserved
+	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libwidg2/SteppingSlider.st,v 1.1 1994-10-10 03:13:44 claus Exp $
+$Header: /cvs/stx/stx/libwidg2/SteppingSlider.st,v 1.2 1995-05-03 00:43:02 claus Exp $
 '!
 
 !SteppingSlider class methodsFor:'documentation'!
@@ -31,7 +31,7 @@
 copyright
 "
  COPYRIGHT (c) 1994 by Claus Gittinger
-              All Rights Reserved
+	      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
@@ -44,7 +44,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libwidg2/SteppingSlider.st,v 1.1 1994-10-10 03:13:44 claus Exp $
+$Header: /cvs/stx/stx/libwidg2/SteppingSlider.st,v 1.2 1995-05-03 00:43:02 claus Exp $
 "
 !
 
@@ -53,9 +53,36 @@
     SteppingSliders are like Sliders, but add step-up and step-down
     buttons (which increment/decrement the value).
 "
+!
+
+examples 
+"
+    non model operation:
+
+      |top sl|
+
+      top := StandardSystemView extent:200@200.
+      sl := SteppingSlider in:top.
+      sl origin:(0.0@0.0) corner:(sl width@1.0).
+      sl scrollAction:[:pos | Transcript showCr:pos].    
+      top open
+
+
+    model operation (look at value in model):
+
+      |model top sl|
+
+      model := 0 asValue.
+      model inspect.
+
+      top := StandardSystemView extent:200@200.
+      sl := SteppingSlider in:top.
+      sl origin:(0.0@0.0) corner:(sl width@1.0).
+      sl model:model.
+      top open
+"
 ! !
 
-
 !SteppingSlider methodsFor:'initialization'!
 
 createElements
@@ -68,14 +95,21 @@
 
 initialize
     super initialize.
+    rangeStep := 1.
     self scrollDownAction:[|nO|
-                         nO := (thumb thumbOrigin + 1) min:100.         
-                         thumb thumbOrigin:nO.
-                         thumb scrollAction value: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 scrollAction value:nO].
+			 nO := (thumb thumbOrigin - 1) max:0.
+			 thumb thumbOrigin:nO.
+			 thumb tellOthers "scrollAction value:nO"].
+! !
+
+!SteppingSlider methodsFor:'accessing'!
+
+model:aModel
+    thumb model:aModel
 ! !
 
 !SteppingSlider methodsFor:'misc'!