author | Claus Gittinger <cg@exept.de> |
Wed, 12 Jun 1996 14:55:00 +0200 | |
changeset 760 | 62824e1f2607 |
parent 754 | 4db5b854cc88 |
child 799 | 64f8700489a4 |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
59 | 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 |
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
14 |
instanceVariableNames:'scrolledView scrollBar helpView innerMargin scrollBarPosition |
248 | 15 |
lockUpdates' |
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
16 |
classVariableNames:'DefaultScrolledViewLevel' |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
17 |
poolDictionaries:'' |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
18 |
category:'Views-Basic' |
0 | 19 |
! |
20 |
||
38 | 21 |
!ScrollableView class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
59 | 26 |
All Rights Reserved |
38 | 27 |
|
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
37 |
documentation |
|
38 |
" |
|
39 |
a view containing a scrollbar and some other (slave-)view. |
|
130 | 40 |
This view wraps scrollbar(s) around the view to be scrolled. |
65 | 41 |
The scrollbars are setup to send scrollUp/scrollDown/scrollVerticalTo |
42 |
and scrollLeft/scrollRight/scrollHorizontalTo- messages whenever moved. |
|
130 | 43 |
The view itself has to implement these (there is a default implementation |
65 | 44 |
in the common View class for this. |
45 |
||
46 |
For the scrollbars to know about the full (maximum) size, the view |
|
47 |
must implement #heightOfContents and/or #widthOfContents. |
|
130 | 48 |
The values returned by these methods are used to compute the fraction |
49 |
which is visible (i.e. the scrollers thumb heights). |
|
65 | 50 |
|
38 | 51 |
There are two ways to create a ScrollableView: |
52 |
if the type of the view to be scrolled is known in advance, |
|
53 |
use: |
|
584 | 54 |
v := ScrollableView for:<ViewClass> |
130 | 55 |
or: |
584 | 56 |
v := ScrollableView for:<ViewClass> in:someSuperView |
65 | 57 |
|
38 | 58 |
otherwise, create the scrollableView empty with: |
130 | 59 |
|
584 | 60 |
v := ScrollableView new |
130 | 61 |
or: |
584 | 62 |
v := ScrollableView in:someSuperView |
130 | 63 |
|
65 | 64 |
and define the view later with: |
130 | 65 |
|
584 | 66 |
v scrolledView:aViewToBeScrolled |
65 | 67 |
|
130 | 68 |
Finally, if the view to be scrolled has been already created, |
69 |
use: |
|
70 |
||
584 | 71 |
v := ScrollableView forView:aViewToBeScrolled |
130 | 72 |
or: |
584 | 73 |
v := ScrollableView forView:aViewToBeScrolled in:someSuperView |
65 | 74 |
|
130 | 75 |
It is also possible to change the scrolledView later (even multiple times). |
76 |
This may be useful, if different views are needed to display different types |
|
77 |
of data (see example2) and at creation time, it is not known what type |
|
78 |
of view is required (multimedia applications). |
|
79 |
||
80 |
If you want to scroll views (instead of a views contents), you need a |
|
81 |
companion class (ViewScroller). See the documentation there. |
|
65 | 82 |
|
83 |
If you need horizontal scrolling too, use an instance of HVScrollableView. |
|
113 | 84 |
|
85 |
By default, scrollbars are full size scrollbars - for horizontal scrolling |
|
86 |
(which is less often used), scrollableViews can optionally be created with |
|
87 |
miniscrollers which take up less screen space. |
|
130 | 88 |
|
89 |
TODO: |
|
584 | 90 |
this is pretty old and needs a rewrite. There are quite some |
91 |
historic leftovers found here and things can be done better |
|
92 |
(especially in initializeFor...) |
|
93 |
||
94 |
Also, it should be rewritten into one class which supports both |
|
95 |
Vertical-only, Horizontal-only and HV scrolling. |
|
96 |
Currently, horizontal-only scrolling is not available. |
|
97 |
(you have to write your own class ...) |
|
130 | 98 |
|
584 | 99 |
Finally, some means to hide scrollbars should be added - this would |
100 |
give more screenspace to the view when all is visible |
|
101 |
(and therefore, the scrollbars are not needed, anyway) |
|
102 |
||
103 |
Expect the above things to be fixed in an upcoming version. |
|
130 | 104 |
|
584 | 105 |
[author:] |
106 |
Claus Gittinger |
|
130 | 107 |
|
584 | 108 |
[see also:] |
109 |
ScrollBar Scroller |
|
110 |
HVScrollableView |
|
63 | 111 |
" |
112 |
! |
|
38 | 113 |
|
63 | 114 |
examples |
115 |
" |
|
65 | 116 |
example1 (simple scrolled text): |
591 | 117 |
[exBegin] |
118 |
|top scr txt| |
|
0 | 119 |
|
591 | 120 |
top := StandardSystemView label:'scroll example1'. |
121 |
top extent:200@100. |
|
113 | 122 |
|
591 | 123 |
scr := ScrollableView for:EditTextView in:top. |
124 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
125 |
txt := scr scrolledView. |
|
38 | 126 |
|
591 | 127 |
txt list:#('line1' |
128 |
'line2' |
|
129 |
'line3' |
|
130 |
'line4' |
|
131 |
'line5' |
|
132 |
'line7' |
|
133 |
'line8' |
|
134 |
'line9' |
|
135 |
'line10' |
|
136 |
). |
|
137 |
top open |
|
138 |
[exEnd] |
|
38 | 139 |
|
65 | 140 |
|
141 |
example2 (changing the scrolledView later): |
|
591 | 142 |
[exBegin] |
143 |
|top scr txtView1 txtView2 browserView| |
|
38 | 144 |
|
591 | 145 |
top := StandardSystemView label:'scroll example2'. |
146 |
top extent:300@100. |
|
113 | 147 |
|
591 | 148 |
scr := ScrollableView in:top. |
149 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
113 | 150 |
|
591 | 151 |
top open. |
0 | 152 |
|
591 | 153 |
(Delay forSeconds:5) wait. |
38 | 154 |
|
591 | 155 |
txtView1 := EditTextView new. |
156 |
txtView1 list:#( |
|
157 |
'wait 5 seconds to see the other text' |
|
158 |
'line2' |
|
159 |
'line3' |
|
160 |
'line4' |
|
161 |
'line5' |
|
162 |
'line7' |
|
163 |
'line8' |
|
164 |
'line9' |
|
165 |
'line10' |
|
166 |
). |
|
167 |
scr scrolledView:txtView1. |
|
38 | 168 |
|
591 | 169 |
(Delay forSeconds:5) wait. |
38 | 170 |
|
591 | 171 |
txtView2 := EditTextView new. |
172 |
txtView2 list:#('this is the other views text' |
|
173 |
'alternative line2' |
|
174 |
'alternative line3' |
|
175 |
'alternative line4' |
|
176 |
'alternative line5' |
|
177 |
'alternative line6'). |
|
178 |
scr scrolledView:txtView2. |
|
179 |
[exEnd] |
|
113 | 180 |
|
181 |
||
182 |
||
183 |
||
184 |
example3 (using a miniscroller): |
|
591 | 185 |
[exBegin] |
186 |
|top scr txt| |
|
113 | 187 |
|
591 | 188 |
top := StandardSystemView label:'scroll example3'. |
189 |
top extent:200@100. |
|
113 | 190 |
|
591 | 191 |
scr := ScrollableView for:EditTextView miniScroller:true in:top. |
192 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
193 |
txt := scr scrolledView. |
|
113 | 194 |
|
591 | 195 |
txt list:#('line1' |
196 |
'line2' |
|
197 |
'line3' |
|
198 |
'line4' |
|
199 |
'line5' |
|
200 |
'line7' |
|
201 |
'line8' |
|
202 |
'line9' |
|
203 |
'line10' |
|
204 |
). |
|
205 |
top open |
|
206 |
[exEnd] |
|
113 | 207 |
|
208 |
||
209 |
||
210 |
example4 (scrolling in both directions): |
|
591 | 211 |
[exBegin] |
212 |
|top scr txt| |
|
113 | 213 |
|
591 | 214 |
top := StandardSystemView label:'scroll example4'. |
215 |
top extent:200@100. |
|
113 | 216 |
|
591 | 217 |
scr := HVScrollableView for:EditTextView in:top. |
218 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
219 |
txt := scr scrolledView. |
|
113 | 220 |
|
591 | 221 |
txt list:#('line1' |
222 |
'line2' |
|
223 |
'line3' |
|
224 |
'line4' |
|
225 |
'line5' |
|
226 |
'line7' |
|
227 |
'line8' |
|
228 |
'line9' |
|
229 |
'line10' |
|
230 |
). |
|
231 |
top open |
|
232 |
[exEnd] |
|
113 | 233 |
|
234 |
||
235 |
||
236 |
example5 (using a full scroller vertically, miniscroller horizontally): |
|
591 | 237 |
[exBegin] |
238 |
|top scr txt| |
|
113 | 239 |
|
591 | 240 |
top := StandardSystemView label:'scroll example5'. |
241 |
top extent:200@100. |
|
113 | 242 |
|
591 | 243 |
scr := HVScrollableView for:EditTextView miniScrollerH:true in:top. |
244 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
245 |
txt := scr scrolledView. |
|
113 | 246 |
|
591 | 247 |
txt list:#('line1' |
248 |
'line2' |
|
249 |
'line3' |
|
250 |
'line4' |
|
251 |
'line5' |
|
252 |
'line7' |
|
253 |
'line8' |
|
254 |
'line9' |
|
255 |
'line10' |
|
256 |
). |
|
257 |
top open |
|
258 |
[exEnd] |
|
113 | 259 |
|
260 |
||
261 |
||
262 |
example6 (using miniscrollers for both directions ): |
|
591 | 263 |
[exBegin] |
264 |
|top scr txt| |
|
113 | 265 |
|
591 | 266 |
top := StandardSystemView label:'scroll example6'. |
267 |
top extent:200@100. |
|
113 | 268 |
|
591 | 269 |
scr := HVScrollableView for:EditTextView miniScroller:true in:top. |
270 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
271 |
txt := scr scrolledView. |
|
113 | 272 |
|
591 | 273 |
txt list:#('line1' |
274 |
'line2' |
|
275 |
'line3' |
|
276 |
'line4' |
|
277 |
'line5' |
|
278 |
'line7' |
|
279 |
'line8' |
|
280 |
'line9' |
|
281 |
'line10' |
|
282 |
). |
|
283 |
top open |
|
284 |
[exEnd] |
|
38 | 285 |
" |
286 |
! ! |
|
0 | 287 |
|
217 | 288 |
!ScrollableView class methodsFor:'instance creation'! |
289 |
||
290 |
for:aViewClass |
|
291 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
292 |
The subview is created here. |
|
293 |
The view will have full scrollbars." |
|
294 |
||
295 |
^ self for:aViewClass miniScrollerH:false miniScrollerV:false in:nil |
|
296 |
! |
|
297 |
||
298 |
for:aViewClass in:aView |
|
299 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
300 |
The subview is created here. |
|
301 |
The view will have full scrollbars." |
|
302 |
||
303 |
^ self for:aViewClass miniScrollerH:false miniScrollerV:false in:aView |
|
304 |
! |
|
305 |
||
306 |
for:aViewClass miniScroller:mini |
|
307 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
308 |
The subview is created here. |
|
309 |
The view will have full scrollbars if mini is false, miniscrollers |
|
310 |
if true." |
|
311 |
||
312 |
^ self for:aViewClass miniScrollerH:mini miniScrollerV:mini in:nil |
|
313 |
! |
|
314 |
||
315 |
for:aViewClass miniScroller:mini in:aView |
|
316 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
317 |
The subview is created here. |
|
318 |
The view will have full scrollbars if mini is false, miniscrollers |
|
319 |
if true." |
|
320 |
||
321 |
^ self for:aViewClass miniScrollerH:mini miniScrollerV:mini in:aView |
|
322 |
! |
|
153 | 323 |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
324 |
for:aViewClass miniScroller:mini origin:org corner:corn in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
325 |
"return a new scrolling view scrolling an instance of aViewClass. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
326 |
The subview is created here. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
327 |
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
|
328 |
if true." |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
329 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
330 |
^ self for:aViewClass miniScrollerH:mini miniScrollerV:mini origin:org corner:corn in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
331 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
332 |
"Created: 18.4.1996 / 14:31:41 / cg" |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
333 |
! |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
334 |
|
217 | 335 |
for:aViewClass miniScrollerH:miniH |
336 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
337 |
The subview is created here. |
|
338 |
The view will have full scrollbars if miniH is false, |
|
339 |
and a horizontal miniscroller if true." |
|
340 |
||
341 |
^ self for:aViewClass miniScrollerH:miniH miniScrollerV:false in:nil |
|
342 |
! |
|
343 |
||
344 |
for:aViewClass miniScrollerH:miniH in:aView |
|
345 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
346 |
The subview is created here. |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
347 |
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
|
348 |
is false, miniscrollers if true." |
217 | 349 |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
350 |
^ self for:aViewClass miniScrollerH:miniH miniScrollerV:false in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
351 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
352 |
"Modified: 18.4.1996 / 14:29:23 / cg" |
217 | 353 |
! |
153 | 354 |
|
217 | 355 |
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV |
356 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
357 |
The subview is created here. |
|
358 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
359 |
is false, miniscrollers if true." |
|
360 |
||
361 |
^ self for:aViewClass miniScrollerH:miniH miniScrollerV:miniV in:nil |
|
362 |
! |
|
363 |
||
364 |
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV in:aView |
|
365 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
366 |
The subview is created here. |
|
367 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
368 |
is false, miniscrollers if true." |
|
369 |
||
300 | 370 |
|newView dev| |
217 | 371 |
|
372 |
aView notNil ifTrue:[ |
|
703 | 373 |
dev := aView graphicsDevice |
300 | 374 |
] ifFalse:[ |
703 | 375 |
dev := Screen current |
300 | 376 |
]. |
377 |
newView := self basicNew device:dev. |
|
378 |
newView initializeFor:aViewClass miniScrollerH:miniH miniScrollerV:miniV. |
|
379 |
aView notNil ifTrue:[ |
|
703 | 380 |
aView addSubView:newView |
153 | 381 |
]. |
217 | 382 |
^ newView |
703 | 383 |
|
384 |
"Modified: 28.5.1996 / 20:23:46 / cg" |
|
217 | 385 |
! |
386 |
||
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
387 |
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
388 |
"return a new scrolling view scrolling an instance of aViewClass. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
389 |
The subview is created here. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
390 |
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
|
391 |
is false, miniscrollers if true." |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
392 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
393 |
|newView| |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
394 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
395 |
newView := self for:aViewClass miniScrollerH:miniH miniScrollerV:miniV in:aView. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
396 |
newView origin:org corner:corn. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
397 |
^ newView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
398 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
399 |
"Created: 18.4.1996 / 11:41:05 / cg" |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
400 |
"Modified: 18.4.1996 / 14:27:39 / cg" |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
401 |
! |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
402 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
403 |
for:aViewClass miniScrollerH:miniH origin:org corner:corn in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
404 |
"return a new scrolling view scrolling an instance of aViewClass. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
405 |
The subview is created here. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
406 |
The view will have a full horizontal scrollbar if miniH is false, |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
407 |
a miniscroller if true." |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
408 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
409 |
^ self for:aViewClass miniScrollerH:miniH miniScrollerV:false origin:org corner:corn in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
410 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
411 |
"Modified: 18.4.1996 / 14:32:07 / cg" |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
412 |
! |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
413 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
414 |
for:aViewClass miniScrollerV:miniV origin:org corner:corn in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
415 |
"return a new scrolling view scrolling an instance of aViewClass. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
416 |
The subview is created here. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
417 |
The view will have a full vertical scrollbar if miniV is false, |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
418 |
a miniscroller if true." |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
419 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
420 |
^ self for:aViewClass miniScrollerH:false miniScrollerV:miniV origin:org corner:corn in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
421 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
422 |
"Created: 18.4.1996 / 14:30:57 / cg" |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
423 |
"Modified: 18.4.1996 / 14:32:21 / cg" |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
424 |
! |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
425 |
|
492 | 426 |
for:aViewClass origin:org corner:corner in:aView |
427 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
428 |
The subview is created here. |
|
429 |
The view will have full scrollbars." |
|
430 |
||
431 |
|v| |
|
432 |
||
433 |
v := self for:aViewClass miniScrollerH:false miniScrollerV:false in:aView. |
|
434 |
v origin:org corner:corner. |
|
435 |
^ v |
|
436 |
||
437 |
"Created: 7.3.1996 / 13:01:08 / cg" |
|
438 |
! |
|
439 |
||
217 | 440 |
forView:aView |
441 |
"return a new scrolling view scrolling aView. |
|
442 |
The view will have full scrollbars." |
|
443 |
||
444 |
^ self forView:aView miniScrollerH:false miniScrollerV:false in:nil |
|
445 |
! |
|
446 |
||
248 | 447 |
forView:aView miniScrollerH:mini |
448 |
"return a new scrolling view scrolling aView. |
|
449 |
The view will have a full vertical scrollbar and a horizontal |
|
450 |
miniScroller if mini is true." |
|
451 |
||
452 |
^ self forView:aView miniScrollerH:mini miniScrollerV:false in:nil |
|
453 |
||
454 |
"Created: 10.12.1995 / 17:26:16 / cg" |
|
455 |
! |
|
456 |
||
217 | 457 |
forView:scrolledView miniScrollerH:miniH miniScrollerV:miniV in:aView |
458 |
"return a new scrolling view, scrolling aView. |
|
459 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
460 |
is false, miniscrollers if true." |
|
153 | 461 |
|
217 | 462 |
|newView| |
463 |
||
464 |
newView := self for:nil miniScrollerH:miniH miniScrollerV:miniV in:aView. |
|
465 |
newView scrolledView:scrolledView. |
|
466 |
^ newView |
|
467 |
! |
|
153 | 468 |
|
217 | 469 |
in:aView |
470 |
"return a new scrolling view to be contained in aView. |
|
471 |
There is no slave view now - this has to be set later via |
|
472 |
the scrolledView: method. |
|
473 |
The view will have full scrollbars." |
|
474 |
||
475 |
^ self for:nil miniScrollerH:false miniScrollerV:false in:aView |
|
476 |
! |
|
0 | 477 |
|
93 | 478 |
miniScroller:mini |
479 |
"return a new scrolling view. The subview will be created later. |
|
480 |
The view will have full scrollbars if mini is false, |
|
481 |
miniscrollers if true." |
|
482 |
||
483 |
^ self for:nil miniScrollerH:mini miniScrollerV:mini |
|
484 |
! |
|
485 |
||
113 | 486 |
miniScrollerH:miniH |
487 |
"return a new scrolling view. The subview will be created later. |
|
488 |
The view will have full scrollbars if miniH is false, |
|
489 |
and a horizontal miniscroller if true." |
|
490 |
||
491 |
^ self for:nil miniScrollerH:miniH miniScrollerV:false in:nil |
|
492 |
! |
|
493 |
||
93 | 494 |
miniScrollerH:miniH miniScrollerV:miniV |
495 |
"return a new scrolling view. The subview will be created later. |
|
496 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
113 | 497 |
is false, miniscrollers if true." |
93 | 498 |
|
499 |
^ self for:nil miniScrollerH:miniH miniScrollerV:miniV in:nil |
|
217 | 500 |
! ! |
93 | 501 |
|
217 | 502 |
!ScrollableView class methodsFor:'defaults'! |
503 |
||
504 |
updateStyleCache |
|
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
505 |
"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
|
506 |
|
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
507 |
<resource: #style (#scrolledViewLevel)> |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
508 |
|
217 | 509 |
|d| |
38 | 510 |
|
217 | 511 |
StyleSheet name == #st80 ifTrue:[ |
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
512 |
d := 1 |
217 | 513 |
] ifFalse:[ |
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
514 |
StyleSheet is3D ifTrue:[ |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
515 |
d := -1 |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
516 |
] ifFalse:[ |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
517 |
d := 0 |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
518 |
] |
217 | 519 |
]. |
520 |
DefaultScrolledViewLevel := StyleSheet at:'scrolledViewLevel' default:d. |
|
0 | 521 |
|
217 | 522 |
"Modified: 31.8.1995 / 04:05:55 / claus" |
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
523 |
"Modified: 1.3.1996 / 13:46:39 / cg" |
217 | 524 |
! ! |
525 |
||
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
526 |
!ScrollableView methodsFor:'accessing - components'! |
119 | 527 |
|
217 | 528 |
scrollBar |
529 |
"return the scrollbar" |
|
530 |
||
531 |
^ scrollBar |
|
119 | 532 |
! |
533 |
||
217 | 534 |
scrolledView |
535 |
"return the scrolled view" |
|
38 | 536 |
|
217 | 537 |
^ scrolledView |
113 | 538 |
! |
539 |
||
217 | 540 |
scrolledView:aView |
541 |
"set the view to scroll" |
|
542 |
||
543 |
|halfMargin twoMargins isOpenwin| |
|
544 |
||
545 |
scrolledView notNil ifTrue:[ |
|
546 |
scrolledView destroy. |
|
547 |
scrolledView := nil. |
|
548 |
]. |
|
549 |
scrolledView := aView. |
|
77 | 550 |
|
217 | 551 |
"/ ((style ~~ #normal) and:[style ~~ #mswindows]) ifTrue:[ |
552 |
styleSheet is3D ifTrue:[ |
|
553 |
"3D look" |
|
554 |
||
555 |
isOpenwin := styleSheet name = #openwin. |
|
556 |
||
557 |
twoMargins := innerMargin * 2. |
|
558 |
halfMargin := innerMargin // 2. |
|
559 |
||
560 |
isOpenwin ifTrue:[ |
|
561 |
scrolledView level:0. |
|
562 |
scrolledView borderWidth:1 |
|
563 |
] ifFalse:[ |
|
564 |
scrolledView level:DefaultScrolledViewLevel. |
|
565 |
"/ scrolledView level:-1 |
|
566 |
]. |
|
77 | 567 |
|
217 | 568 |
(scrollBarPosition == #right) ifTrue:[ |
569 |
scrolledView |
|
570 |
origin:halfMargin asPoint |
|
571 |
extent:[(width - |
|
572 |
scrollBar width - |
|
573 |
twoMargins) |
|
574 |
@ |
|
575 |
(height - innerMargin) |
|
576 |
]. |
|
577 |
] ifFalse:[ |
|
578 |
scrolledView |
|
579 |
origin:((scrollBar origin x |
|
580 |
+ scrollBar width |
|
581 |
+ innerMargin) |
|
582 |
@ |
|
583 |
halfMargin) |
|
584 |
extent:[(width |
|
585 |
- scrollBar width |
|
586 |
- twoMargins) |
|
587 |
@ |
|
588 |
(height - innerMargin) |
|
589 |
]. |
|
590 |
] |
|
591 |
] ifFalse:[ |
|
592 |
"non 3D look" |
|
593 |
(scrollBarPosition == #right) ifTrue:[ |
|
594 |
scrolledView |
|
595 |
origin:scrolledView borderWidth negated asPoint |
|
596 |
] ifFalse:[ |
|
597 |
scrolledView |
|
598 |
origin:((scrollBar width |
|
599 |
+ scrollBar borderWidth |
|
600 |
- scrolledView borderWidth) |
|
601 |
@ |
|
602 |
scrolledView borderWidth negated) |
|
603 |
]. |
|
604 |
scrolledView |
|
605 |
extent:[ |
|
606 |
(width |
|
607 |
- scrollBar width |
|
608 |
- scrolledView borderWidth) |
|
609 |
@ |
|
610 |
(height + (scrollBar borderWidth)) |
|
611 |
] |
|
612 |
]. |
|
132 | 613 |
|
217 | 614 |
super addSubView:scrolledView. |
615 |
self setScrollActions. |
|
616 |
||
617 |
" |
|
618 |
pass my keyboard input (and other subviews input) |
|
619 |
to the scrolled view ... |
|
620 |
" |
|
621 |
self delegate:(KeyboardForwarder toView:scrolledView). |
|
622 |
||
623 |
realized ifTrue:[ |
|
624 |
self sizeChanged:nil. |
|
625 |
scrolledView realize |
|
626 |
]. |
|
627 |
! ! |
|
628 |
||
629 |
!ScrollableView methodsFor:'changes '! |
|
630 |
||
631 |
update:something with:argument from:changedObject |
|
632 |
"whenever the scrolledView changes its contents, the scroller must |
|
633 |
be updated" |
|
132 | 634 |
|
217 | 635 |
changedObject == scrolledView ifTrue:[ |
636 |
something == #sizeOfContents ifTrue:[ |
|
637 |
scrollBar setThumbFor:scrolledView. |
|
638 |
^ self |
|
639 |
]. |
|
640 |
something == #originOfContents ifTrue:[ |
|
641 |
lockUpdates ifFalse:[ |
|
642 |
scrollBar setThumbOriginFor:scrolledView. |
|
643 |
]. |
|
644 |
^ self |
|
645 |
]. |
|
646 |
]. |
|
647 |
! ! |
|
38 | 648 |
|
217 | 649 |
!ScrollableView methodsFor:'event processing'! |
650 |
||
651 |
keyPress:key x:x y:y |
|
652 |
"a key was pressed - handle page-keys here" |
|
653 |
||
654 |
<resource: #keyboard ( #Prior #Next ) > |
|
655 |
||
656 |
(key == #Prior) ifTrue: [^ self pageUp]. |
|
657 |
(key == #Next) ifTrue: [^ self pageDown]. |
|
658 |
||
659 |
super keyPress:key x:x y:y |
|
38 | 660 |
! |
661 |
||
217 | 662 |
sizeChanged:how |
663 |
super sizeChanged:how. |
|
664 |
scrolledView notNil ifTrue:[ |
|
665 |
scrollBar setThumbFor:scrolledView |
|
666 |
]. |
|
667 |
scrollBar thumbOrigin + scrollBar thumbHeight >= 100 ifTrue:[ |
|
668 |
scrollBar thumbOrigin:(100 - scrollBar thumbHeight). |
|
669 |
scrolledView scrollVerticalToPercent:scrollBar thumbOrigin. |
|
670 |
]. |
|
113 | 671 |
|
217 | 672 |
"Modified: 8.9.1995 / 12:46:36 / claus" |
673 |
! ! |
|
674 |
||
675 |
!ScrollableView methodsFor:'forced scroll'! |
|
676 |
||
677 |
pageDown |
|
678 |
"page down" |
|
679 |
||
680 |
scrollBar pageDown |
|
113 | 681 |
! |
682 |
||
217 | 683 |
pageUp |
684 |
"page up" |
|
0 | 685 |
|
217 | 686 |
scrollBar pageUp |
0 | 687 |
! ! |
688 |
||
689 |
!ScrollableView methodsFor:'initialization'! |
|
690 |
||
217 | 691 |
initStyle |
608 | 692 |
<resource: #style (#scrollBarPosition)> |
693 |
||
217 | 694 |
super initStyle. |
695 |
||
696 |
scrollBarPosition := styleSheet at:'scrollBarPosition' default:#left |
|
608 | 697 |
|
698 |
"Modified: 30.4.1996 / 17:01:53 / cg" |
|
217 | 699 |
! |
700 |
||
0 | 701 |
initialize |
38 | 702 |
"default setup: full scrollers" |
703 |
||
704 |
^ self initializeFor:nil miniScrollerH:false miniScrollerV:false |
|
0 | 705 |
! |
706 |
||
38 | 707 |
initializeFor:aViewClass miniScrollerH:miniH miniScrollerV:miniV |
130 | 708 |
|negativeOffset twoMargins halfMargin cls isST80 isOpenWin is3D lvl extra| |
0 | 709 |
|
710 |
super initialize. |
|
711 |
||
65 | 712 |
lockUpdates := false. |
713 |
||
110 | 714 |
" |
715 |
mhmh - these must go into the stylesheet as well... |
|
716 |
" |
|
130 | 717 |
isST80 := styleSheet name = #st80. |
718 |
isOpenWin := styleSheet name = #openwin. |
|
59 | 719 |
|
110 | 720 |
isOpenWin ifTrue:[self level:0]. |
130 | 721 |
is3D := styleSheet is3D. |
59 | 722 |
|
723 |
isST80 ifTrue:[ |
|
724 |
innerMargin := 0 |
|
38 | 725 |
] ifFalse:[ |
59 | 726 |
is3D ifTrue:[ |
727 |
innerMargin := ViewSpacing. |
|
728 |
] ifFalse:[ |
|
729 |
innerMargin := 0 |
|
730 |
] |
|
38 | 731 |
]. |
0 | 732 |
negativeOffset := borderWidth negated. |
733 |
||
734 |
"create the scrollbar" |
|
735 |
||
59 | 736 |
isST80 ifTrue:[ |
737 |
cls := ScrollBar |
|
738 |
] ifFalse:[ |
|
739 |
cls := miniV ifTrue:[MiniScroller] ifFalse:[ScrollBar]. |
|
740 |
]. |
|
38 | 741 |
|
742 |
scrollBar := cls in:self. |
|
0 | 743 |
scrollBar thumbOrigin:0 thumbHeight:100. |
744 |
||
130 | 745 |
extra := 0. |
746 |
||
0 | 747 |
"create the subview" |
59 | 748 |
is3D ifTrue:[ |
749 |
twoMargins := innerMargin * 2. |
|
750 |
halfMargin := innerMargin // 2. |
|
0 | 751 |
|
59 | 752 |
aViewClass notNil ifTrue:[ |
753 |
scrolledView := aViewClass in:self. |
|
110 | 754 |
isOpenWin ifTrue:[ |
130 | 755 |
lvl := 0. |
756 |
"/ scrolledView level:0. |
|
757 |
scrolledView borderWidth:1. |
|
59 | 758 |
] ifFalse:[ |
153 | 759 |
lvl := DefaultScrolledViewLevel. |
760 |
"/ isST80 ifTrue:[ |
|
761 |
"/ "/ scrolledView level:1. |
|
762 |
"/ lvl := 1. |
|
763 |
"/ ] ifFalse:[ |
|
764 |
"/ "/ scrolledView level:-1 |
|
765 |
"/ lvl := -1 |
|
766 |
"/ ] |
|
59 | 767 |
]. |
130 | 768 |
scrolledView level:lvl. |
769 |
extra := scrolledView borderWidth * 2. |
|
59 | 770 |
]. |
130 | 771 |
|
772 |
scrollBar extent:[scrollBar extent x |
|
773 |
@ |
|
774 |
(height - innerMargin "new:" + extra)]. |
|
775 |
scrolledView notNil ifTrue:[ |
|
776 |
scrolledView |
|
777 |
extent:[(width |
|
778 |
- scrollBar width |
|
779 |
- twoMargins) |
|
780 |
@ |
|
781 |
(height - innerMargin)]. |
|
782 |
]. |
|
783 |
||
59 | 784 |
(scrollBarPosition == #right) ifTrue:[ |
785 |
scrollBar origin:[width - scrollBar extent x |
|
786 |
- (scrollBar borderWidth * 2) |
|
787 |
- halfMargin |
|
788 |
@ |
|
130 | 789 |
halfMargin]. |
38 | 790 |
|
59 | 791 |
scrolledView notNil ifTrue:[ |
792 |
scrolledView origin:halfMargin asPoint |
|
793 |
] |
|
794 |
] ifFalse:[ |
|
130 | 795 |
scrollBar origin:halfMargin asPoint. |
38 | 796 |
|
59 | 797 |
scrolledView notNil ifTrue:[ |
798 |
scrolledView origin:((scrollBar origin x + scrollBar width + innerMargin) |
|
799 |
@ |
|
800 |
halfMargin) |
|
801 |
] |
|
802 |
]. |
|
0 | 803 |
] ifFalse:[ |
59 | 804 |
(scrollBarPosition == #right) ifTrue:[ |
805 |
scrollBar origin:[width - scrollBar extent x |
|
806 |
- scrollBar borderWidth |
|
807 |
@ |
|
808 |
negativeOffset] |
|
809 |
] ifFalse:[ |
|
810 |
scrollBar origin:negativeOffset asPoint |
|
811 |
]. |
|
130 | 812 |
scrollBar extent:[scrollBar extent x |
813 |
@ |
|
814 |
(height "+ (scrollBar borderWidth * 1)")]. |
|
0 | 815 |
|
59 | 816 |
aViewClass notNil ifTrue:[ |
817 |
scrolledView := aViewClass in:self. |
|
818 |
(scrollBarPosition == #right) ifTrue:[ |
|
819 |
scrolledView origin:scrolledView borderWidth negated asPoint |
|
820 |
] ifFalse:[ |
|
821 |
scrolledView origin:((scrollBar width + |
|
822 |
scrollBar borderWidth - |
|
823 |
scrolledView borderWidth) |
|
824 |
@ |
|
825 |
scrolledView borderWidth negated) |
|
826 |
]. |
|
827 |
scrolledView extent:[(width - scrollBar width - scrolledView borderWidth) |
|
828 |
@ |
|
829 |
(height + (scrollBar borderWidth)) |
|
830 |
] |
|
831 |
]. |
|
0 | 832 |
]. |
833 |
scrolledView notNil ifTrue:[ |
|
59 | 834 |
self setScrollActions. |
835 |
" |
|
113 | 836 |
pass my keyboard input (and other subviews input) |
837 |
to the scrolled view ... |
|
59 | 838 |
" |
122 | 839 |
self delegate:(KeyboardForwarder toView:scrolledView). |
0 | 840 |
] |
841 |
! |
|
842 |
||
843 |
realize |
|
844 |
super realize. |
|
38 | 845 |
|
0 | 846 |
"since scrolledview may have done something to its contents |
847 |
during init-time we had no chance yet to catch contents- |
|
848 |
changes; do it now |
|
849 |
" |
|
38 | 850 |
scrolledView notNil ifTrue:[ |
59 | 851 |
scrollBar setThumbFor:scrolledView |
38 | 852 |
] |
0 | 853 |
! ! |
854 |
||
7 | 855 |
!ScrollableView methodsFor:'private'! |
856 |
||
857 |
setScrollActions |
|
858 |
"lock prevents repositioning the scroller to the |
|
859 |
actual (often rounded) position while scrolling, |
|
860 |
and keeps it instead at the pointer position. |
|
861 |
||
862 |
(this avoids run-away scroller when scrolling |
|
863 |
textviews, when the text is aligned line-wise). |
|
38 | 864 |
Consider this as a kludge." |
7 | 865 |
|
65 | 866 |
lockUpdates := false. |
7 | 867 |
|
868 |
scrollBar scrollAction:[:position | |
|
65 | 869 |
lockUpdates := true. |
59 | 870 |
scrolledView scrollVerticalToPercent:position. |
65 | 871 |
lockUpdates := false |
7 | 872 |
]. |
873 |
scrollBar scrollUpAction:[scrolledView scrollUp]. |
|
874 |
scrollBar scrollDownAction:[scrolledView scrollDown]. |
|
875 |
||
65 | 876 |
scrolledView addDependent:self. |
7 | 877 |
! ! |
878 |
||
217 | 879 |
!ScrollableView methodsFor:'queries'! |
38 | 880 |
|
217 | 881 |
preferredExtent |
572 | 882 |
"return my preferredExtent from the scrolledViews prefExtent |
883 |
plus the size of the scrollBar" |
|
884 |
||
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
885 |
preferredExtent notNil ifTrue:[ |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
886 |
^ preferredExtent |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
887 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
888 |
|
217 | 889 |
scrolledView notNil ifTrue:[ |
890 |
| pref | |
|
891 |
pref := scrolledView preferredExtent. |
|
892 |
^ (pref x + scrollBar width + (innerMargin * 2)) @ pref y. |
|
0 | 893 |
]. |
217 | 894 |
^ super preferredExtent. |
572 | 895 |
|
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
896 |
"Modified: 29.5.1996 / 12:10:52 / cg" |
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
897 |
! |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
898 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
899 |
preferredExtentForLines:numLines cols:numCols |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
900 |
"return my preferredExtent for given number of lines and cols." |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
901 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
902 |
scrolledView notNil ifTrue:[ |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
903 |
| pref | |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
904 |
pref := scrolledView preferredExtentForLines:numLines cols:numCols. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
905 |
^ (pref x + scrollBar width + (innerMargin * 2)) @ pref y. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
906 |
]. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
907 |
^ super preferredExtent. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
908 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
909 |
"Created: 24.5.1996 / 17:13:26 / cg" |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
910 |
"Modified: 24.5.1996 / 17:15:50 / cg" |
0 | 911 |
! ! |
912 |
||
913 |
!ScrollableView methodsFor:'slave-view messages'! |
|
914 |
||
217 | 915 |
doesNotUnderstand:aMessage |
916 |
"this is funny: all message we do not understand, are passed |
|
917 |
on to the scrolledView - so we do not have to care for all |
|
918 |
possible messages ...(thanks to the Message class)" |
|
919 |
||
920 |
scrolledView isNil ifFalse:[ |
|
921 |
^ scrolledView perform:(aMessage selector) |
|
922 |
withArguments:(aMessage arguments) |
|
923 |
] |
|
924 |
! |
|
925 |
||
0 | 926 |
leftButtonMenu |
38 | 927 |
"return scrolledViews leftbuttonmenu" |
928 |
||
929 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 930 |
^ scrolledView leftButtonMenu |
931 |
! |
|
932 |
||
933 |
leftButtonMenu:aMenu |
|
934 |
"pass on leftbuttonmenu to scrolledView" |
|
935 |
||
936 |
scrolledView leftButtonMenu:aMenu |
|
937 |
! |
|
938 |
||
939 |
middleButtonMenu |
|
38 | 940 |
"return scrolledViews middlebuttonmenu" |
941 |
||
942 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 943 |
^ scrolledView middleButtonMenu |
944 |
! |
|
945 |
||
946 |
middleButtonMenu:aMenu |
|
947 |
"pass on middlebuttonmenu to scrolledView" |
|
948 |
||
949 |
scrolledView middleButtonMenu:aMenu |
|
950 |
! |
|
951 |
||
562 | 952 |
model |
754 | 953 |
"return my scrolledViews model" |
954 |
||
562 | 955 |
^ scrolledView model |
956 |
||
957 |
"Created: 20.4.1996 / 13:27:25 / cg" |
|
754 | 958 |
"Modified: 5.6.1996 / 14:17:04 / cg" |
562 | 959 |
! |
960 |
||
961 |
model:aModel |
|
754 | 962 |
"forward model change to my scrolledViews" |
963 |
||
562 | 964 |
^ scrolledView model:aModel |
965 |
||
966 |
"Created: 20.4.1996 / 13:27:33 / cg" |
|
754 | 967 |
"Modified: 5.6.1996 / 17:09:50 / cg" |
562 | 968 |
! |
969 |
||
0 | 970 |
rightButtonMenu |
38 | 971 |
"return scrolledViews rightbuttonmenu" |
972 |
||
973 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 974 |
^ scrolledView rightButtonMenu |
975 |
! |
|
976 |
||
977 |
rightButtonMenu:aMenu |
|
978 |
"pass on rightbuttonmenu to scrolledView" |
|
979 |
||
980 |
scrolledView rightButtonMenu:aMenu |
|
38 | 981 |
! ! |
982 |
||
217 | 983 |
!ScrollableView class methodsFor:'documentation'! |
0 | 984 |
|
217 | 985 |
version |
754 | 986 |
^ '$Header: /cvs/stx/stx/libwidg/Attic/ScrView.st,v 1.36 1996-06-05 15:09:57 cg Exp $' |
0 | 987 |
! ! |