203 !ViewScroller methodsFor:'queries-contents'! |
209 !ViewScroller methodsFor:'queries-contents'! |
204 |
210 |
205 heightOfContents |
211 heightOfContents |
206 "return my contents' height; this is the scrolledViews height" |
212 "return my contents' height; this is the scrolledViews height" |
207 |
213 |
|
214 scrolledView isNil ifTrue:[^ super heightOfContents]. |
208 ^ scrolledView height |
215 ^ scrolledView height |
209 |
216 |
210 "Modified: 24.5.1996 / 17:34:48 / cg" |
217 "Modified: 24.5.1996 / 17:34:48 / cg" |
211 ! |
218 ! |
212 |
219 |
213 viewOrigin |
220 viewOrigin |
214 "the viewOrigin (for scrollBars) is based upon the scrolledViews origin" |
221 "the viewOrigin (for scrollBars) is based upon the scrolledViews origin" |
215 |
222 |
|
223 scrolledView isNil ifTrue:[^ 0@0]. |
216 ^ scrolledView origin negated |
224 ^ scrolledView origin negated |
217 |
225 |
218 "Modified: 24.5.1996 / 17:48:13 / cg" |
226 "Modified: 24.5.1996 / 17:48:13 / cg" |
219 ! |
227 ! |
220 |
228 |
221 widthOfContents |
229 widthOfContents |
222 "return my contents' width; this is the scrolledViews width" |
230 "return my contents' width; this is the scrolledViews width" |
223 |
231 |
|
232 scrolledView isNil ifTrue:[^ super widthOfContents]. |
224 ^ scrolledView width |
233 ^ scrolledView width |
225 |
234 |
226 "Modified: 24.5.1996 / 17:34:56 / cg" |
235 "Modified: 24.5.1996 / 17:34:56 / cg" |
227 ! ! |
236 ! ! |
228 |
237 |
229 !ViewScroller methodsFor:'scrolling'! |
238 !ViewScroller methodsFor:'scrolling'! |
|
239 |
|
240 horizontalScrollStep |
|
241 "return the amount by which to step-scroll horizontally" |
|
242 |
|
243 ^ self width // 2 |
|
244 ! |
230 |
245 |
231 scrollTo:aPoint |
246 scrollTo:aPoint |
232 "change origin of scrolledView to scroll to aPoint" |
247 "change origin of scrolledView to scroll to aPoint" |
233 |
248 |
234 |wCont hCont "{ Class:SmallInteger }" |
249 |wCont hCont "{ Class:SmallInteger }" |
235 iw ih "{ Class:SmallInteger }" |
250 iw ih "{ Class:SmallInteger }" |
236 viewOrigin orgX orgY newX newY| |
251 viewOrigin orgX orgY newX newY| |
|
252 |
|
253 scrolledView isNil ifTrue:[^ self]. |
237 |
254 |
238 viewOrigin := scrolledView origin. |
255 viewOrigin := scrolledView origin. |
239 orgX := viewOrigin x negated. |
256 orgX := viewOrigin x negated. |
240 orgY := viewOrigin y negated. |
257 orgY := viewOrigin y negated. |
241 |
258 |
262 self originWillChange. |
279 self originWillChange. |
263 scrolledView origin:(newX negated @ newY negated). |
280 scrolledView origin:(newX negated @ newY negated). |
264 self originChanged:((newX-orgX) negated @ (newY-orgY) negated). |
281 self originChanged:((newX-orgX) negated @ (newY-orgY) negated). |
265 |
282 |
266 "Modified: 21.8.1996 / 09:17:49 / stefan" |
283 "Modified: 21.8.1996 / 09:17:49 / stefan" |
267 ! ! |
284 ! |
268 |
285 |
269 !ViewScroller class methodsFor:'documentation'! |
286 verticalScrollStep |
|
287 "return the amount by which to step-scroll vertically" |
|
288 |
|
289 ^ self height // 2 |
|
290 ! ! |
|
291 |
|
292 !ViewScroller class methodsFor:'documentation'! |
270 |
293 |
271 version |
294 version |
272 ^ '$Header: /cvs/stx/stx/libwidg2/ViewScroller.st,v 1.10 1996-08-21 08:15:42 stefan Exp $' |
295 ^ '$Header: /cvs/stx/stx/libwidg2/ViewScroller.st,v 1.11 1997-06-17 18:55:46 ca Exp $' |
273 ! ! |
296 ! ! |