author | Claus Gittinger <cg@exept.de> |
Fri, 27 Feb 1998 15:15:15 +0100 | |
changeset 1460 | b9929a029249 |
parent 1459 | 2e96c4f14554 |
child 1486 | 937a425595ef |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
1111 | 3 |
All Rights Reserved |
0 | 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 |
||
119 | 13 |
SimpleView subclass:#ScrollableView |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
14 |
instanceVariableNames:'scrolledView vScrollBar hScrollBar scrollBarPosition lockUpdates |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
15 |
hideScrollBars hasHorizontalScrollBar hasVerticalScrollBar |
1138 | 16 |
horizontalMini verticalMini vScrollBarHidden hScrollBarHidden |
17 |
vScrollBarVisible hScrollBarVisible' |
|
1111 | 18 |
classVariableNames:'DefaultScrolledViewLevel DefaultScrolledViewMargin |
19 |
DefaultScrollBarSpacing DefaultScrolledViewBorderWidth |
|
20 |
DefaultLevel DefaultScrollBarLevel MyDefaultViewBackgroundColor' |
|
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
21 |
poolDictionaries:'' |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
22 |
category:'Views-Basic' |
0 | 23 |
! |
24 |
||
852 | 25 |
!ScrollableView class methodsFor:'documentation'! |
38 | 26 |
|
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
1111 | 30 |
All Rights Reserved |
38 | 31 |
|
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
41 |
documentation |
|
42 |
" |
|
43 |
a view containing a scrollbar and some other (slave-)view. |
|
130 | 44 |
This view wraps scrollbar(s) around the view to be scrolled. |
65 | 45 |
The scrollbars are setup to send scrollUp/scrollDown/scrollVerticalTo |
46 |
and scrollLeft/scrollRight/scrollHorizontalTo- messages whenever moved. |
|
130 | 47 |
The view itself has to implement these (there is a default implementation |
1459 | 48 |
in the common View class for this - so your widgets usually dont have to |
49 |
care for this). |
|
65 | 50 |
|
51 |
For the scrollbars to know about the full (maximum) size, the view |
|
1459 | 52 |
MUST implement #heightOfContents and/or #widthOfContents. |
53 |
The values returned by those methods are used to compute the fraction |
|
130 | 54 |
which is visible (i.e. the scrollers thumb heights). |
65 | 55 |
|
1459 | 56 |
There are three ways to setup a scrollableView: |
38 | 57 |
if the type of the view to be scrolled is known in advance, |
58 |
use: |
|
584 | 59 |
v := ScrollableView for:<ViewClass> |
130 | 60 |
or: |
584 | 61 |
v := ScrollableView for:<ViewClass> in:someSuperView |
65 | 62 |
|
1459 | 63 |
|
64 |
otherwise, create an empty scrollableView with: |
|
130 | 65 |
|
584 | 66 |
v := ScrollableView new |
130 | 67 |
or: |
584 | 68 |
v := ScrollableView in:someSuperView |
130 | 69 |
|
65 | 70 |
and define the view later with: |
130 | 71 |
|
584 | 72 |
v scrolledView:aViewToBeScrolled |
65 | 73 |
|
1459 | 74 |
|
130 | 75 |
Finally, if the view to be scrolled has been already created, |
76 |
use: |
|
77 |
||
584 | 78 |
v := ScrollableView forView:aViewToBeScrolled |
130 | 79 |
or: |
584 | 80 |
v := ScrollableView forView:aViewToBeScrolled in:someSuperView |
65 | 81 |
|
130 | 82 |
It is also possible to change the scrolledView later (even multiple times). |
83 |
This may be useful, if different views are needed to display different types |
|
84 |
of data (see example2) and at creation time, it is not known what type |
|
1459 | 85 |
of view is required (multidocument format applications). |
130 | 86 |
|
1459 | 87 |
If you want to scroll a bucnh of other views (instead of a views contents), |
88 |
you need a companion class (ViewScroller). See the documentation there. |
|
65 | 89 |
|
90 |
If you need horizontal scrolling too, use an instance of HVScrollableView. |
|
113 | 91 |
|
92 |
By default, scrollbars are full size scrollbars - for horizontal scrolling |
|
93 |
(which is less often used), scrollableViews can optionally be created with |
|
94 |
miniscrollers which take up less screen space. |
|
130 | 95 |
|
96 |
TODO: |
|
584 | 97 |
this is pretty old and needs a rewrite. There are quite some |
98 |
historic leftovers found here and things can be done better |
|
99 |
(especially in initializeFor...) |
|
100 |
||
101 |
Also, it should be rewritten into one class which supports both |
|
102 |
Vertical-only, Horizontal-only and HV scrolling. |
|
103 |
Currently, horizontal-only scrolling is not available. |
|
104 |
(you have to write your own class ...) |
|
130 | 105 |
|
584 | 106 |
Finally, some means to hide scrollbars should be added - this would |
107 |
give more screenspace to the view when all is visible |
|
108 |
(and therefore, the scrollbars are not needed, anyway) |
|
109 |
||
110 |
Expect the above things to be fixed in an upcoming version. |
|
130 | 111 |
|
1459 | 112 |
Recent changes: |
113 |
Originally, there where two classes, for vertical-only and |
|
114 |
horizontal+vertical scrollability. |
|
115 |
These have now been merged into the common ScrollableView class, |
|
116 |
and each scrollability can be controlled individually. |
|
117 |
The original HVScrollableView class is almost empty, but remains |
|
118 |
for backward compatibility (it simply initializes the scrollability |
|
119 |
flags for H+V scrollability). |
|
120 |
||
584 | 121 |
[author:] |
122 |
Claus Gittinger |
|
130 | 123 |
|
584 | 124 |
[see also:] |
125 |
ScrollBar Scroller |
|
126 |
HVScrollableView |
|
63 | 127 |
" |
128 |
! |
|
38 | 129 |
|
63 | 130 |
examples |
131 |
" |
|
1138 | 132 |
simple scrolled text: |
591 | 133 |
[exBegin] |
134 |
|top scr txt| |
|
0 | 135 |
|
591 | 136 |
top := StandardSystemView label:'scroll example1'. |
137 |
top extent:200@100. |
|
113 | 138 |
|
1138 | 139 |
scr := ScrollableView for:EditTextView in:top. |
591 | 140 |
scr origin:0.0@0.0 corner:1.0@1.0. |
141 |
txt := scr scrolledView. |
|
38 | 142 |
|
591 | 143 |
txt list:#('line1' |
144 |
'line2' |
|
145 |
'line3' |
|
146 |
'line4' |
|
147 |
'line5' |
|
148 |
'line7' |
|
149 |
'line8' |
|
150 |
'line9' |
|
151 |
'line10' |
|
152 |
). |
|
153 |
top open |
|
154 |
[exEnd] |
|
38 | 155 |
|
65 | 156 |
|
1138 | 157 |
changing the scrolledView later: |
591 | 158 |
[exBegin] |
159 |
|top scr txtView1 txtView2 browserView| |
|
38 | 160 |
|
591 | 161 |
top := StandardSystemView label:'scroll example2'. |
162 |
top extent:300@100. |
|
113 | 163 |
|
591 | 164 |
scr := ScrollableView in:top. |
165 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
113 | 166 |
|
591 | 167 |
top open. |
0 | 168 |
|
591 | 169 |
(Delay forSeconds:5) wait. |
38 | 170 |
|
591 | 171 |
txtView1 := EditTextView new. |
172 |
txtView1 list:#( |
|
173 |
'wait 5 seconds to see the other text' |
|
174 |
'line2' |
|
175 |
'line3' |
|
176 |
'line4' |
|
177 |
'line5' |
|
178 |
'line7' |
|
179 |
'line8' |
|
180 |
'line9' |
|
181 |
'line10' |
|
182 |
). |
|
183 |
scr scrolledView:txtView1. |
|
38 | 184 |
|
591 | 185 |
(Delay forSeconds:5) wait. |
38 | 186 |
|
591 | 187 |
txtView2 := EditTextView new. |
188 |
txtView2 list:#('this is the other views text' |
|
189 |
'alternative line2' |
|
190 |
'alternative line3' |
|
191 |
'alternative line4' |
|
192 |
'alternative line5' |
|
193 |
'alternative line6'). |
|
194 |
scr scrolledView:txtView2. |
|
195 |
[exEnd] |
|
113 | 196 |
|
197 |
||
198 |
||
199 |
||
1138 | 200 |
using a miniscroller: |
591 | 201 |
[exBegin] |
202 |
|top scr txt| |
|
113 | 203 |
|
591 | 204 |
top := StandardSystemView label:'scroll example3'. |
205 |
top extent:200@100. |
|
113 | 206 |
|
591 | 207 |
scr := ScrollableView for:EditTextView miniScroller:true in:top. |
208 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
209 |
txt := scr scrolledView. |
|
113 | 210 |
|
591 | 211 |
txt list:#('line1' |
212 |
'line2' |
|
213 |
'line3' |
|
214 |
'line4' |
|
215 |
'line5' |
|
216 |
'line7' |
|
217 |
'line8' |
|
218 |
'line9' |
|
219 |
'line10' |
|
220 |
). |
|
221 |
top open |
|
222 |
[exEnd] |
|
113 | 223 |
|
224 |
||
225 |
||
1138 | 226 |
scrolling in both directions: |
227 |
Notice: HVScrollableView remains existent for backward compatibility; |
|
228 |
scrollability can now be controlled in both directions at any |
|
229 |
time (see examples below). |
|
591 | 230 |
[exBegin] |
231 |
|top scr txt| |
|
113 | 232 |
|
591 | 233 |
top := StandardSystemView label:'scroll example4'. |
234 |
top extent:200@100. |
|
113 | 235 |
|
591 | 236 |
scr := HVScrollableView for:EditTextView in:top. |
237 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
238 |
txt := scr scrolledView. |
|
113 | 239 |
|
591 | 240 |
txt list:#('line1' |
241 |
'line2' |
|
242 |
'line3' |
|
243 |
'line4' |
|
244 |
'line5' |
|
245 |
'line7' |
|
246 |
'line8' |
|
247 |
'line9' |
|
248 |
'line10' |
|
249 |
). |
|
250 |
top open |
|
251 |
[exEnd] |
|
113 | 252 |
|
253 |
||
254 |
||
1138 | 255 |
using a full scroller vertically, miniscroller horizontally: |
256 |
Notice: HVScrollableView remains existent for backward compatibility; |
|
257 |
scrollability can now be controlled in both directions at any |
|
258 |
time (see examples below). |
|
591 | 259 |
[exBegin] |
260 |
|top scr txt| |
|
113 | 261 |
|
591 | 262 |
top := StandardSystemView label:'scroll example5'. |
263 |
top extent:200@100. |
|
113 | 264 |
|
591 | 265 |
scr := HVScrollableView for:EditTextView miniScrollerH:true in:top. |
266 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
267 |
txt := scr scrolledView. |
|
113 | 268 |
|
591 | 269 |
txt list:#('line1' |
270 |
'line2' |
|
271 |
'line3' |
|
272 |
'line4' |
|
273 |
'line5' |
|
274 |
'line7' |
|
275 |
'line8' |
|
276 |
'line9' |
|
277 |
'line10' |
|
278 |
). |
|
279 |
top open |
|
280 |
[exEnd] |
|
113 | 281 |
|
282 |
||
283 |
||
1138 | 284 |
using miniscrollers for both directions: |
285 |
Notice: HVScrollableView remains existent for backward compatibility; |
|
286 |
scrollability can now be controlled in both directions at any |
|
287 |
time (see examples below). |
|
591 | 288 |
[exBegin] |
289 |
|top scr txt| |
|
113 | 290 |
|
591 | 291 |
top := StandardSystemView label:'scroll example6'. |
292 |
top extent:200@100. |
|
113 | 293 |
|
591 | 294 |
scr := HVScrollableView for:EditTextView miniScroller:true in:top. |
295 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
296 |
txt := scr scrolledView. |
|
113 | 297 |
|
591 | 298 |
txt list:#('line1' |
299 |
'line2' |
|
300 |
'line3' |
|
301 |
'line4' |
|
302 |
'line5' |
|
303 |
'line7' |
|
304 |
'line8' |
|
305 |
'line9' |
|
306 |
'line10' |
|
307 |
). |
|
308 |
top open |
|
309 |
[exEnd] |
|
1138 | 310 |
controlling scrollability: |
311 |
[exBegin] |
|
312 |
|top scr txt| |
|
313 |
||
314 |
top := StandardSystemView label:'scroll example6'. |
|
315 |
top extent:200@100. |
|
316 |
||
317 |
txt := EditTextView new. |
|
318 |
||
319 |
scr := ScrollableView forView:txt in:top. |
|
320 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
321 |
scr horizontalScrollable:true. |
|
322 |
scr verticalScrollable:false. |
|
323 |
||
324 |
txt list:#('line1' |
|
325 |
'line2' |
|
326 |
'line3' |
|
327 |
'line4' |
|
328 |
'line5' |
|
329 |
'line7' |
|
330 |
'line8' |
|
331 |
'line9' |
|
332 |
'line10' |
|
333 |
). |
|
334 |
top open |
|
335 |
[exEnd] |
|
336 |
controlling scrollability and miniScroller: |
|
337 |
[exBegin] |
|
338 |
|top scr txt| |
|
339 |
||
340 |
top := StandardSystemView label:'scroll example6'. |
|
341 |
top extent:200@100. |
|
342 |
||
343 |
txt := EditTextView new. |
|
344 |
||
345 |
scr := ScrollableView forView:txt in:top. |
|
346 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
1139 | 347 |
scr horizontalScrollable:true; horizontalMini:false. |
348 |
scr verticalScrollable:true; verticalMini:true. |
|
1138 | 349 |
|
350 |
txt list:#('line1' |
|
351 |
'line2' |
|
352 |
'line3' |
|
353 |
'line4' |
|
354 |
'line5' |
|
355 |
'line7' |
|
356 |
'line8' |
|
357 |
'line9' |
|
358 |
'line10' |
|
359 |
). |
|
360 |
top open |
|
361 |
[exEnd] |
|
1459 | 362 |
autohiding scrollbars (edit the text to make scrollbars visible/invisible) |
363 |
(NOTICE: |
|
364 |
this is controlled by the styleSheet and |
|
365 |
should normally NOT be done by the program): |
|
366 |
[exBegin] |
|
367 |
|top scr txt| |
|
368 |
||
369 |
top := StandardSystemView label:'scroll example6'. |
|
370 |
top extent:200@100. |
|
371 |
||
372 |
txt := EditTextView new. |
|
373 |
||
374 |
scr := ScrollableView forView:txt in:top. |
|
375 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
376 |
scr horizontalScrollable:true; horizontalMini:false. |
|
377 |
scr verticalScrollable:true; verticalMini:true. |
|
378 |
scr autoHideScrollBars:true. |
|
379 |
||
380 |
txt list:#('line1' |
|
381 |
'line2' |
|
382 |
'line3' |
|
383 |
'line4' |
|
384 |
'line5' |
|
385 |
'line7' |
|
386 |
'line8' |
|
387 |
'line9' |
|
388 |
'line10' |
|
389 |
). |
|
390 |
top open |
|
391 |
[exEnd] |
|
38 | 392 |
" |
393 |
! ! |
|
0 | 394 |
|
852 | 395 |
!ScrollableView class methodsFor:'instance creation'! |
217 | 396 |
|
397 |
for:aViewClass |
|
398 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
399 |
The subview is created here. |
|
400 |
The view will have full scrollbars." |
|
401 |
||
1111 | 402 |
^ self |
403 |
for:aViewClass |
|
404 |
hasHorizontalScrollBar:(self == HVScrollableView) |
|
405 |
hasVerticalScrollBar:true |
|
406 |
miniScrollerH:false |
|
407 |
miniScrollerV:false |
|
408 |
origin:nil |
|
409 |
corner:nil |
|
410 |
in:nil |
|
411 |
||
412 |
"Created: 6.3.1997 / 18:06:22 / cg" |
|
413 |
"Modified: 6.3.1997 / 23:18:32 / cg" |
|
414 |
! |
|
415 |
||
1183 | 416 |
for:aViewClass hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV |
417 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
418 |
The subview is created here. |
|
419 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
420 |
is false, miniscrollers if true." |
|
421 |
||
422 |
|newView| |
|
423 |
||
424 |
aViewClass notNil ifTrue:[ |
|
425 |
newView := aViewClass new. |
|
426 |
]. |
|
427 |
^ self |
|
428 |
forView:newView |
|
429 |
hasHorizontalScrollBar:hasH |
|
430 |
hasVerticalScrollBar:hasV |
|
431 |
miniScrollerH:miniH |
|
432 |
miniScrollerV:miniV |
|
433 |
origin:nil |
|
434 |
corner:nil |
|
435 |
in:nil |
|
436 |
||
437 |
"Created: 7.4.1997 / 19:00:14 / cg" |
|
438 |
! |
|
439 |
||
1111 | 440 |
for:aViewClass hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn in:aView |
441 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
442 |
The subview is created here. |
|
443 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
444 |
is false, miniscrollers if true." |
|
445 |
||
446 |
|newView| |
|
447 |
||
448 |
aViewClass notNil ifTrue:[ |
|
449 |
newView := aViewClass new. |
|
450 |
]. |
|
451 |
^ self |
|
452 |
forView:newView |
|
453 |
hasHorizontalScrollBar:hasH |
|
454 |
hasVerticalScrollBar:hasV |
|
455 |
miniScrollerH:miniH |
|
456 |
miniScrollerV:miniV |
|
457 |
origin:org |
|
458 |
corner:corn |
|
459 |
in:aView |
|
460 |
||
461 |
" |
|
462 |
|top scr| |
|
463 |
||
464 |
top := StandardSystemView extent:200@200. |
|
465 |
scr := NewScrollableView for:nil |
|
466 |
hasHorizontalScrollBar:true |
|
467 |
hasVerticalScrollBar:true |
|
468 |
miniScrollerH:false |
|
469 |
miniScrollerV:false |
|
470 |
origin:0.0@0.0 |
|
471 |
corner:1.0@1.0 |
|
472 |
in:top. |
|
473 |
top open |
|
474 |
" |
|
475 |
||
476 |
"Modified: 6.3.1997 / 18:36:01 / cg" |
|
217 | 477 |
! |
478 |
||
479 |
for:aViewClass in:aView |
|
480 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
481 |
The subview is created here. |
|
482 |
The view will have full scrollbars." |
|
483 |
||
1111 | 484 |
^ self |
485 |
for:aViewClass |
|
486 |
hasHorizontalScrollBar:(self == HVScrollableView) |
|
487 |
hasVerticalScrollBar:true |
|
488 |
miniScrollerH:false |
|
489 |
miniScrollerV:false |
|
490 |
origin:nil |
|
491 |
corner:nil |
|
492 |
in:aView |
|
493 |
||
494 |
"Modified: 6.3.1997 / 23:18:41 / cg" |
|
217 | 495 |
! |
496 |
||
497 |
for:aViewClass miniScroller:mini |
|
498 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
499 |
The subview is created here. |
|
500 |
The view will have full scrollbars if mini is false, miniscrollers |
|
501 |
if true." |
|
502 |
||
1111 | 503 |
^ self |
504 |
for:aViewClass |
|
505 |
hasHorizontalScrollBar:(self == HVScrollableView) |
|
506 |
hasVerticalScrollBar:true |
|
507 |
miniScrollerH:mini |
|
508 |
miniScrollerV:mini |
|
509 |
origin:nil |
|
510 |
corner:nil |
|
511 |
in:nil |
|
512 |
||
513 |
"Modified: 6.3.1997 / 23:18:45 / cg" |
|
217 | 514 |
! |
515 |
||
516 |
for:aViewClass miniScroller:mini in:aView |
|
517 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
518 |
The subview is created here. |
|
519 |
The view will have full scrollbars if mini is false, miniscrollers |
|
520 |
if true." |
|
521 |
||
1111 | 522 |
^ self |
523 |
for:aViewClass |
|
524 |
hasHorizontalScrollBar:(self == HVScrollableView) |
|
525 |
hasVerticalScrollBar:true |
|
526 |
miniScrollerH:mini |
|
527 |
miniScrollerV:mini |
|
528 |
origin:nil |
|
529 |
corner:nil |
|
530 |
in:aView |
|
531 |
||
532 |
"Modified: 6.3.1997 / 23:18:50 / cg" |
|
217 | 533 |
! |
153 | 534 |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
535 |
for:aViewClass miniScroller:mini origin:org corner:corn in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
536 |
"return a new scrolling view scrolling an instance of aViewClass. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
537 |
The subview is created here. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
538 |
The view will have full scrollbars if mini is false, miniscrollers |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
539 |
if true." |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
540 |
|
1111 | 541 |
^ self |
542 |
for:aViewClass |
|
543 |
hasHorizontalScrollBar:(self == HVScrollableView) |
|
544 |
hasVerticalScrollBar:true |
|
545 |
miniScrollerH:mini |
|
546 |
miniScrollerV:mini |
|
547 |
origin:org |
|
548 |
corner:corn |
|
549 |
in:aView |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
550 |
|
1111 | 551 |
"Modified: 6.3.1997 / 23:18:53 / cg" |
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
552 |
! |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
553 |
|
217 | 554 |
for:aViewClass miniScrollerH:miniH |
555 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
556 |
The subview is created here. |
|
557 |
The view will have full scrollbars if miniH is false, |
|
558 |
and a horizontal miniscroller if true." |
|
559 |
||
1111 | 560 |
^ self |
561 |
for:aViewClass |
|
562 |
hasHorizontalScrollBar:true |
|
563 |
hasVerticalScrollBar:true |
|
564 |
miniScrollerH:miniH |
|
565 |
miniScrollerV:false |
|
566 |
origin:nil |
|
567 |
corner:nil |
|
568 |
in:nil |
|
569 |
||
570 |
"Modified: 6.3.1997 / 18:30:15 / cg" |
|
217 | 571 |
! |
572 |
||
573 |
for:aViewClass miniScrollerH:miniH in:aView |
|
574 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
575 |
The subview is created here. |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
576 |
The view will have full scrollbars if the corresponding miniH/miniV |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
577 |
is false, miniscrollers if true." |
217 | 578 |
|
1111 | 579 |
^ self |
580 |
for:aViewClass |
|
581 |
hasHorizontalScrollBar:true |
|
582 |
hasVerticalScrollBar:true |
|
583 |
miniScrollerH:miniH |
|
584 |
miniScrollerV:false |
|
585 |
origin:nil |
|
586 |
corner:nil |
|
587 |
in:aView |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
588 |
|
1111 | 589 |
"Modified: 6.3.1997 / 18:30:31 / cg" |
217 | 590 |
! |
153 | 591 |
|
217 | 592 |
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV |
593 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
594 |
The subview is created here. |
|
595 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
596 |
is false, miniscrollers if true." |
|
597 |
||
1111 | 598 |
^ self |
599 |
for:aViewClass |
|
600 |
hasHorizontalScrollBar:true |
|
601 |
hasVerticalScrollBar:true |
|
602 |
miniScrollerH:miniH |
|
603 |
miniScrollerV:miniV |
|
604 |
origin:nil |
|
605 |
corner:nil |
|
606 |
in:nil |
|
607 |
||
608 |
"Modified: 6.3.1997 / 18:30:47 / cg" |
|
217 | 609 |
! |
610 |
||
611 |
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV in:aView |
|
612 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
613 |
The subview is created here. |
|
614 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
615 |
is false, miniscrollers if true." |
|
616 |
||
1111 | 617 |
^ self |
618 |
for:aViewClass |
|
619 |
hasHorizontalScrollBar:true |
|
620 |
hasVerticalScrollBar:true |
|
621 |
miniScrollerH:miniH |
|
622 |
miniScrollerV:miniV |
|
623 |
origin:nil |
|
624 |
corner:nil |
|
625 |
in:aView |
|
626 |
||
627 |
"Modified: 6.3.1997 / 18:31:02 / cg" |
|
628 |
! |
|
629 |
||
630 |
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn in:aView |
|
631 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
632 |
The subview is created here. |
|
633 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
634 |
is false, miniscrollers if true." |
|
635 |
||
636 |
^ self |
|
637 |
for:aViewClass |
|
638 |
hasHorizontalScrollBar:true |
|
639 |
hasVerticalScrollBar:true |
|
640 |
miniScrollerH:miniH |
|
641 |
miniScrollerV:miniV |
|
642 |
origin:org |
|
643 |
corner:corn |
|
644 |
in:aView |
|
645 |
||
646 |
"Modified: 6.3.1997 / 18:31:17 / cg" |
|
647 |
! |
|
648 |
||
649 |
for:aViewClass miniScrollerH:miniH origin:org corner:corn in:aView |
|
650 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
651 |
The subview is created here. |
|
652 |
The view will have a full horizontal scrollbar if miniH is false, |
|
653 |
a miniscroller if true." |
|
654 |
||
655 |
^ self |
|
656 |
for:aViewClass |
|
657 |
hasHorizontalScrollBar:true |
|
658 |
hasVerticalScrollBar:true |
|
659 |
miniScrollerH:miniH |
|
660 |
miniScrollerV:false |
|
661 |
origin:org |
|
662 |
corner:corn |
|
663 |
in:aView |
|
664 |
||
665 |
"Modified: 6.3.1997 / 18:31:28 / cg" |
|
666 |
! |
|
667 |
||
668 |
for:aViewClass miniScrollerV:miniV origin:org corner:corn in:aView |
|
669 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
670 |
The subview is created here. |
|
671 |
The view will have a full vertical scrollbar if miniV is false, |
|
672 |
a miniscroller if true." |
|
673 |
||
674 |
^ self |
|
675 |
for:aViewClass |
|
676 |
hasHorizontalScrollBar:true |
|
677 |
hasVerticalScrollBar:true |
|
678 |
miniScrollerH:false |
|
679 |
miniScrollerV:miniV |
|
680 |
origin:org |
|
681 |
corner:corn |
|
682 |
in:aView |
|
683 |
||
684 |
"Modified: 6.3.1997 / 18:31:41 / cg" |
|
685 |
! |
|
686 |
||
687 |
for:aViewClass origin:org corner:corner in:aView |
|
688 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
689 |
The subview is created here. |
|
690 |
The view will have full scrollbars." |
|
691 |
||
692 |
^ self |
|
693 |
for:aViewClass |
|
694 |
hasHorizontalScrollBar:(self == HVScrollableView) |
|
695 |
hasVerticalScrollBar:true |
|
696 |
miniScrollerH:false |
|
697 |
miniScrollerV:false |
|
698 |
origin:org |
|
699 |
corner:corner |
|
700 |
in:aView |
|
701 |
||
702 |
"Modified: 6.3.1997 / 23:19:05 / cg" |
|
703 |
! |
|
704 |
||
705 |
forView:aView |
|
706 |
"return a new scrolling view scrolling aView. |
|
707 |
The view will have full scrollbars." |
|
708 |
||
709 |
^ self |
|
710 |
forView:aView |
|
711 |
hasHorizontalScrollBar:(self == HVScrollableView) |
|
712 |
hasVerticalScrollBar:true |
|
713 |
miniScrollerH:false |
|
714 |
miniScrollerV:false |
|
715 |
origin:nil |
|
716 |
corner:nil |
|
717 |
in:nil |
|
718 |
||
719 |
"Modified: 6.3.1997 / 23:19:08 / cg" |
|
720 |
! |
|
721 |
||
722 |
forView:aScrolledView hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn in:aView |
|
723 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
724 |
The subview is created here. |
|
725 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
726 |
is false, miniscrollers if true." |
|
727 |
||
300 | 728 |
|newView dev| |
217 | 729 |
|
730 |
aView notNil ifTrue:[ |
|
703 | 731 |
dev := aView graphicsDevice |
300 | 732 |
] ifFalse:[ |
703 | 733 |
dev := Screen current |
300 | 734 |
]. |
735 |
newView := self basicNew device:dev. |
|
1111 | 736 |
newView initialize. |
737 |
newView setupVertical:hasV mini:miniV horizontal:hasH mini:miniH. |
|
738 |
||
739 |
aScrolledView notNil ifTrue:[ |
|
740 |
newView scrolledView:aScrolledView. |
|
741 |
]. |
|
742 |
||
743 |
org notNil ifTrue:[ |
|
744 |
newView origin:org |
|
745 |
]. |
|
746 |
corn notNil ifTrue:[ |
|
747 |
newView corner:corn |
|
748 |
]. |
|
749 |
||
300 | 750 |
aView notNil ifTrue:[ |
703 | 751 |
aView addSubView:newView |
153 | 752 |
]. |
217 | 753 |
^ newView |
703 | 754 |
|
1111 | 755 |
" |
756 |
|top scr| |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
757 |
|
1111 | 758 |
top := StandardSystemView extent:200@200. |
759 |
scr := NewScrollableView |
|
760 |
forView:(TextView new) |
|
761 |
hasHorizontalScrollBar:true |
|
762 |
hasVerticalScrollBar:true |
|
763 |
miniScrollerH:false |
|
764 |
miniScrollerV:false |
|
765 |
origin:0.0@0.0 |
|
766 |
corner:1.0@1.0 |
|
767 |
in:top. |
|
768 |
top open |
|
769 |
" |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
770 |
|
1135
acdeed6efc13
Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents:
1134
diff
changeset
|
771 |
"Modified: 6.3.1997 / 18:42:40 / cg" |
acdeed6efc13
Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents:
1134
diff
changeset
|
772 |
"Modified: 19.3.1997 / 15:32:51 / stefan" |
217 | 773 |
! |
774 |
||
852 | 775 |
forView:aView in:aSuperView |
776 |
"return a new scrolling view scrolling aView. |
|
777 |
The view will have full scrollbars." |
|
778 |
||
1111 | 779 |
^ self |
780 |
forView:aView |
|
781 |
hasHorizontalScrollBar:(self == HVScrollableView) |
|
782 |
hasVerticalScrollBar:true |
|
783 |
miniScrollerH:false |
|
784 |
miniScrollerV:false |
|
785 |
origin:nil |
|
786 |
corner:nil |
|
787 |
in:aSuperView |
|
852 | 788 |
|
1111 | 789 |
"Modified: 6.3.1997 / 23:19:12 / cg" |
852 | 790 |
! |
791 |
||
248 | 792 |
forView:aView miniScrollerH:mini |
793 |
"return a new scrolling view scrolling aView. |
|
794 |
The view will have a full vertical scrollbar and a horizontal |
|
795 |
miniScroller if mini is true." |
|
796 |
||
1111 | 797 |
^ self |
798 |
forView:aView |
|
799 |
hasHorizontalScrollBar:true |
|
800 |
hasVerticalScrollBar:true |
|
801 |
miniScrollerH:mini |
|
802 |
miniScrollerV:false |
|
803 |
origin:nil |
|
804 |
corner:nil |
|
805 |
in:nil |
|
248 | 806 |
|
1111 | 807 |
"Modified: 6.3.1997 / 18:32:58 / cg" |
248 | 808 |
! |
809 |
||
217 | 810 |
forView:scrolledView miniScrollerH:miniH miniScrollerV:miniV in:aView |
811 |
"return a new scrolling view, scrolling aView. |
|
812 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
813 |
is false, miniscrollers if true." |
|
153 | 814 |
|
1111 | 815 |
^ self |
816 |
forView:scrolledView |
|
817 |
hasHorizontalScrollBar:true |
|
818 |
hasVerticalScrollBar:true |
|
819 |
miniScrollerH:miniH |
|
820 |
miniScrollerV:miniV |
|
821 |
origin:nil |
|
822 |
corner:nil |
|
823 |
in:aView |
|
217 | 824 |
|
1111 | 825 |
"Modified: 6.3.1997 / 18:33:20 / cg" |
217 | 826 |
! |
153 | 827 |
|
217 | 828 |
in:aView |
829 |
"return a new scrolling view to be contained in aView. |
|
830 |
There is no slave view now - this has to be set later via |
|
831 |
the scrolledView: method. |
|
832 |
The view will have full scrollbars." |
|
833 |
||
1111 | 834 |
^ self |
835 |
forView:nil |
|
836 |
hasHorizontalScrollBar:(self == HVScrollableView) |
|
837 |
hasVerticalScrollBar:true |
|
838 |
miniScrollerH:false |
|
839 |
miniScrollerV:false |
|
840 |
origin:nil |
|
841 |
corner:nil |
|
842 |
in:aView |
|
843 |
||
844 |
"Modified: 6.3.1997 / 23:19:19 / cg" |
|
217 | 845 |
! |
0 | 846 |
|
93 | 847 |
miniScroller:mini |
848 |
"return a new scrolling view. The subview will be created later. |
|
849 |
The view will have full scrollbars if mini is false, |
|
850 |
miniscrollers if true." |
|
851 |
||
1111 | 852 |
^ self |
853 |
forView:nil |
|
854 |
hasHorizontalScrollBar:(self == HVScrollableView) |
|
855 |
hasVerticalScrollBar:true |
|
856 |
miniScrollerH:mini |
|
857 |
miniScrollerV:mini |
|
858 |
origin:nil |
|
859 |
corner:nil |
|
860 |
in:nil |
|
861 |
||
862 |
"Modified: 6.3.1997 / 23:19:21 / cg" |
|
93 | 863 |
! |
864 |
||
113 | 865 |
miniScrollerH:miniH |
866 |
"return a new scrolling view. The subview will be created later. |
|
867 |
The view will have full scrollbars if miniH is false, |
|
868 |
and a horizontal miniscroller if true." |
|
869 |
||
1111 | 870 |
^ self |
871 |
forView:nil |
|
872 |
hasHorizontalScrollBar:true |
|
873 |
hasVerticalScrollBar:true |
|
874 |
miniScrollerH:miniH |
|
875 |
miniScrollerV:false |
|
876 |
origin:nil |
|
877 |
corner:nil |
|
878 |
in:nil |
|
879 |
||
880 |
"Modified: 6.3.1997 / 18:34:06 / cg" |
|
113 | 881 |
! |
882 |
||
93 | 883 |
miniScrollerH:miniH miniScrollerV:miniV |
884 |
"return a new scrolling view. The subview will be created later. |
|
885 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
113 | 886 |
is false, miniscrollers if true." |
93 | 887 |
|
1111 | 888 |
^ self |
889 |
forView:nil |
|
890 |
hasHorizontalScrollBar:true |
|
891 |
hasVerticalScrollBar:true |
|
892 |
miniScrollerH:miniH |
|
893 |
miniScrollerV:miniV |
|
894 |
origin:nil |
|
895 |
corner:nil |
|
896 |
in:nil |
|
897 |
||
898 |
"Modified: 6.3.1997 / 18:34:16 / cg" |
|
217 | 899 |
! ! |
93 | 900 |
|
852 | 901 |
!ScrollableView class methodsFor:'defaults'! |
217 | 902 |
|
1378 | 903 |
defaultScrollBarPosition |
904 |
"return the default position of the scrollBar. |
|
905 |
(max be of interest to panels, to make the handlePosition alike)" |
|
906 |
||
907 |
<resource: #style (#'scrollBar.position')> |
|
908 |
||
909 |
^ StyleSheet at:'scrollBar.position' default:#left. |
|
910 |
||
911 |
" |
|
912 |
self defaultScrollBarPosition |
|
913 |
" |
|
914 |
||
915 |
"Modified: / 31.10.1997 / 12:58:15 / cg" |
|
916 |
! |
|
917 |
||
217 | 918 |
updateStyleCache |
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
919 |
"extract values from the styleSheet and cache them in class variables" |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
920 |
|
1354 | 921 |
<resource: #style (#'scrolledView.level' #'scrolledView.margin' |
922 |
#'scrolledView.borderWidth' |
|
1378 | 923 |
#'scrollBar.spacing' #'scrollBar.level' |
924 |
#'scrollableView.level' #'scrollableView.backgroundColor' )> |
|
1111 | 925 |
|
926 |
|defLevel defMargin defSpacing| |
|
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
927 |
|
1111 | 928 |
StyleSheet is3D ifTrue:[ |
929 |
defLevel := -1. |
|
930 |
defMargin := ViewSpacing // 2. |
|
931 |
defSpacing := defMargin. |
|
217 | 932 |
] ifFalse:[ |
1111 | 933 |
defLevel := 0. |
934 |
defMargin := 0. |
|
935 |
defSpacing := 0 |
|
217 | 936 |
]. |
1354 | 937 |
DefaultScrolledViewLevel := StyleSheet at:'scrolledView.level' default:defLevel. |
938 |
DefaultScrolledViewBorderWidth := StyleSheet at:'scrolledView.borderWidth' default:nil. |
|
939 |
DefaultScrolledViewMargin := StyleSheet at:'scrolledView.margin' default:defMargin. |
|
1378 | 940 |
DefaultScrollBarSpacing := StyleSheet at:'scrollBar.spacing' default:defSpacing. |
941 |
DefaultLevel := StyleSheet at:'scrollableView.level' default:nil. |
|
942 |
DefaultScrollBarLevel := StyleSheet at:'scrollBar.level' default:nil. |
|
943 |
MyDefaultViewBackgroundColor := StyleSheet at:'scrollableView.backgroundColor' default:DefaultViewBackgroundColor. |
|
0 | 944 |
|
1111 | 945 |
" |
946 |
self updateStyleCache |
|
947 |
" |
|
948 |
||
1378 | 949 |
"Modified: / 31.10.1997 / 20:57:10 / cg" |
217 | 950 |
! ! |
951 |
||
1140 | 952 |
!ScrollableView methodsFor:'accessing-behavior'! |
953 |
||
954 |
autoHideScrollBars:aBoolean |
|
955 |
"set/clear the flag which controls if scrollBars should |
|
956 |
be made invisible dynamically, if there is nothing to scroll |
|
957 |
(and shown if there is). |
|
958 |
This flags setting is normally controlled by the styleSheet." |
|
959 |
||
960 |
hideScrollBars := aBoolean. |
|
961 |
||
962 |
"Modified: 19.3.1997 / 16:28:42 / cg" |
|
963 |
"Created: 19.3.1997 / 17:24:39 / cg" |
|
964 |
! ! |
|
965 |
||
1138 | 966 |
!ScrollableView methodsFor:'accessing-components'! |
119 | 967 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
968 |
horizontalScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
969 |
"return the horizontal scrollbar (or nil, if there is none)" |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
970 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
971 |
^ hScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
972 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
973 |
"Modified: 6.3.1997 / 16:59:24 / cg" |
1111 | 974 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
975 |
! |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
976 |
|
217 | 977 |
scrollBar |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
978 |
"return the vertical scrollbar (or nil, if there is none)" |
217 | 979 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
980 |
^ vScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
981 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
982 |
"Modified: 6.3.1997 / 16:59:29 / cg" |
1111 | 983 |
"Created: 6.3.1997 / 18:06:23 / cg" |
119 | 984 |
! |
985 |
||
217 | 986 |
scrolledView |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
987 |
"return the scrolled view (or nil, if there is none)" |
38 | 988 |
|
217 | 989 |
^ scrolledView |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
990 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
991 |
"Modified: 6.3.1997 / 16:48:09 / cg" |
1111 | 992 |
"Created: 6.3.1997 / 18:06:23 / cg" |
113 | 993 |
! |
994 |
||
217 | 995 |
scrolledView:aView |
996 |
"set the view to scroll" |
|
997 |
||
998 |
scrolledView notNil ifTrue:[ |
|
982 | 999 |
scrolledView removeDependent:self. |
814 | 1000 |
scrolledView destroy. |
1001 |
scrolledView := nil. |
|
217 | 1002 |
]. |
982 | 1003 |
|
217 | 1004 |
scrolledView := aView. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1005 |
|
1111 | 1006 |
super addSubViewFirst:aView. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1007 |
scrolledView notNil ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1008 |
self setScrollActions. |
217 | 1009 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1010 |
realized ifTrue:[ |
1134
f4f1e67f1ff2
setupDimension late in realize
Claus Gittinger <cg@exept.de>
parents:
1126
diff
changeset
|
1011 |
self setupDimensions. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1012 |
self sizeChanged:nil. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1013 |
scrolledView realize |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1014 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1015 |
] |
217 | 1016 |
|
1135
acdeed6efc13
Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents:
1134
diff
changeset
|
1017 |
"Modified: 7.3.1997 / 22:24:43 / cg" |
acdeed6efc13
Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents:
1134
diff
changeset
|
1018 |
"Modified: 19.3.1997 / 15:32:37 / stefan" |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1019 |
! |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1020 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1021 |
verticalScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1022 |
"return the vertical scrollbar (or nil, if there is none)" |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1023 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1024 |
^ vScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1025 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1026 |
"Modified: 6.3.1997 / 16:59:24 / cg" |
1111 | 1027 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1253 | 1028 |
! |
1029 |
||
1030 |
widget |
|
1031 |
"for ST80 compatibility (where a wrapper returns its wrapped |
|
1032 |
widget), return the scrolledView here" |
|
1033 |
||
1034 |
^ scrolledView |
|
1035 |
||
1036 |
"Created: 20.6.1997 / 14:45:16 / cg" |
|
217 | 1037 |
! ! |
1038 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1039 |
!ScrollableView methodsFor:'accessing-look'! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1040 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1041 |
horizontalMini:aBoolean |
1138 | 1042 |
"control the horizontal scrollBar to be either a miniScroller, |
1043 |
or a full scrollBar." |
|
1044 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1045 |
horizontalMini ~~ aBoolean ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1046 |
horizontalMini := aBoolean. |
1184
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1047 |
self setupViews. |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1048 |
shown ifTrue:[ |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1049 |
self setupDimensions. |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1050 |
] |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1051 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1052 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1053 |
"Created: 7.3.1997 / 21:57:02 / cg" |
1184
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1054 |
"Modified: 8.4.1997 / 00:45:03 / cg" |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1055 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1056 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1057 |
horizontalScrollable:aBoolean |
1138 | 1058 |
"enable/disable horizontal scrollability. |
1059 |
If disabled, the horizontal scrollBar is made invisible." |
|
1060 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1061 |
hasHorizontalScrollBar ~~ aBoolean ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1062 |
hasHorizontalScrollBar := aBoolean. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1063 |
hScrollBarHidden := false. |
1184
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1064 |
self setupViews. |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1065 |
shown ifTrue:[ |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1066 |
self setupDimensions. |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1067 |
] |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1068 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1069 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1070 |
"Created: 7.3.1997 / 21:56:28 / cg" |
1184
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1071 |
"Modified: 8.4.1997 / 00:45:00 / cg" |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1072 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1073 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1074 |
verticalMini:aBoolean |
1138 | 1075 |
"control the vertical scrollBar to be either a miniScroller, |
1076 |
or a full scrollBar." |
|
1077 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1078 |
verticalMini ~~ aBoolean ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1079 |
verticalMini := aBoolean. |
1184
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1080 |
self setupViews. |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1081 |
shown ifTrue:[ |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1082 |
self setupDimensions. |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1083 |
] |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1084 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1085 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1086 |
"Created: 7.3.1997 / 21:56:57 / cg" |
1184
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1087 |
"Modified: 8.4.1997 / 00:44:57 / cg" |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1088 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1089 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1090 |
verticalScrollable:aBoolean |
1138 | 1091 |
"enable/disable vertical scrollability. |
1092 |
If disabled, the vertical scrollBar is made invisible." |
|
1093 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1094 |
hasVerticalScrollBar ~~ aBoolean ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1095 |
hasVerticalScrollBar := aBoolean. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1096 |
vScrollBarHidden := false. |
1184
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1097 |
self setupViews. |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1098 |
shown ifTrue:[ |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1099 |
self setupDimensions. |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1100 |
] |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1101 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1102 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1103 |
"Created: 7.3.1997 / 21:56:39 / cg" |
1184
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1104 |
"Modified: 8.4.1997 / 00:44:53 / cg" |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1105 |
! ! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1106 |
|
217 | 1107 |
!ScrollableView methodsFor:'changes '! |
1108 |
||
1109 |
update:something with:argument from:changedObject |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1110 |
"whenever the scrolledView changes its contents, the scroller(s) must |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1111 |
be updated as well" |
132 | 1112 |
|
217 | 1113 |
changedObject == scrolledView ifTrue:[ |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1114 |
something == #sizeOfContents ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1115 |
vScrollBar notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1116 |
vScrollBar setThumbFor:scrolledView. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1117 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1118 |
hScrollBar notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1119 |
hScrollBar setThumbFor:scrolledView. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1120 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1121 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1122 |
something == #originOfContents ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1123 |
lockUpdates ifFalse:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1124 |
vScrollBar notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1125 |
vScrollBar setThumbOriginFor:scrolledView. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1126 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1127 |
hScrollBar notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1128 |
hScrollBar setThumbOriginFor:scrolledView. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1129 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1130 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1131 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1132 |
|
1231 | 1133 |
self updateScrollBarVisibility |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1134 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1135 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1136 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1137 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1138 |
updateScrollBarVisibility |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1139 |
"check if any scrollbar needs to be hidden or shown" |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1140 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1141 |
|anyChange| |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1142 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1143 |
hideScrollBars ifFalse:[^ self]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1144 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1145 |
anyChange := false. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1146 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1147 |
vScrollBar notNil ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1148 |
vScrollBar thumbHeight >= 100 ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1149 |
vScrollBarHidden ifFalse:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1150 |
vScrollBarHidden := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1151 |
vScrollBar beInvisible. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1152 |
anyChange := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1153 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1154 |
] ifFalse:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1155 |
vScrollBarHidden ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1156 |
vScrollBarHidden := false. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1157 |
vScrollBar beVisible. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1158 |
anyChange := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1159 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1160 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1161 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1162 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1163 |
hScrollBar notNil ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1164 |
hScrollBar thumbHeight >= 100 ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1165 |
hScrollBarHidden ifFalse:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1166 |
hScrollBarHidden := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1167 |
hScrollBar beInvisible. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1168 |
anyChange := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1169 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1170 |
] ifFalse:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1171 |
hScrollBarHidden ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1172 |
hScrollBarHidden := false. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1173 |
hScrollBar beVisible. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1174 |
anyChange := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1175 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1176 |
] |
217 | 1177 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1178 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1179 |
anyChange ifTrue:[ |
1161
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1180 |
self setupDimensions. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1181 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1182 |
"/ force him to recompute its dimension ... |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1183 |
scrolledView notNil ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1184 |
vScrollBar notNil ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1185 |
vScrollBar setThumbFor:scrolledView. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1186 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1187 |
hScrollBar notNil ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1188 |
hScrollBar setThumbFor:scrolledView. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1189 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1190 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1191 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1192 |
"/ stupid - showing one may need the other ... |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1193 |
"/ and vice versa; do it again. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1194 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1195 |
anyChange := false. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1196 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1197 |
vScrollBar notNil ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1198 |
vScrollBar thumbHeight >= 100 ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1199 |
vScrollBarHidden ifFalse:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1200 |
vScrollBarHidden := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1201 |
vScrollBar beInvisible. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1202 |
anyChange := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1203 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1204 |
] ifFalse:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1205 |
vScrollBarHidden ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1206 |
vScrollBarHidden := false. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1207 |
vScrollBar beVisible. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1208 |
anyChange := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1209 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1210 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1211 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1212 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1213 |
hScrollBar notNil ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1214 |
hScrollBar thumbHeight >= 100 ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1215 |
hScrollBarHidden ifFalse:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1216 |
hScrollBarHidden := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1217 |
hScrollBar beInvisible. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1218 |
anyChange := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1219 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1220 |
] ifFalse:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1221 |
hScrollBarHidden ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1222 |
hScrollBarHidden := false. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1223 |
hScrollBar beVisible. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1224 |
anyChange := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1225 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1226 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1227 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1228 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1229 |
anyChange ifTrue:[ |
1161
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1230 |
self setupDimensions. |
1135
acdeed6efc13
Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents:
1134
diff
changeset
|
1231 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1232 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1233 |
|
1135
acdeed6efc13
Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents:
1134
diff
changeset
|
1234 |
"Modified: 19.3.1997 / 15:33:36 / stefan" |
1161
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1235 |
"Modified: 28.3.1997 / 17:32:09 / cg" |
217 | 1236 |
! ! |
38 | 1237 |
|
217 | 1238 |
!ScrollableView methodsFor:'event processing'! |
1239 |
||
1240 |
keyPress:key x:x y:y |
|
1241 |
"a key was pressed - handle page-keys here" |
|
1242 |
||
1243 |
<resource: #keyboard ( #Prior #Next ) > |
|
1244 |
||
1245 |
(key == #Prior) ifTrue: [^ self pageUp]. |
|
1246 |
(key == #Next) ifTrue: [^ self pageDown]. |
|
1247 |
||
1248 |
super keyPress:key x:x y:y |
|
1111 | 1249 |
|
1250 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
38 | 1251 |
! |
1252 |
||
217 | 1253 |
sizeChanged:how |
1138 | 1254 |
"handle size changes - this may change any scrollBars visibility" |
1255 |
||
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1256 |
|orgX orgY scroll| |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1257 |
|
1111 | 1258 |
"/ resize components manually, in an order which is optimal |
1259 |
||
1260 |
how == #smaller ifTrue:[ |
|
1261 |
"/ first resize the horizontalScrollBar, |
|
1262 |
||
1263 |
scrolledView notNil ifTrue:[ |
|
1264 |
scrolledView containerChangedSize |
|
1265 |
]. |
|
1266 |
hScrollBar notNil ifTrue:[ |
|
1267 |
hScrollBar containerChangedSize |
|
1268 |
]. |
|
1269 |
vScrollBar notNil ifTrue:[ |
|
1270 |
vScrollBar containerChangedSize |
|
1271 |
]. |
|
1272 |
] ifFalse:[ |
|
1273 |
hScrollBar notNil ifTrue:[ |
|
1274 |
hScrollBar containerChangedSize |
|
1275 |
]. |
|
1276 |
vScrollBar notNil ifTrue:[ |
|
1277 |
vScrollBar containerChangedSize |
|
1278 |
]. |
|
1279 |
scrolledView notNil ifTrue:[ |
|
1280 |
scrolledView containerChangedSize |
|
1281 |
]. |
|
1282 |
]. |
|
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1283 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1284 |
scrolledView isNil ifTrue:[^ self]. |
1111 | 1285 |
(hScrollBar isNil and:[vScrollBar isNil]) ifTrue:[^ self]. |
1286 |
||
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1287 |
vScrollBar notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1288 |
vScrollBar setThumbFor:scrolledView. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1289 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1290 |
hScrollBar notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1291 |
hScrollBar setThumbFor:scrolledView. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1292 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1293 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1294 |
"/ splitted, since there are optimized scrollProcedures for each case ... |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1295 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1296 |
hScrollBar isNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1297 |
"/ only care for vertical ... |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1298 |
vScrollBar thumbOrigin + vScrollBar thumbHeight >= 100 ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1299 |
vScrollBar thumbOrigin:(100 - vScrollBar thumbHeight). |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1300 |
scrolledView scrollVerticalToPercent:vScrollBar thumbOrigin. |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1301 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1302 |
] ifFalse:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1303 |
vScrollBar isNil ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1304 |
"/ only care for horizontal ... |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1305 |
hScrollBar thumbOrigin + hScrollBar thumbHeight >= 100 ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1306 |
hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight). |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1307 |
scrolledView scrollVerticalToPercent:hScrollBar thumbOrigin. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1308 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1309 |
] ifFalse:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1310 |
"/ care for both ... |
113 | 1311 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1312 |
orgY := vScrollBar thumbOrigin. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1313 |
orgX := hScrollBar thumbOrigin. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1314 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1315 |
scroll := false. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1316 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1317 |
orgY + vScrollBar thumbHeight >= 100 ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1318 |
vScrollBar thumbOrigin:(100 - vScrollBar thumbHeight). |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1319 |
orgY := vScrollBar thumbOrigin. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1320 |
scroll := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1321 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1322 |
orgX + hScrollBar thumbHeight >= 100 ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1323 |
hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight). |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1324 |
orgX := hScrollBar thumbOrigin. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1325 |
scroll := true. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1326 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1327 |
scroll ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1328 |
scrolledView scrollToPercent:(orgX@orgY). |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1329 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1330 |
] |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1331 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1332 |
self updateScrollBarVisibility. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1333 |
|
1160
f3204cabcce8
must update scrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1334 |
"Modified: 28.3.1997 / 17:25:38 / cg" |
217 | 1335 |
! ! |
1336 |
||
1337 |
!ScrollableView methodsFor:'forced scroll'! |
|
1338 |
||
1339 |
pageDown |
|
1138 | 1340 |
"page down - but only if there is a vertical scrollbar" |
217 | 1341 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1342 |
vScrollBar notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1343 |
vScrollBar pageDown |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1344 |
] |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1345 |
|
1111 | 1346 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1138 | 1347 |
"Modified: 19.3.1997 / 16:32:34 / cg" |
1348 |
! |
|
1349 |
||
1350 |
pageLeft |
|
1351 |
"page left - but only if there is a horizontal scrollbar" |
|
1352 |
||
1353 |
hScrollBar notNil ifTrue:[ |
|
1354 |
hScrollBar pageDown |
|
1355 |
] |
|
1356 |
||
1357 |
"Created: 19.3.1997 / 16:32:14 / cg" |
|
1358 |
"Modified: 19.3.1997 / 16:32:44 / cg" |
|
1359 |
! |
|
1360 |
||
1361 |
pageRight |
|
1362 |
"page right - but only if there is a horizontal scrollbar" |
|
1363 |
||
1364 |
hScrollBar notNil ifTrue:[ |
|
1365 |
hScrollBar pageUp |
|
1366 |
] |
|
1367 |
||
1368 |
"Created: 19.3.1997 / 16:32:22 / cg" |
|
1369 |
"Modified: 19.3.1997 / 16:32:48 / cg" |
|
113 | 1370 |
! |
1371 |
||
217 | 1372 |
pageUp |
1138 | 1373 |
"page up - but only if there is a vertical scrollbar" |
0 | 1374 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1375 |
vScrollBar notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1376 |
vScrollBar pageUp |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1377 |
] |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1378 |
|
1111 | 1379 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1138 | 1380 |
"Modified: 19.3.1997 / 16:32:38 / cg" |
0 | 1381 |
! ! |
1382 |
||
1383 |
!ScrollableView methodsFor:'initialization'! |
|
1384 |
||
217 | 1385 |
initStyle |
958 | 1386 |
"initialize style specifics" |
1387 |
||
1362 | 1388 |
<resource: #style (#'scrollBar.position' #'scrollBar.hiding')> |
608 | 1389 |
|
217 | 1390 |
super initStyle. |
1391 |
||
1111 | 1392 |
viewBackground := MyDefaultViewBackgroundColor. |
1362 | 1393 |
scrollBarPosition := styleSheet at:'scrollBar.position' default:#left. |
1394 |
hideScrollBars := styleSheet at:'scrollBar.hiding' default:false. |
|
608 | 1395 |
|
1362 | 1396 |
"Created: / 6.3.1997 / 18:06:23 / cg" |
1397 |
"Modified: / 26.10.1997 / 17:07:17 / cg" |
|
0 | 1398 |
! |
1399 |
||
1247 | 1400 |
initialize |
1401 |
"setup some default" |
|
1402 |
||
1403 |
verticalMini := horizontalMini := false. |
|
1404 |
hasVerticalScrollBar := hasHorizontalScrollBar := false. |
|
1405 |
super initialize. |
|
1406 |
! |
|
1407 |
||
0 | 1408 |
realize |
1161
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1409 |
"realize (i.e. make me visible). |
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1410 |
Since scrolledView may have done something to its contents |
0 | 1411 |
during init-time we had no chance yet to catch contents- |
1161
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1412 |
changes; do it now" |
1160
f3204cabcce8
must update scrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1413 |
|
1161
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1414 |
self setupDimensions. |
1176
29d0a646cbdf
must realize before setting scroller values
Claus Gittinger <cg@exept.de>
parents:
1161
diff
changeset
|
1415 |
super realize. |
1201
e7f1cf0180ca
must updateScrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1416 |
|
38 | 1417 |
scrolledView notNil ifTrue:[ |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1418 |
vScrollBar notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1419 |
vScrollBar setThumbFor:scrolledView |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1420 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1421 |
hScrollBar notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1422 |
hScrollBar setThumbFor:scrolledView |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1423 |
]. |
1201
e7f1cf0180ca
must updateScrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1424 |
self updateScrollBarVisibility. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1425 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1426 |
|
1201
e7f1cf0180ca
must updateScrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1427 |
"Modified: 23.4.1997 / 13:59:59 / cg" |
1111 | 1428 |
! |
1429 |
||
1430 |
releaseHorizontalScrollBar |
|
1431 |
"destroy any horizontal scrollBar" |
|
1432 |
||
1433 |
hScrollBar notNil ifTrue:[ |
|
1434 |
hScrollBar destroy. |
|
1435 |
hScrollBar := nil |
|
1436 |
]. |
|
1437 |
||
1438 |
"Modified: 6.3.1997 / 17:43:20 / cg" |
|
1439 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
1440 |
! |
|
1441 |
||
1442 |
releaseVerticalScrollBar |
|
1443 |
"destroy any vertical scrollBar" |
|
1444 |
||
1445 |
vScrollBar notNil ifTrue:[ |
|
1446 |
vScrollBar destroy. |
|
1447 |
vScrollBar := nil |
|
1448 |
]. |
|
1449 |
||
1450 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
1097 | 1451 |
! |
7 | 1452 |
|
1453 |
setScrollActions |
|
1454 |
"lock prevents repositioning the scroller to the |
|
1455 |
actual (often rounded) position while scrolling, |
|
1456 |
and keeps it instead at the pointer position. |
|
1457 |
||
1458 |
(this avoids run-away scroller when scrolling |
|
1459 |
textviews, when the text is aligned line-wise). |
|
38 | 1460 |
Consider this as a kludge." |
7 | 1461 |
|
65 | 1462 |
lockUpdates := false. |
7 | 1463 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1464 |
vScrollBar notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1465 |
vScrollBar scrollAction:[:position | |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1466 |
lockUpdates := true. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1467 |
scrolledView scrollVerticalToPercent:position. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1468 |
lockUpdates := false |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1469 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1470 |
vScrollBar scrollUpAction:[scrolledView scrollUp]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1471 |
vScrollBar scrollDownAction:[scrolledView scrollDown]. |
7 | 1472 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1473 |
hScrollBar notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1474 |
hScrollBar scrollAction:[:position | |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1475 |
lockUpdates := true. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1476 |
scrolledView scrollHorizontalToPercent:position. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1477 |
lockUpdates := false |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1478 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1479 |
hScrollBar scrollUpAction:[scrolledView scrollLeft]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1480 |
hScrollBar scrollDownAction:[scrolledView scrollRight]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1481 |
]. |
7 | 1482 |
|
65 | 1483 |
scrolledView addDependent:self. |
814 | 1484 |
|
1485 |
" |
|
1486 |
pass my keyboard input (and other subviews input) |
|
1487 |
to the scrolled view ... |
|
1488 |
" |
|
1489 |
self delegate:(KeyboardForwarder toView:scrolledView). |
|
1490 |
||
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1491 |
"Modified: 6.3.1997 / 17:03:43 / cg" |
1111 | 1492 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1493 |
! |
|
1494 |
||
1495 |
setupDimensions |
|
1138 | 1496 |
"set the components dimensions (i.e. layouts) according to |
1497 |
the scrollability and hidden settings" |
|
1498 |
||
1113 | 1499 |
|scrolledViewMargin scrollBarSpacing |
1111 | 1500 |
scrolledViewLayout hScrollBarLayout vScrollBarLayout |
1501 |
vBd "{ Class: SmallInteger }" |
|
1502 |
hBd "{ Class: SmallInteger }" |
|
1503 |
sBd "{ Class: SmallInteger }" |
|
1504 |
wVScroll "{ Class: SmallInteger }" |
|
1505 |
hHScroll "{ Class: SmallInteger }" |
|
1506 |
hLeftOffs "{ Class: SmallInteger }" |
|
1507 |
hRightOffs "{ Class: SmallInteger }" |
|
1508 |
hTopOffs "{ Class: SmallInteger }" |
|
1509 |
hBottomOffs "{ Class: SmallInteger }" |
|
1510 |
sLeftOffs "{ Class: SmallInteger }" |
|
1511 |
sRightOffs "{ Class: SmallInteger }" |
|
1512 |
sTopOffs "{ Class: SmallInteger }" |
|
1513 |
sBottomOffs "{ Class: SmallInteger }" |
|
1514 |
vLeftOffs "{ Class: SmallInteger }" |
|
1515 |
vRightOffs "{ Class: SmallInteger }" |
|
1516 |
vTopOffs "{ Class: SmallInteger }" |
|
1517 |
vBottomOffs "{ Class: SmallInteger }" |
|
1518 |
addMargin "{ Class: SmallInteger }"| |
|
1519 |
||
1520 |
DefaultLevel notNil ifTrue:[self level:DefaultLevel]. |
|
1521 |
||
1522 |
sBd := 0. |
|
1523 |
DefaultScrolledViewBorderWidth notNil ifTrue:[ |
|
1524 |
sBd := DefaultScrolledViewBorderWidth. |
|
1525 |
scrolledView notNil ifTrue:[ |
|
1526 |
scrolledView borderWidth:DefaultScrolledViewBorderWidth. |
|
1527 |
] |
|
1528 |
] ifFalse:[ |
|
1529 |
scrolledView notNil ifTrue:[ |
|
1530 |
sBd := scrolledView borderWidth |
|
1531 |
] |
|
1532 |
]. |
|
1533 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1534 |
(vScrollBar notNil and:[vScrollBarHidden not]) ifTrue:[ |
1111 | 1535 |
vBd := vScrollBar borderWidth. |
1536 |
wVScroll := vScrollBar widthIncludingBorder. |
|
1537 |
] ifFalse:[ |
|
1538 |
vBd := wVScroll := 0. |
|
1539 |
]. |
|
1540 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1541 |
(hScrollBar notNil and:[hScrollBarHidden not]) ifTrue:[ |
1111 | 1542 |
hBd := hScrollBar borderWidth. |
1543 |
hHScroll := hScrollBar heightIncludingBorder. |
|
1544 |
] ifFalse:[ |
|
1545 |
hBd := hHScroll := 0. |
|
1546 |
]. |
|
1547 |
||
1548 |
"/ the raw layout ... |
|
1549 |
||
1550 |
scrolledViewLayout := ((0.0 @ 0.0) corner:(1.0@1.0)) asLayout. |
|
1551 |
hScrollBarLayout := ((0.0 @ 1.0) corner:(1.0@1.0)) asLayout. |
|
1552 |
||
1553 |
"/ the painful details; mostly complicated for 2D styles, |
|
1554 |
"/ where the positions are setUp to overlay borders ... |
|
1555 |
"/ (well, with 3D styles, a single pixel error will not be noticed; |
|
1556 |
"/ but 2D styles are very sensitive to those; |
|
1557 |
"/ the code below may not work correctly with different borderWidths). |
|
1558 |
||
1559 |
scrolledViewMargin := DefaultScrolledViewMargin. |
|
1560 |
scrollBarSpacing := DefaultScrollBarSpacing. |
|
1561 |
||
1562 |
vTopOffs := 0 - vBd + scrolledViewMargin + margin. |
|
1563 |
scrolledViewMargin == 0 ifTrue:[ |
|
1286 | 1564 |
vBottomOffs := vBd - scrolledViewMargin - sBd. |
1111 | 1565 |
] ifFalse:[ |
1286 | 1566 |
vBottomOffs := vBd - scrolledViewMargin + sBd. |
1111 | 1567 |
]. |
1568 |
||
1569 |
hLeftOffs := 0 - hBd + scrolledViewMargin + margin. |
|
1286 | 1570 |
hRightOffs := hBd - scrolledViewMargin - sBd. |
1111 | 1571 |
|
1572 |
sLeftOffs := 0 - hBd + scrolledViewMargin + margin. |
|
1286 | 1573 |
sRightOffs := hBd - scrolledViewMargin - sBd - sBd - sBd. |
1111 | 1574 |
|
1575 |
scrolledViewMargin == 0 ifTrue:[ |
|
1576 |
sTopOffs := 0 - sBd + margin. |
|
1286 | 1577 |
sBottomOffs := sBd - sBd. |
1111 | 1578 |
] ifFalse:[ |
1579 |
sTopOffs := 0 + scrolledViewMargin + margin. |
|
1286 | 1580 |
sBottomOffs := sBd - scrolledViewMargin - sBd - sBd - sBd. |
1111 | 1581 |
]. |
1582 |
||
1583 |
addMargin := 0. |
|
1584 |
"/ DefaultScrollBarLevel == DefaultScrolledViewLevel |
|
1585 |
"/ addMargin := 1. |
|
1586 |
"/ ]. |
|
1587 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1588 |
(vScrollBar notNil and:[vScrollBarHidden not]) ifTrue:[ |
1111 | 1589 |
scrollBarPosition == #right ifTrue:[ |
1590 |
"/ right/bottom |
|
1591 |
vScrollBarLayout := ((1.0 @ 0.0) corner:(1.0@1.0)) asLayout. |
|
1592 |
||
1593 |
vRightOffs := 0 - scrolledViewMargin + margin "???". |
|
1594 |
vLeftOffs := vRightOffs - wVScroll. |
|
1595 |
||
1596 |
sRightOffs := sRightOffs - scrollBarSpacing - wVScroll + sBd. |
|
1597 |
||
1598 |
hRightOffs := hRightOffs - wVScroll - scrollBarSpacing - sBd. |
|
1599 |
||
1600 |
sRightOffs := sRightOffs - addMargin |
|
1601 |
] ifFalse:[ |
|
1602 |
"/ left/bottom |
|
1603 |
vScrollBarLayout := ((0.0 @ 0.0) corner:(0.0@1.0)) asLayout. |
|
1604 |
||
1605 |
vLeftOffs := 0 - vBd + scrolledViewMargin + margin. |
|
1606 |
vRightOffs := vLeftOffs + wVScroll + margin. |
|
1607 |
||
1608 |
sLeftOffs := wVScroll + scrolledViewMargin + scrollBarSpacing + margin. |
|
1609 |
sRightOffs := 0 - scrolledViewMargin - margin. |
|
1610 |
hLeftOffs := hLeftOffs + wVScroll + vBd + scrollBarSpacing. |
|
1611 |
||
1612 |
sLeftOffs := sLeftOffs + addMargin |
|
1613 |
]. |
|
1614 |
]. |
|
1615 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1616 |
(hScrollBar notNil and:[hScrollBarHidden not]) ifTrue:[ |
1111 | 1617 |
hBottomOffs := 0 - scrolledViewMargin - hBd + margin "???". |
1618 |
hTopOffs := hBottomOffs - hHScroll. |
|
1619 |
scrolledViewMargin == 0 ifTrue:[ |
|
1620 |
hTopOffs := hTopOffs + sBd + sBd |
|
1621 |
]. |
|
1622 |
sBottomOffs := sBottomOffs - scrollBarSpacing - hHScroll. |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1623 |
(vScrollBar notNil and:[vScrollBarHidden not]) ifTrue:[ |
1111 | 1624 |
vBottomOffs := vBottomOffs - scrollBarSpacing - hHScroll. |
1625 |
]. |
|
1626 |
||
1627 |
sBottomOffs := sBottomOffs - addMargin. |
|
1628 |
hRightOffs := hRightOffs - addMargin. |
|
1629 |
]. |
|
1630 |
||
1357 | 1631 |
(hScrollBar notNil |
1632 |
and:[ hScrollBar borderWidth == 0 |
|
1633 |
and:[sBd ~~ 0 |
|
1634 |
and:[scrollBarPosition == #right]]]) ifTrue:[ |
|
1635 |
hRightOffs := hRightOffs + sBd + sBd. |
|
1636 |
]. |
|
1637 |
||
1111 | 1638 |
scrolledView notNil ifTrue:[ |
1639 |
scrolledViewLayout leftOffset:sLeftOffs. |
|
1640 |
scrolledViewLayout rightOffset:sRightOffs. |
|
1641 |
scrolledViewLayout topOffset:sTopOffs. |
|
1642 |
scrolledViewLayout bottomOffset:sBottomOffs. |
|
1643 |
||
1354 | 1644 |
(hideScrollBars not |
1645 |
and:[(hScrollBar isNil or:[hScrollBarHidden]) |
|
1646 |
and:[(vScrollBar isNil or:[vScrollBarHidden])]]) ifTrue:[ |
|
1243
064852ff0ef7
set scrolledViews level to 0 if there are no scrollBars
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
1647 |
scrolledView level:0 |
064852ff0ef7
set scrolledViews level to 0 if there are no scrollBars
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
1648 |
] ifFalse:[ |
064852ff0ef7
set scrolledViews level to 0 if there are no scrollBars
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
1649 |
scrolledView level:DefaultScrolledViewLevel. |
064852ff0ef7
set scrolledViews level to 0 if there are no scrollBars
Claus Gittinger <cg@exept.de>
parents:
1231
diff
changeset
|
1650 |
]. |
1111 | 1651 |
scrolledView layout:scrolledViewLayout. |
1652 |
]. |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1653 |
(hScrollBar notNil and:[hScrollBarHidden not]) ifTrue:[ |
1111 | 1654 |
hScrollBarLayout leftOffset:hLeftOffs. |
1655 |
hScrollBarLayout rightOffset:hRightOffs. |
|
1656 |
hScrollBarLayout topOffset:hTopOffs. |
|
1657 |
hScrollBarLayout bottomOffset:hBottomOffs. |
|
1658 |
||
1659 |
hScrollBar level:DefaultScrollBarLevel. |
|
1660 |
hScrollBar layout:hScrollBarLayout |
|
1661 |
]. |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1662 |
(vScrollBar notNil and:[vScrollBarHidden not]) ifTrue:[ |
1111 | 1663 |
vScrollBarLayout leftOffset:vLeftOffs. |
1664 |
vScrollBarLayout rightOffset:vRightOffs. |
|
1665 |
vScrollBarLayout topOffset:vTopOffs. |
|
1666 |
vScrollBarLayout bottomOffset:vBottomOffs. |
|
1667 |
||
1668 |
vScrollBar level:DefaultScrollBarLevel. |
|
1669 |
vScrollBar layout:vScrollBarLayout |
|
1670 |
]. |
|
1671 |
||
1672 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
1354 | 1673 |
"Modified: 20.10.1997 / 17:47:46 / cg" |
1111 | 1674 |
! |
1675 |
||
1676 |
setupVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH |
|
1677 |
"setup scrollbars as specified in the arguments" |
|
1678 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1679 |
|noMiniScrollers| |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1680 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1681 |
vScrollBarHidden := hScrollBarHidden := false. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1682 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1683 |
hasVerticalScrollBar := isVertical. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1684 |
hasHorizontalScrollBar := isHorizontal. |
1111 | 1685 |
|
1686 |
noMiniScrollers := styleSheet at:'scrollBarNeverMini' default:false. |
|
1687 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1688 |
verticalMini := miniV. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1689 |
verticalMini ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1690 |
noMiniScrollers ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1691 |
verticalMini := false |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1692 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1693 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1694 |
horizontalMini := miniH. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1695 |
horizontalMini ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1696 |
noMiniScrollers ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1697 |
horizontalMini := false |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1698 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1699 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1700 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1701 |
self setupViews. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1702 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1703 |
"Modified: 7.3.1997 / 22:09:12 / cg" |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1704 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1705 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1706 |
setupViews |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1707 |
"setup scrollbars as specified in the arguments" |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1708 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1709 |
|cls| |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1710 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1711 |
hasVerticalScrollBar ifTrue:[ |
1111 | 1712 |
cls := ScrollBar. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1713 |
verticalMini ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1714 |
cls := MiniScroller |
1111 | 1715 |
]. |
1716 |
(vScrollBar notNil |
|
1717 |
and:[vScrollBar class ~~ cls]) ifTrue:[ |
|
1718 |
self releaseVerticalScrollBar |
|
1719 |
]. |
|
1720 |
vScrollBar isNil ifTrue:[ |
|
1721 |
vScrollBar := cls in:self. |
|
1184
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1722 |
realized ifTrue:[ |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1723 |
vScrollBar realize |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1724 |
] |
1111 | 1725 |
]. |
1726 |
vScrollBar thumbOrigin:0 thumbHeight:100. |
|
1727 |
] ifFalse:[ |
|
1728 |
vScrollBar notNil ifTrue:[ |
|
1729 |
self releaseVerticalScrollBar |
|
1730 |
] |
|
1731 |
]. |
|
1732 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1733 |
hasHorizontalScrollBar ifTrue:[ |
1111 | 1734 |
cls := HorizontalScrollBar. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1735 |
horizontalMini ifTrue:[ |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1736 |
cls := HorizontalMiniScroller |
1111 | 1737 |
]. |
1738 |
(hScrollBar notNil |
|
1739 |
and:[hScrollBar class ~~ cls]) ifTrue:[ |
|
1740 |
self releaseHorizontalScrollBar |
|
1741 |
]. |
|
1742 |
hScrollBar isNil ifTrue:[ |
|
1743 |
hScrollBar := cls in:self. |
|
1184
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1744 |
realized ifTrue:[ |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1745 |
hScrollBar realize |
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1746 |
] |
1111 | 1747 |
]. |
1748 |
hScrollBar thumbOrigin:0 thumbHeight:100. |
|
1749 |
] ifFalse:[ |
|
1750 |
hScrollBar notNil ifTrue:[ |
|
1751 |
self releaseHorizontalScrollBar |
|
1752 |
] |
|
1753 |
]. |
|
1754 |
||
1755 |
scrolledView notNil ifTrue:[ |
|
1756 |
self setScrollActions. |
|
1757 |
] |
|
1758 |
||
1759 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
1184
733373c4f445
dont forget to set dimensions and realize
Claus Gittinger <cg@exept.de>
parents:
1183
diff
changeset
|
1760 |
"Modified: 8.4.1997 / 00:44:33 / cg" |
7 | 1761 |
! ! |
1762 |
||
217 | 1763 |
!ScrollableView methodsFor:'queries'! |
38 | 1764 |
|
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1765 |
isHorizontalScrollable |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1766 |
"return true if I am horizontally scrollable" |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1767 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1768 |
^ hScrollBar notNil |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1769 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1770 |
"Modified: 6.3.1997 / 17:03:49 / cg" |
1111 | 1771 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1772 |
! |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1773 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1774 |
isVerticalScrollable |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1775 |
"return true if I am vertically scrollable" |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1776 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1777 |
^ vScrollBar notNil |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1778 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1779 |
"Modified: 6.3.1997 / 17:03:52 / cg" |
1111 | 1780 |
"Created: 6.3.1997 / 18:06:23 / cg" |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1781 |
! |
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1782 |
|
217 | 1783 |
preferredExtent |
572 | 1784 |
"return my preferredExtent from the scrolledViews prefExtent |
1785 |
plus the size of the scrollBar" |
|
1786 |
||
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1787 |
|slavesPref prefX prefY| |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1788 |
|
799 | 1789 |
"/ If I have an explicit preferredExtent .. |
1790 |
||
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
1791 |
preferredExtent notNil ifTrue:[ |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
1792 |
^ preferredExtent |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
1793 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
1794 |
|
217 | 1795 |
scrolledView notNil ifTrue:[ |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1796 |
slavesPref := scrolledView preferredExtent. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1797 |
prefX := slavesPref x. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1798 |
prefY := slavesPref y. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1799 |
vScrollBar notNil ifTrue:[ |
1111 | 1800 |
prefX := prefX + vScrollBar width + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1801 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1802 |
hScrollBar notNil ifTrue:[ |
1111 | 1803 |
prefY := prefY + hScrollBar height + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1804 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1805 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1806 |
^ prefX @ prefY. |
0 | 1807 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1808 |
|
217 | 1809 |
^ super preferredExtent. |
572 | 1810 |
|
1111 | 1811 |
"Created: 6.3.1997 / 18:06:24 / cg" |
1812 |
"Modified: 6.3.1997 / 22:34:09 / cg" |
|
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1813 |
! |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1814 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1815 |
preferredExtentForLines:numLines cols:numCols |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1816 |
"return my preferredExtent from the scrolledViews prefExtent |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1817 |
plus the size of the scrollBar" |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1818 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1819 |
|slavesPref prefX prefY| |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1820 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1821 |
"/ If I have an explicit preferredExtent .. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1822 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1823 |
preferredExtent notNil ifTrue:[ |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1824 |
^ preferredExtent |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1825 |
]. |
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1826 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1827 |
scrolledView notNil ifTrue:[ |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1828 |
slavesPref := scrolledView preferredExtentForLines:numLines cols:numCols. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1829 |
prefX := slavesPref x. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1830 |
prefY := slavesPref y. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1831 |
vScrollBar notNil ifTrue:[ |
1111 | 1832 |
prefX := prefX + vScrollBar width + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1833 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1834 |
hScrollBar notNil ifTrue:[ |
1111 | 1835 |
prefY := prefY + hScrollBar height + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1836 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1837 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1838 |
^ prefX @ prefY. |
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1839 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1840 |
|
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1841 |
^ super preferredExtent. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
1842 |
|
1111 | 1843 |
"Created: 6.3.1997 / 18:06:24 / cg" |
1844 |
"Modified: 6.3.1997 / 22:34:30 / cg" |
|
1231 | 1845 |
! |
1846 |
||
1847 |
specClass |
|
1378 | 1848 |
"redefined, since my subclasses also want ScrollableViewSpecs" |
1849 |
||
1231 | 1850 |
^ ScrollableViewSpec |
1851 |
||
1378 | 1852 |
"Modified: / 31.10.1997 / 19:48:48 / cg" |
0 | 1853 |
! ! |
1854 |
||
1855 |
!ScrollableView methodsFor:'slave-view messages'! |
|
1856 |
||
1024 | 1857 |
clear |
1138 | 1858 |
"convenient method: forward this to the scrolledView" |
1859 |
||
1073 | 1860 |
scrolledView notNil ifTrue:[scrolledView clear] |
1024 | 1861 |
|
1111 | 1862 |
"Created: 6.3.1997 / 18:06:24 / cg" |
1138 | 1863 |
"Modified: 19.3.1997 / 16:34:19 / cg" |
1024 | 1864 |
! |
1865 |
||
217 | 1866 |
doesNotUnderstand:aMessage |
1867 |
"this is funny: all message we do not understand, are passed |
|
1868 |
on to the scrolledView - so we do not have to care for all |
|
1869 |
possible messages ...(thanks to the Message class)" |
|
1870 |
||
1871 |
scrolledView isNil ifFalse:[ |
|
1111 | 1872 |
^ scrolledView perform:(aMessage selector) |
1873 |
withArguments:(aMessage arguments) |
|
1874 |
]. |
|
1875 |
^ super doesNotUnderstand:aMessage |
|
1876 |
||
1877 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
1878 |
"Modified: 6.3.1997 / 18:38:54 / cg" |
|
217 | 1879 |
! |
1880 |
||
0 | 1881 |
leftButtonMenu |
38 | 1882 |
"return scrolledViews leftbuttonmenu" |
1883 |
||
1884 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 1885 |
^ scrolledView leftButtonMenu |
1111 | 1886 |
|
1887 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 1888 |
! |
1889 |
||
1890 |
leftButtonMenu:aMenu |
|
1891 |
"pass on leftbuttonmenu to scrolledView" |
|
1892 |
||
1893 |
scrolledView leftButtonMenu:aMenu |
|
1111 | 1894 |
|
1895 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 1896 |
! |
1897 |
||
1898 |
middleButtonMenu |
|
38 | 1899 |
"return scrolledViews middlebuttonmenu" |
1900 |
||
1901 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 1902 |
^ scrolledView middleButtonMenu |
1111 | 1903 |
|
1904 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 1905 |
! |
1906 |
||
1907 |
middleButtonMenu:aMenu |
|
1908 |
"pass on middlebuttonmenu to scrolledView" |
|
1909 |
||
1910 |
scrolledView middleButtonMenu:aMenu |
|
1111 | 1911 |
|
1912 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 1913 |
! |
1914 |
||
562 | 1915 |
model |
754 | 1916 |
"return my scrolledViews model" |
1917 |
||
1085 | 1918 |
scrolledView isNil ifTrue:[^ nil]. |
562 | 1919 |
^ scrolledView model |
1920 |
||
1085 | 1921 |
"Modified: 1.3.1997 / 01:38:07 / cg" |
1111 | 1922 |
"Created: 6.3.1997 / 18:06:24 / cg" |
562 | 1923 |
! |
1924 |
||
1925 |
model:aModel |
|
754 | 1926 |
"forward model change to my scrolledViews" |
1927 |
||
562 | 1928 |
^ scrolledView model:aModel |
1929 |
||
754 | 1930 |
"Modified: 5.6.1996 / 17:09:50 / cg" |
1111 | 1931 |
"Created: 6.3.1997 / 18:06:24 / cg" |
562 | 1932 |
! |
1933 |
||
0 | 1934 |
rightButtonMenu |
38 | 1935 |
"return scrolledViews rightbuttonmenu" |
1936 |
||
1937 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 1938 |
^ scrolledView rightButtonMenu |
1111 | 1939 |
|
1940 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 1941 |
! |
1942 |
||
1943 |
rightButtonMenu:aMenu |
|
1944 |
"pass on rightbuttonmenu to scrolledView" |
|
1945 |
||
1946 |
scrolledView rightButtonMenu:aMenu |
|
1111 | 1947 |
|
1948 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
38 | 1949 |
! ! |
1950 |
||
852 | 1951 |
!ScrollableView class methodsFor:'documentation'! |
0 | 1952 |
|
217 | 1953 |
version |
1459 | 1954 |
^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.77 1998-02-27 13:03:57 cg Exp $' |
0 | 1955 |
! ! |