author | Claus Gittinger <cg@exept.de> |
Fri, 24 May 1996 20:13:23 +0200 | |
changeset 678 | c1967a46b2c1 |
parent 608 | aedd7bf72edc |
child 703 | 8889152157c9 |
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:[ |
|
300 | 373 |
dev := aView device |
374 |
] ifFalse:[ |
|
375 |
dev := Screen current |
|
376 |
]. |
|
377 |
newView := self basicNew device:dev. |
|
378 |
newView initializeFor:aViewClass miniScrollerH:miniH miniScrollerV:miniV. |
|
379 |
aView notNil ifTrue:[ |
|
217 | 380 |
aView addSubView:newView |
153 | 381 |
]. |
217 | 382 |
^ newView |
383 |
! |
|
384 |
||
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
385 |
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
|
386 |
"return a new scrolling view scrolling an instance of aViewClass. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
387 |
The subview is created here. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
388 |
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
|
389 |
is false, miniscrollers if true." |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
390 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
391 |
|newView| |
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 := self for:aViewClass miniScrollerH:miniH miniScrollerV:miniV in:aView. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
394 |
newView origin:org corner:corn. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
395 |
^ newView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
396 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
397 |
"Created: 18.4.1996 / 11:41:05 / cg" |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
398 |
"Modified: 18.4.1996 / 14:27:39 / cg" |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
399 |
! |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
400 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
401 |
for:aViewClass miniScrollerH:miniH origin:org corner:corn in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
402 |
"return a new scrolling view scrolling an instance of aViewClass. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
403 |
The subview is created here. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
404 |
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
|
405 |
a miniscroller if true." |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
406 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
407 |
^ 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
|
408 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
409 |
"Modified: 18.4.1996 / 14:32:07 / cg" |
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 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
412 |
for:aViewClass miniScrollerV:miniV origin:org corner:corn in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
413 |
"return a new scrolling view scrolling an instance of aViewClass. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
414 |
The subview is created here. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
415 |
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
|
416 |
a miniscroller if true." |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
417 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
418 |
^ 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
|
419 |
|
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
420 |
"Created: 18.4.1996 / 14:30:57 / cg" |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
421 |
"Modified: 18.4.1996 / 14:32:21 / cg" |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
422 |
! |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
423 |
|
492 | 424 |
for:aViewClass origin:org corner:corner in:aView |
425 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
426 |
The subview is created here. |
|
427 |
The view will have full scrollbars." |
|
428 |
||
429 |
|v| |
|
430 |
||
431 |
v := self for:aViewClass miniScrollerH:false miniScrollerV:false in:aView. |
|
432 |
v origin:org corner:corner. |
|
433 |
^ v |
|
434 |
||
435 |
"Created: 7.3.1996 / 13:01:08 / cg" |
|
436 |
! |
|
437 |
||
217 | 438 |
forView:aView |
439 |
"return a new scrolling view scrolling aView. |
|
440 |
The view will have full scrollbars." |
|
441 |
||
442 |
^ self forView:aView miniScrollerH:false miniScrollerV:false in:nil |
|
443 |
! |
|
444 |
||
248 | 445 |
forView:aView miniScrollerH:mini |
446 |
"return a new scrolling view scrolling aView. |
|
447 |
The view will have a full vertical scrollbar and a horizontal |
|
448 |
miniScroller if mini is true." |
|
449 |
||
450 |
^ self forView:aView miniScrollerH:mini miniScrollerV:false in:nil |
|
451 |
||
452 |
"Created: 10.12.1995 / 17:26:16 / cg" |
|
453 |
! |
|
454 |
||
217 | 455 |
forView:scrolledView miniScrollerH:miniH miniScrollerV:miniV in:aView |
456 |
"return a new scrolling view, scrolling aView. |
|
457 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
458 |
is false, miniscrollers if true." |
|
153 | 459 |
|
217 | 460 |
|newView| |
461 |
||
462 |
newView := self for:nil miniScrollerH:miniH miniScrollerV:miniV in:aView. |
|
463 |
newView scrolledView:scrolledView. |
|
464 |
^ newView |
|
465 |
! |
|
153 | 466 |
|
217 | 467 |
in:aView |
468 |
"return a new scrolling view to be contained in aView. |
|
469 |
There is no slave view now - this has to be set later via |
|
470 |
the scrolledView: method. |
|
471 |
The view will have full scrollbars." |
|
472 |
||
473 |
^ self for:nil miniScrollerH:false miniScrollerV:false in:aView |
|
474 |
! |
|
0 | 475 |
|
93 | 476 |
miniScroller:mini |
477 |
"return a new scrolling view. The subview will be created later. |
|
478 |
The view will have full scrollbars if mini is false, |
|
479 |
miniscrollers if true." |
|
480 |
||
481 |
^ self for:nil miniScrollerH:mini miniScrollerV:mini |
|
482 |
! |
|
483 |
||
113 | 484 |
miniScrollerH:miniH |
485 |
"return a new scrolling view. The subview will be created later. |
|
486 |
The view will have full scrollbars if miniH is false, |
|
487 |
and a horizontal miniscroller if true." |
|
488 |
||
489 |
^ self for:nil miniScrollerH:miniH miniScrollerV:false in:nil |
|
490 |
! |
|
491 |
||
93 | 492 |
miniScrollerH:miniH miniScrollerV:miniV |
493 |
"return a new scrolling view. The subview will be created later. |
|
494 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
113 | 495 |
is false, miniscrollers if true." |
93 | 496 |
|
497 |
^ self for:nil miniScrollerH:miniH miniScrollerV:miniV in:nil |
|
217 | 498 |
! ! |
93 | 499 |
|
217 | 500 |
!ScrollableView class methodsFor:'defaults'! |
501 |
||
502 |
updateStyleCache |
|
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
503 |
"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
|
504 |
|
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
505 |
<resource: #style (#scrolledViewLevel)> |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
506 |
|
217 | 507 |
|d| |
38 | 508 |
|
217 | 509 |
StyleSheet name == #st80 ifTrue:[ |
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
510 |
d := 1 |
217 | 511 |
] ifFalse:[ |
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
512 |
StyleSheet is3D ifTrue:[ |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
513 |
d := -1 |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
514 |
] ifFalse:[ |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
515 |
d := 0 |
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
516 |
] |
217 | 517 |
]. |
518 |
DefaultScrolledViewLevel := StyleSheet at:'scrolledViewLevel' default:d. |
|
0 | 519 |
|
217 | 520 |
"Modified: 31.8.1995 / 04:05:55 / claus" |
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
521 |
"Modified: 1.3.1996 / 13:46:39 / cg" |
217 | 522 |
! ! |
523 |
||
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
524 |
!ScrollableView methodsFor:'accessing - components'! |
119 | 525 |
|
217 | 526 |
scrollBar |
527 |
"return the scrollbar" |
|
528 |
||
529 |
^ scrollBar |
|
119 | 530 |
! |
531 |
||
217 | 532 |
scrolledView |
533 |
"return the scrolled view" |
|
38 | 534 |
|
217 | 535 |
^ scrolledView |
113 | 536 |
! |
537 |
||
217 | 538 |
scrolledView:aView |
539 |
"set the view to scroll" |
|
540 |
||
541 |
|halfMargin twoMargins isOpenwin| |
|
542 |
||
543 |
scrolledView notNil ifTrue:[ |
|
544 |
scrolledView destroy. |
|
545 |
scrolledView := nil. |
|
546 |
]. |
|
547 |
scrolledView := aView. |
|
77 | 548 |
|
217 | 549 |
"/ ((style ~~ #normal) and:[style ~~ #mswindows]) ifTrue:[ |
550 |
styleSheet is3D ifTrue:[ |
|
551 |
"3D look" |
|
552 |
||
553 |
isOpenwin := styleSheet name = #openwin. |
|
554 |
||
555 |
twoMargins := innerMargin * 2. |
|
556 |
halfMargin := innerMargin // 2. |
|
557 |
||
558 |
isOpenwin ifTrue:[ |
|
559 |
scrolledView level:0. |
|
560 |
scrolledView borderWidth:1 |
|
561 |
] ifFalse:[ |
|
562 |
scrolledView level:DefaultScrolledViewLevel. |
|
563 |
"/ scrolledView level:-1 |
|
564 |
]. |
|
77 | 565 |
|
217 | 566 |
(scrollBarPosition == #right) ifTrue:[ |
567 |
scrolledView |
|
568 |
origin:halfMargin asPoint |
|
569 |
extent:[(width - |
|
570 |
scrollBar width - |
|
571 |
twoMargins) |
|
572 |
@ |
|
573 |
(height - innerMargin) |
|
574 |
]. |
|
575 |
] ifFalse:[ |
|
576 |
scrolledView |
|
577 |
origin:((scrollBar origin x |
|
578 |
+ scrollBar width |
|
579 |
+ innerMargin) |
|
580 |
@ |
|
581 |
halfMargin) |
|
582 |
extent:[(width |
|
583 |
- scrollBar width |
|
584 |
- twoMargins) |
|
585 |
@ |
|
586 |
(height - innerMargin) |
|
587 |
]. |
|
588 |
] |
|
589 |
] ifFalse:[ |
|
590 |
"non 3D look" |
|
591 |
(scrollBarPosition == #right) ifTrue:[ |
|
592 |
scrolledView |
|
593 |
origin:scrolledView borderWidth negated asPoint |
|
594 |
] ifFalse:[ |
|
595 |
scrolledView |
|
596 |
origin:((scrollBar width |
|
597 |
+ scrollBar borderWidth |
|
598 |
- scrolledView borderWidth) |
|
599 |
@ |
|
600 |
scrolledView borderWidth negated) |
|
601 |
]. |
|
602 |
scrolledView |
|
603 |
extent:[ |
|
604 |
(width |
|
605 |
- scrollBar width |
|
606 |
- scrolledView borderWidth) |
|
607 |
@ |
|
608 |
(height + (scrollBar borderWidth)) |
|
609 |
] |
|
610 |
]. |
|
132 | 611 |
|
217 | 612 |
super addSubView:scrolledView. |
613 |
self setScrollActions. |
|
614 |
||
615 |
" |
|
616 |
pass my keyboard input (and other subviews input) |
|
617 |
to the scrolled view ... |
|
618 |
" |
|
619 |
self delegate:(KeyboardForwarder toView:scrolledView). |
|
620 |
||
621 |
realized ifTrue:[ |
|
622 |
self sizeChanged:nil. |
|
623 |
scrolledView realize |
|
624 |
]. |
|
625 |
! ! |
|
626 |
||
627 |
!ScrollableView methodsFor:'changes '! |
|
628 |
||
629 |
update:something with:argument from:changedObject |
|
630 |
"whenever the scrolledView changes its contents, the scroller must |
|
631 |
be updated" |
|
132 | 632 |
|
217 | 633 |
changedObject == scrolledView ifTrue:[ |
634 |
something == #sizeOfContents ifTrue:[ |
|
635 |
scrollBar setThumbFor:scrolledView. |
|
636 |
^ self |
|
637 |
]. |
|
638 |
something == #originOfContents ifTrue:[ |
|
639 |
lockUpdates ifFalse:[ |
|
640 |
scrollBar setThumbOriginFor:scrolledView. |
|
641 |
]. |
|
642 |
^ self |
|
643 |
]. |
|
644 |
]. |
|
645 |
! ! |
|
38 | 646 |
|
217 | 647 |
!ScrollableView methodsFor:'event processing'! |
648 |
||
649 |
keyPress:key x:x y:y |
|
650 |
"a key was pressed - handle page-keys here" |
|
651 |
||
652 |
<resource: #keyboard ( #Prior #Next ) > |
|
653 |
||
654 |
(key == #Prior) ifTrue: [^ self pageUp]. |
|
655 |
(key == #Next) ifTrue: [^ self pageDown]. |
|
656 |
||
657 |
super keyPress:key x:x y:y |
|
38 | 658 |
! |
659 |
||
217 | 660 |
sizeChanged:how |
661 |
super sizeChanged:how. |
|
662 |
scrolledView notNil ifTrue:[ |
|
663 |
scrollBar setThumbFor:scrolledView |
|
664 |
]. |
|
665 |
scrollBar thumbOrigin + scrollBar thumbHeight >= 100 ifTrue:[ |
|
666 |
scrollBar thumbOrigin:(100 - scrollBar thumbHeight). |
|
667 |
scrolledView scrollVerticalToPercent:scrollBar thumbOrigin. |
|
668 |
]. |
|
113 | 669 |
|
217 | 670 |
"Modified: 8.9.1995 / 12:46:36 / claus" |
671 |
! ! |
|
672 |
||
673 |
!ScrollableView methodsFor:'forced scroll'! |
|
674 |
||
675 |
pageDown |
|
676 |
"page down" |
|
677 |
||
678 |
scrollBar pageDown |
|
113 | 679 |
! |
680 |
||
217 | 681 |
pageUp |
682 |
"page up" |
|
0 | 683 |
|
217 | 684 |
scrollBar pageUp |
0 | 685 |
! ! |
686 |
||
687 |
!ScrollableView methodsFor:'initialization'! |
|
688 |
||
217 | 689 |
initStyle |
608 | 690 |
<resource: #style (#scrollBarPosition)> |
691 |
||
217 | 692 |
super initStyle. |
693 |
||
694 |
scrollBarPosition := styleSheet at:'scrollBarPosition' default:#left |
|
608 | 695 |
|
696 |
"Modified: 30.4.1996 / 17:01:53 / cg" |
|
217 | 697 |
! |
698 |
||
0 | 699 |
initialize |
38 | 700 |
"default setup: full scrollers" |
701 |
||
702 |
^ self initializeFor:nil miniScrollerH:false miniScrollerV:false |
|
0 | 703 |
! |
704 |
||
38 | 705 |
initializeFor:aViewClass miniScrollerH:miniH miniScrollerV:miniV |
130 | 706 |
|negativeOffset twoMargins halfMargin cls isST80 isOpenWin is3D lvl extra| |
0 | 707 |
|
708 |
super initialize. |
|
709 |
||
65 | 710 |
lockUpdates := false. |
711 |
||
110 | 712 |
" |
713 |
mhmh - these must go into the stylesheet as well... |
|
714 |
" |
|
130 | 715 |
isST80 := styleSheet name = #st80. |
716 |
isOpenWin := styleSheet name = #openwin. |
|
59 | 717 |
|
110 | 718 |
isOpenWin ifTrue:[self level:0]. |
130 | 719 |
is3D := styleSheet is3D. |
59 | 720 |
|
721 |
isST80 ifTrue:[ |
|
722 |
innerMargin := 0 |
|
38 | 723 |
] ifFalse:[ |
59 | 724 |
is3D ifTrue:[ |
725 |
innerMargin := ViewSpacing. |
|
726 |
] ifFalse:[ |
|
727 |
innerMargin := 0 |
|
728 |
] |
|
38 | 729 |
]. |
0 | 730 |
negativeOffset := borderWidth negated. |
731 |
||
732 |
"create the scrollbar" |
|
733 |
||
59 | 734 |
isST80 ifTrue:[ |
735 |
cls := ScrollBar |
|
736 |
] ifFalse:[ |
|
737 |
cls := miniV ifTrue:[MiniScroller] ifFalse:[ScrollBar]. |
|
738 |
]. |
|
38 | 739 |
|
740 |
scrollBar := cls in:self. |
|
0 | 741 |
scrollBar thumbOrigin:0 thumbHeight:100. |
742 |
||
130 | 743 |
extra := 0. |
744 |
||
0 | 745 |
"create the subview" |
59 | 746 |
is3D ifTrue:[ |
747 |
twoMargins := innerMargin * 2. |
|
748 |
halfMargin := innerMargin // 2. |
|
0 | 749 |
|
59 | 750 |
aViewClass notNil ifTrue:[ |
751 |
scrolledView := aViewClass in:self. |
|
110 | 752 |
isOpenWin ifTrue:[ |
130 | 753 |
lvl := 0. |
754 |
"/ scrolledView level:0. |
|
755 |
scrolledView borderWidth:1. |
|
59 | 756 |
] ifFalse:[ |
153 | 757 |
lvl := DefaultScrolledViewLevel. |
758 |
"/ isST80 ifTrue:[ |
|
759 |
"/ "/ scrolledView level:1. |
|
760 |
"/ lvl := 1. |
|
761 |
"/ ] ifFalse:[ |
|
762 |
"/ "/ scrolledView level:-1 |
|
763 |
"/ lvl := -1 |
|
764 |
"/ ] |
|
59 | 765 |
]. |
130 | 766 |
scrolledView level:lvl. |
767 |
extra := scrolledView borderWidth * 2. |
|
59 | 768 |
]. |
130 | 769 |
|
770 |
scrollBar extent:[scrollBar extent x |
|
771 |
@ |
|
772 |
(height - innerMargin "new:" + extra)]. |
|
773 |
scrolledView notNil ifTrue:[ |
|
774 |
scrolledView |
|
775 |
extent:[(width |
|
776 |
- scrollBar width |
|
777 |
- twoMargins) |
|
778 |
@ |
|
779 |
(height - innerMargin)]. |
|
780 |
]. |
|
781 |
||
59 | 782 |
(scrollBarPosition == #right) ifTrue:[ |
783 |
scrollBar origin:[width - scrollBar extent x |
|
784 |
- (scrollBar borderWidth * 2) |
|
785 |
- halfMargin |
|
786 |
@ |
|
130 | 787 |
halfMargin]. |
38 | 788 |
|
59 | 789 |
scrolledView notNil ifTrue:[ |
790 |
scrolledView origin:halfMargin asPoint |
|
791 |
] |
|
792 |
] ifFalse:[ |
|
130 | 793 |
scrollBar origin:halfMargin asPoint. |
38 | 794 |
|
59 | 795 |
scrolledView notNil ifTrue:[ |
796 |
scrolledView origin:((scrollBar origin x + scrollBar width + innerMargin) |
|
797 |
@ |
|
798 |
halfMargin) |
|
799 |
] |
|
800 |
]. |
|
0 | 801 |
] ifFalse:[ |
59 | 802 |
(scrollBarPosition == #right) ifTrue:[ |
803 |
scrollBar origin:[width - scrollBar extent x |
|
804 |
- scrollBar borderWidth |
|
805 |
@ |
|
806 |
negativeOffset] |
|
807 |
] ifFalse:[ |
|
808 |
scrollBar origin:negativeOffset asPoint |
|
809 |
]. |
|
130 | 810 |
scrollBar extent:[scrollBar extent x |
811 |
@ |
|
812 |
(height "+ (scrollBar borderWidth * 1)")]. |
|
0 | 813 |
|
59 | 814 |
aViewClass notNil ifTrue:[ |
815 |
scrolledView := aViewClass in:self. |
|
816 |
(scrollBarPosition == #right) ifTrue:[ |
|
817 |
scrolledView origin:scrolledView borderWidth negated asPoint |
|
818 |
] ifFalse:[ |
|
819 |
scrolledView origin:((scrollBar width + |
|
820 |
scrollBar borderWidth - |
|
821 |
scrolledView borderWidth) |
|
822 |
@ |
|
823 |
scrolledView borderWidth negated) |
|
824 |
]. |
|
825 |
scrolledView extent:[(width - scrollBar width - scrolledView borderWidth) |
|
826 |
@ |
|
827 |
(height + (scrollBar borderWidth)) |
|
828 |
] |
|
829 |
]. |
|
0 | 830 |
]. |
831 |
scrolledView notNil ifTrue:[ |
|
59 | 832 |
self setScrollActions. |
833 |
" |
|
113 | 834 |
pass my keyboard input (and other subviews input) |
835 |
to the scrolled view ... |
|
59 | 836 |
" |
122 | 837 |
self delegate:(KeyboardForwarder toView:scrolledView). |
0 | 838 |
] |
839 |
! |
|
840 |
||
841 |
realize |
|
842 |
super realize. |
|
38 | 843 |
|
0 | 844 |
"since scrolledview may have done something to its contents |
845 |
during init-time we had no chance yet to catch contents- |
|
846 |
changes; do it now |
|
847 |
" |
|
38 | 848 |
scrolledView notNil ifTrue:[ |
59 | 849 |
scrollBar setThumbFor:scrolledView |
38 | 850 |
] |
0 | 851 |
! ! |
852 |
||
7 | 853 |
!ScrollableView methodsFor:'private'! |
854 |
||
855 |
setScrollActions |
|
856 |
"lock prevents repositioning the scroller to the |
|
857 |
actual (often rounded) position while scrolling, |
|
858 |
and keeps it instead at the pointer position. |
|
859 |
||
860 |
(this avoids run-away scroller when scrolling |
|
861 |
textviews, when the text is aligned line-wise). |
|
38 | 862 |
Consider this as a kludge." |
7 | 863 |
|
65 | 864 |
lockUpdates := false. |
7 | 865 |
|
866 |
scrollBar scrollAction:[:position | |
|
65 | 867 |
lockUpdates := true. |
59 | 868 |
scrolledView scrollVerticalToPercent:position. |
65 | 869 |
lockUpdates := false |
7 | 870 |
]. |
871 |
scrollBar scrollUpAction:[scrolledView scrollUp]. |
|
872 |
scrollBar scrollDownAction:[scrolledView scrollDown]. |
|
873 |
||
65 | 874 |
scrolledView addDependent:self. |
7 | 875 |
! ! |
876 |
||
217 | 877 |
!ScrollableView methodsFor:'queries'! |
38 | 878 |
|
217 | 879 |
preferredExtent |
572 | 880 |
"return my preferredExtent from the scrolledViews prefExtent |
881 |
plus the size of the scrollBar" |
|
882 |
||
217 | 883 |
scrolledView notNil ifTrue:[ |
884 |
| pref | |
|
885 |
pref := scrolledView preferredExtent. |
|
886 |
^ (pref x + scrollBar width + (innerMargin * 2)) @ pref y. |
|
0 | 887 |
]. |
217 | 888 |
^ super preferredExtent. |
572 | 889 |
|
890 |
"Modified: 23.4.1996 / 00:17:53 / cg" |
|
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
891 |
! |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
892 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
893 |
preferredExtentForLines:numLines cols:numCols |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
894 |
"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
|
895 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
896 |
scrolledView notNil ifTrue:[ |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
897 |
| pref | |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
898 |
pref := scrolledView preferredExtentForLines:numLines cols:numCols. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
899 |
^ (pref x + scrollBar width + (innerMargin * 2)) @ pref y. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
900 |
]. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
901 |
^ super preferredExtent. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
902 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
903 |
"Created: 24.5.1996 / 17:13:26 / cg" |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
904 |
"Modified: 24.5.1996 / 17:15:50 / cg" |
0 | 905 |
! ! |
906 |
||
907 |
!ScrollableView methodsFor:'slave-view messages'! |
|
908 |
||
217 | 909 |
doesNotUnderstand:aMessage |
910 |
"this is funny: all message we do not understand, are passed |
|
911 |
on to the scrolledView - so we do not have to care for all |
|
912 |
possible messages ...(thanks to the Message class)" |
|
913 |
||
914 |
scrolledView isNil ifFalse:[ |
|
915 |
^ scrolledView perform:(aMessage selector) |
|
916 |
withArguments:(aMessage arguments) |
|
917 |
] |
|
918 |
! |
|
919 |
||
0 | 920 |
leftButtonMenu |
38 | 921 |
"return scrolledViews leftbuttonmenu" |
922 |
||
923 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 924 |
^ scrolledView leftButtonMenu |
925 |
! |
|
926 |
||
927 |
leftButtonMenu:aMenu |
|
928 |
"pass on leftbuttonmenu to scrolledView" |
|
929 |
||
930 |
scrolledView leftButtonMenu:aMenu |
|
931 |
! |
|
932 |
||
933 |
middleButtonMenu |
|
38 | 934 |
"return scrolledViews middlebuttonmenu" |
935 |
||
936 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 937 |
^ scrolledView middleButtonMenu |
938 |
! |
|
939 |
||
940 |
middleButtonMenu:aMenu |
|
941 |
"pass on middlebuttonmenu to scrolledView" |
|
942 |
||
943 |
scrolledView middleButtonMenu:aMenu |
|
944 |
! |
|
945 |
||
562 | 946 |
model |
947 |
^ scrolledView model |
|
948 |
||
949 |
"Created: 20.4.1996 / 13:27:25 / cg" |
|
950 |
! |
|
951 |
||
952 |
model:aModel |
|
953 |
^ scrolledView model:aModel |
|
954 |
||
955 |
"Created: 20.4.1996 / 13:27:33 / cg" |
|
956 |
! |
|
957 |
||
0 | 958 |
rightButtonMenu |
38 | 959 |
"return scrolledViews rightbuttonmenu" |
960 |
||
961 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 962 |
^ scrolledView rightButtonMenu |
963 |
! |
|
964 |
||
965 |
rightButtonMenu:aMenu |
|
966 |
"pass on rightbuttonmenu to scrolledView" |
|
967 |
||
968 |
scrolledView rightButtonMenu:aMenu |
|
38 | 969 |
! ! |
970 |
||
217 | 971 |
!ScrollableView class methodsFor:'documentation'! |
0 | 972 |
|
217 | 973 |
version |
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
974 |
^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.33 1996-05-24 18:12:54 cg Exp $' |
0 | 975 |
! ! |