11 " |
11 " |
12 |
12 |
13 'From Smalltalk/X, Version:2.10.3 on 27-sep-1994 at 12:56:30'! |
13 'From Smalltalk/X, Version:2.10.3 on 27-sep-1994 at 12:56:30'! |
14 |
14 |
15 HorizontalScrollBar subclass:#HorizontalSteppingSlider |
15 HorizontalScrollBar subclass:#HorizontalSteppingSlider |
16 instanceVariableNames:'' |
16 instanceVariableNames:'stepIncrement' |
17 classVariableNames:'' |
17 classVariableNames:'' |
18 poolDictionaries:'' |
18 poolDictionaries:'' |
19 category:'Views-Interactors' |
19 category:'Views-Interactors' |
20 ! |
20 ! |
21 |
21 |
22 HorizontalSteppingSlider comment:' |
22 HorizontalSteppingSlider comment:' |
23 COPYRIGHT (c) 1994 by Claus Gittinger |
23 COPYRIGHT (c) 1994 by Claus Gittinger |
24 All Rights Reserved |
24 All Rights Reserved |
25 |
25 |
26 $Header: /cvs/stx/stx/libwidg2/Attic/HStepSlider.st,v 1.2 1995-05-03 00:42:35 claus Exp $ |
26 $Header: /cvs/stx/stx/libwidg2/Attic/HStepSlider.st,v 1.3 1995-07-23 03:12:43 claus Exp $ |
27 '! |
27 '! |
28 |
28 |
29 !HorizontalSteppingSlider class methodsFor:'documentation'! |
29 !HorizontalSteppingSlider class methodsFor:'documentation'! |
30 |
30 |
31 copyright |
31 copyright |
78 thumb := HorizontalSlider in:self. |
78 thumb := HorizontalSlider in:self. |
79 ! |
79 ! |
80 |
80 |
81 initialize |
81 initialize |
82 super initialize. |
82 super initialize. |
83 self scrollDownAction:[|nO| |
83 stepIncrement := 1. |
84 nO := (thumb thumbOrigin + 1) min:100. |
84 self scrollDownAction:[self scrollStepUp]. |
85 thumb thumbOrigin:nO. |
85 self scrollUpAction:[self scrollStepDown]. |
86 thumb tellOthers "scrollAction value:nO"]. |
|
87 self scrollUpAction:[|nO| |
|
88 nO := (thumb thumbOrigin - 1) max:0. |
|
89 thumb thumbOrigin:nO. |
|
90 thumb tellOthers "scrollAction value:nO"]. |
|
91 ! ! |
86 ! ! |
92 |
87 |
93 !HorizontalSteppingSlider methodsFor:'accessing'! |
88 !HorizontalSteppingSlider methodsFor:'accessing'! |
94 |
89 |
95 model:aModel |
90 model:aModel |
96 thumb model:aModel |
91 thumb model:aModel |
|
92 ! |
|
93 |
|
94 stepIncrement:aNumber |
|
95 "set the value used for stepping (defaults to 1)" |
|
96 |
|
97 stepIncrement := aNumber |
|
98 ! |
|
99 |
|
100 step:aNumber |
|
101 "same as stepIncrement; |
|
102 set the value used for stepping (defaults to 1)" |
|
103 |
|
104 stepIncrement := aNumber |
|
105 ! |
|
106 |
|
107 step |
|
108 ^ stepIncrement |
|
109 ! |
|
110 |
|
111 start:start stop:stop step:step |
|
112 thumb start:start stop:stop. |
|
113 stepIncrement := step |
|
114 ! ! |
|
115 |
|
116 !HorizontalSteppingSlider methodsFor:'events'! |
|
117 |
|
118 keyPress:key x:x y:y |
|
119 key == #CursorRight ifTrue:[ |
|
120 self scrollStepUp. |
|
121 ^ self |
|
122 ]. |
|
123 key == #CursorLeft ifTrue:[ |
|
124 self scrollStepDown. |
|
125 ^ self |
|
126 ]. |
|
127 super keyPress:key x:x y:y |
|
128 ! ! |
|
129 |
|
130 !HorizontalSteppingSlider methodsFor:'private'! |
|
131 |
|
132 scrollStepUp |
|
133 |nO| |
|
134 |
|
135 nO := (thumb thumbOrigin + stepIncrement) min:thumb stop. |
|
136 thumb thumbOrigin:nO. |
|
137 thumb tellOthers. |
|
138 ! |
|
139 |
|
140 scrollStepDown |
|
141 |nO| |
|
142 |
|
143 nO := (thumb thumbOrigin - stepIncrement) max:thumb start. |
|
144 thumb thumbOrigin:nO. |
|
145 thumb tellOthers. |
97 ! ! |
146 ! ! |
98 |
147 |
99 !HorizontalSteppingSlider methodsFor:'misc'! |
148 !HorizontalSteppingSlider methodsFor:'misc'! |
100 |
149 |
101 doesNotUnderstand:aMessage |
150 doesNotUnderstand:aMessage |