author | Claus Gittinger <cg@exept.de> |
Wed, 28 May 1997 16:21:05 +0200 | |
changeset 402 | db4b13aff9c9 |
parent 400 | d176fd820716 |
child 871 | 831b19654aae |
permissions | -rw-r--r-- |
23 | 1 |
" |
2 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
49 | 3 |
All Rights Reserved |
23 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
ScrollBar subclass:#SteppingSlider |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
14 |
instanceVariableNames:'stepIncrement' |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
15 |
classVariableNames:'' |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
16 |
poolDictionaries:'' |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
17 |
category:'Views-Interactors' |
23 | 18 |
! |
19 |
||
20 |
!SteppingSlider class methodsFor:'documentation'! |
|
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
49 | 25 |
All Rights Reserved |
23 | 26 |
|
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
documentation |
|
37 |
" |
|
38 |
SteppingSliders are like Sliders, but add step-up and step-down |
|
39 |
buttons (which increment/decrement the value). |
|
57 | 40 |
(you can also think of them as a ScrollBar with a slider instead of |
41 |
a scroller as component) |
|
23 | 42 |
" |
49 | 43 |
! |
44 |
||
45 |
examples |
|
46 |
" |
|
47 |
non model operation: |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
48 |
[exBegin] |
49 | 49 |
|top sl| |
50 |
||
51 |
top := StandardSystemView extent:200@200. |
|
52 |
sl := SteppingSlider in:top. |
|
53 |
sl origin:(0.0@0.0) corner:(sl width@1.0). |
|
184 | 54 |
sl scrollAction:[:pos | Transcript showCR:pos]. |
49 | 55 |
top open |
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
56 |
[exEnd] |
49 | 57 |
|
58 |
||
57 | 59 |
change the step: |
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
60 |
[exBegin] |
57 | 61 |
|top sl| |
49 | 62 |
|
63 |
top := StandardSystemView extent:200@200. |
|
64 |
sl := SteppingSlider in:top. |
|
65 |
sl origin:(0.0@0.0) corner:(sl width@1.0). |
|
184 | 66 |
sl scrollAction:[:pos | Transcript showCR:pos]. |
57 | 67 |
sl stepIncrement:10. |
68 |
top open |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
69 |
[exEnd] |
57 | 70 |
|
71 |
||
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
72 |
model operation (watch the value): |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
73 |
[exBegin] |
57 | 74 |
|model top sl fld| |
75 |
||
76 |
model := 0 asValue. |
|
77 |
||
78 |
top := StandardSystemView extent:200@200. |
|
79 |
top label:'slider on model'. |
|
80 |
sl := SteppingSlider in:top. |
|
81 |
sl origin:(0.0@0.0) corner:(sl width@1.0). |
|
49 | 82 |
sl model:model. |
57 | 83 |
top open. |
84 |
||
85 |
top := StandardSystemView extent:200@200. |
|
86 |
top label:'inputField on model'. |
|
87 |
fld := EditField in:top. |
|
88 |
fld origin:(0.0@0.0) corner:(1.0 @ fld height). |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
89 |
fld converter:(PrintConverter new initForNumber); model:model. |
49 | 90 |
top open |
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
91 |
[exEnd] |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
92 |
|
23 | 93 |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
94 |
two views on the same model: |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
95 |
[exBegin] |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
96 |
|model top sl fld| |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
97 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
98 |
model := 0 asValue. |
23 | 99 |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
100 |
top := StandardSystemView extent:200@200. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
101 |
top label:'slider on model'. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
102 |
sl := SteppingSlider in:top. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
103 |
sl origin:(0.0@0.0) corner:(sl width@1.0). |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
104 |
sl model:model. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
105 |
top open. |
23 | 106 |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
107 |
top := StandardSystemView extent:200@200. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
108 |
top label:'slider on model'. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
109 |
sl := ThumbWheel in:top. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
110 |
sl origin:(0.0@0.0) corner:(20@1.0). |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
111 |
sl model:model. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
112 |
top open. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
113 |
[exEnd] |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
114 |
" |
49 | 115 |
! ! |
116 |
||
117 |
!SteppingSlider methodsFor:'accessing'! |
|
118 |
||
119 |
model:aModel |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
120 |
"set the model - forwarded to the thumb. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
121 |
if nonNil, this will get the thumbs origin |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
122 |
via #value: messages" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
123 |
|
49 | 124 |
thumb model:aModel |
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
125 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
126 |
"Modified: 28.5.1997 / 15:07:55 / cg" |
57 | 127 |
! |
128 |
||
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
129 |
start:start stop:stop step:step |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
130 |
"set start (min), stop (max) and step increment. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
131 |
The increment is used when clicking on a step button" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
132 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
133 |
thumb start:start stop:stop. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
134 |
stepIncrement := step |
57 | 135 |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
136 |
"Modified: 28.5.1997 / 15:03:56 / cg" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
137 |
! |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
138 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
139 |
step |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
140 |
"return the step increment. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
141 |
The increment is used when clicking on a step button" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
142 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
143 |
^ stepIncrement |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
144 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
145 |
"Modified: 28.5.1997 / 15:04:01 / cg" |
65 | 146 |
! |
147 |
||
148 |
step:aNumber |
|
149 |
"same as stepIncrement; |
|
150 |
set the value used for stepping (defaults to 1)" |
|
151 |
||
152 |
stepIncrement := aNumber |
|
153 |
! |
|
154 |
||
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
155 |
stepIncrement:aNumber |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
156 |
"set the value used for stepping (defaults to 1). |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
157 |
Same as #step: for compatibility." |
65 | 158 |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
159 |
stepIncrement := aNumber |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
160 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
161 |
"Modified: 28.5.1997 / 15:04:25 / cg" |
65 | 162 |
! ! |
163 |
||
164 |
!SteppingSlider methodsFor:'events'! |
|
165 |
||
166 |
keyPress:key x:x y:y |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
167 |
"handle cursor left/right for stepping" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
168 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
169 |
(key == #CursorRight or:[key == #CursorUp]) ifTrue:[ |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
170 |
self scrollStepUp. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
171 |
^ self |
65 | 172 |
]. |
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
173 |
(key == #CursorLeft or:[key == #CursorDown]) ifTrue:[ |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
174 |
self scrollStepDown. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
175 |
^ self |
65 | 176 |
]. |
177 |
super keyPress:key x:x y:y |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
178 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
179 |
"Modified: 28.5.1997 / 15:08:36 / cg" |
65 | 180 |
! ! |
181 |
||
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
182 |
!SteppingSlider methodsFor:'initialization'! |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
183 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
184 |
createElements |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
185 |
"create the scroller and the two step buttons" |
65 | 186 |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
187 |
self orientation == #horizontal ifTrue:[ |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
188 |
button1 := ArrowButton leftIn:self. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
189 |
button1 name:'LeftButton'. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
190 |
button2 := ArrowButton rightIn:self. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
191 |
button2 name:'RightButton'. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
192 |
thumb := HorizontalSlider in:self. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
193 |
] ifFalse:[ |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
194 |
button1 := ArrowButton upIn:self. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
195 |
button1 name:'UpButton'. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
196 |
button2 := ArrowButton downIn:self. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
197 |
button2 name:'DownButton'. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
198 |
thumb := Slider in:self. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
199 |
]. |
65 | 200 |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
201 |
"Modified: 28.5.1997 / 15:09:50 / cg" |
65 | 202 |
! |
203 |
||
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
204 |
initialize |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
205 |
"initialize; the increment is set to 1 (one)" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
206 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
207 |
super initialize. |
65 | 208 |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
209 |
stepIncrement := 1. |
402
db4b13aff9c9
more code moved to superclass
Claus Gittinger <cg@exept.de>
parents:
400
diff
changeset
|
210 |
buttonLayout := #around. |
db4b13aff9c9
more code moved to superclass
Claus Gittinger <cg@exept.de>
parents:
400
diff
changeset
|
211 |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
212 |
self scrollDownAction:[self scrollStepUp]. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
213 |
self scrollUpAction:[self scrollStepDown]. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
214 |
|
402
db4b13aff9c9
more code moved to superclass
Claus Gittinger <cg@exept.de>
parents:
400
diff
changeset
|
215 |
"Modified: 28.5.1997 / 16:12:04 / cg" |
23 | 216 |
! ! |
217 |
||
218 |
!SteppingSlider methodsFor:'misc'! |
|
219 |
||
220 |
doesNotUnderstand:aMessage |
|
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
221 |
"forward any unimplemented message to the scroller" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
222 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
223 |
^ aMessage sendTo:thumb |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
224 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
225 |
"Modified: 28.5.1997 / 15:05:37 / cg" |
23 | 226 |
! ! |
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
227 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
228 |
!SteppingSlider methodsFor:'private'! |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
229 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
230 |
scrollStep:delta |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
231 |
"step by some delta" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
232 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
233 |
|oldOrg newOrg| |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
234 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
235 |
oldOrg := thumb thumbOrigin. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
236 |
newOrg := ((oldOrg + delta) max:thumb start) min:thumb stop. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
237 |
oldOrg ~= newOrg ifTrue:[ |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
238 |
thumb thumbOrigin:newOrg. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
239 |
thumb tellOthers. |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
240 |
] |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
241 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
242 |
"Created: 28.5.1997 / 15:10:51 / cg" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
243 |
! |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
244 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
245 |
scrollStepDown |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
246 |
"sent when the step-down button is pressd" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
247 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
248 |
self scrollStep:stepIncrement negated |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
249 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
250 |
"Modified: 28.5.1997 / 15:11:02 / cg" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
251 |
! |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
252 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
253 |
scrollStepUp |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
254 |
"sent when the step-up button is pressd" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
255 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
256 |
self scrollStep:stepIncrement |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
257 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
258 |
"Modified: 28.5.1997 / 15:11:08 / cg" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
259 |
! ! |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
260 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
261 |
!SteppingSlider methodsFor:'queries'! |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
262 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
263 |
orientation |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
264 |
^ #vertical |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
265 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
266 |
"Created: 28.5.1997 / 15:11:24 / cg" |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
267 |
! ! |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
268 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
269 |
!SteppingSlider class methodsFor:'documentation'! |
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
270 |
|
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
271 |
version |
402
db4b13aff9c9
more code moved to superclass
Claus Gittinger <cg@exept.de>
parents:
400
diff
changeset
|
272 |
^ '$Header: /cvs/stx/stx/libwidg2/SteppingSlider.st,v 1.9 1997-05-28 14:21:01 cg Exp $' |
400
d176fd820716
merged common code from steppingSlider & horizontalSteppingSlider
Claus Gittinger <cg@exept.de>
parents:
184
diff
changeset
|
273 |
! ! |