author | Claus Gittinger <cg@exept.de> |
Thu, 16 Jan 1997 19:07:13 +0100 | |
changeset 951 | f913fa110081 |
parent 845 | ab868eb2c7cd |
child 1074 | 37e748d3328d |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1991 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 |
||
13 |
ScrollableView subclass:#HVScrollableView |
|
572 | 14 |
instanceVariableNames:'hScrollBar' |
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'Views-Basic' |
|
0 | 18 |
! |
19 |
||
845 | 20 |
!HVScrollableView class methodsFor:'documentation'! |
63 | 21 |
|
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1991 by Claus Gittinger |
|
25 |
All Rights Reserved |
|
26 |
||
27 |
This software is furnished under a license and may be used |
|
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
38 | 36 |
documentation |
37 |
" |
|
38 |
a view containing both horizontal and vertical scrollbars |
|
130 | 39 |
and some other (slave-)view. |
40 |
||
41 |
Please see the documentation and examples in my superclass, ScrollableView |
|
584 | 42 |
|
43 |
[author:] |
|
44 |
Claus Gittinger |
|
38 | 45 |
" |
845 | 46 |
! |
47 |
||
48 |
examples |
|
49 |
" |
|
50 |
See more examples in ScrollableView - all of those work |
|
51 |
also by replacing ScrollableView with HVScrollableView. |
|
52 |
||
53 |
||
54 |
example (simple scrolled text): |
|
55 |
[exBegin] |
|
56 |
|top scr txt| |
|
57 |
||
58 |
top := StandardSystemView label:'scroll example'. |
|
59 |
top extent:200@100. |
|
60 |
||
61 |
scr := HVScrollableView for:EditTextView in:top. |
|
62 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
63 |
txt := scr scrolledView. |
|
64 |
||
65 |
txt list:#('line1' |
|
66 |
'a long line which may require scrolling.' |
|
67 |
'line3' |
|
68 |
'line4' |
|
69 |
'line5' |
|
70 |
'line7' |
|
71 |
'line8' |
|
72 |
'line9' |
|
73 |
'line10' |
|
74 |
). |
|
75 |
top open |
|
76 |
[exEnd] |
|
77 |
example (horizontal miniScroller): |
|
78 |
[exBegin] |
|
79 |
|top scr txt| |
|
80 |
||
81 |
top := StandardSystemView label:'scroll example'. |
|
82 |
top extent:200@100. |
|
83 |
||
84 |
scr := HVScrollableView |
|
85 |
for:EditTextView |
|
86 |
miniScrollerH:true |
|
87 |
miniScrollerV:false |
|
88 |
in:top. |
|
89 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
90 |
txt := scr scrolledView. |
|
91 |
||
92 |
txt list:#('line1' |
|
93 |
'a long line which may require scrolling.' |
|
94 |
'line3' |
|
95 |
'line4' |
|
96 |
'line5' |
|
97 |
'line7' |
|
98 |
'line8' |
|
99 |
'line9' |
|
100 |
'line10' |
|
101 |
). |
|
102 |
top open |
|
103 |
[exEnd] |
|
104 |
||
105 |
example (vertical miniScroller): |
|
106 |
[exBegin] |
|
107 |
|top scr txt| |
|
108 |
||
109 |
top := StandardSystemView label:'scroll example'. |
|
110 |
top extent:200@100. |
|
111 |
||
112 |
scr := HVScrollableView |
|
113 |
for:EditTextView |
|
114 |
miniScrollerH:false |
|
115 |
miniScrollerV:true |
|
116 |
in:top. |
|
117 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
118 |
txt := scr scrolledView. |
|
119 |
||
120 |
txt list:#('line1' |
|
121 |
'a long line which may require scrolling.' |
|
122 |
'line3' |
|
123 |
'line4' |
|
124 |
'line5' |
|
125 |
'line7' |
|
126 |
'line8' |
|
127 |
'line9' |
|
128 |
'line10' |
|
129 |
). |
|
130 |
top open |
|
131 |
[exEnd] |
|
132 |
||
133 |
example (both scrollers are miniScroller): |
|
134 |
[exBegin] |
|
135 |
|top scr txt| |
|
136 |
||
137 |
top := StandardSystemView label:'scroll example'. |
|
138 |
top extent:200@100. |
|
139 |
||
140 |
scr := HVScrollableView |
|
141 |
for:EditTextView |
|
142 |
miniScrollerH:true |
|
143 |
miniScrollerV:true |
|
144 |
in:top. |
|
145 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
146 |
txt := scr scrolledView. |
|
147 |
||
148 |
txt list:#('line1' |
|
149 |
'a long line which may require scrolling.' |
|
150 |
'line3' |
|
151 |
'line4' |
|
152 |
'line5' |
|
153 |
'line7' |
|
154 |
'line8' |
|
155 |
'line9' |
|
156 |
'line10' |
|
157 |
). |
|
158 |
top open |
|
159 |
[exEnd] |
|
160 |
" |
|
161 |
||
38 | 162 |
! ! |
163 |
||
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
164 |
!HVScrollableView methodsFor:'accessing - components'! |
216 | 165 |
|
166 |
horizontalScrollBar |
|
167 |
"return the horizontal scrollbar" |
|
168 |
||
169 |
^ hScrollBar |
|
170 |
! |
|
171 |
||
172 |
scrolledView:aView |
|
173 |
"set the scrolled view" |
|
174 |
||
175 |
super scrolledView:aView. |
|
176 |
||
177 |
"redefine subviews size" |
|
178 |
styleSheet is3D ifTrue:[ |
|
814 | 179 |
scrolledView |
180 |
extent:[(width |
|
181 |
- scrollBar width |
|
182 |
- (innerMargin * 2)) |
|
183 |
@ |
|
184 |
(height |
|
185 |
- hScrollBar height |
|
186 |
- (innerMargin * 2)) |
|
187 |
] |
|
216 | 188 |
] ifFalse:[ |
814 | 189 |
scrolledView |
190 |
extent:[(width |
|
191 |
- scrollBar width |
|
192 |
- scrollBar borderWidth |
|
193 |
"- scrolledView borderWidth") |
|
194 |
@ |
|
195 |
(height |
|
196 |
- hScrollBar height |
|
197 |
- hScrollBar borderWidth |
|
198 |
"- scrolledView borderWidth") |
|
199 |
] |
|
216 | 200 |
]. |
814 | 201 |
self setScrollActions. |
202 |
||
203 |
"Modified: 1.8.1996 / 12:44:37 / cg" |
|
216 | 204 |
! ! |
205 |
||
206 |
!HVScrollableView methodsFor:'changes '! |
|
207 |
||
208 |
update:something with:argument from:changedObject |
|
209 |
"whenever the scrolledview changes its contents, we have to |
|
210 |
update the scrollers too" |
|
211 |
||
212 |
changedObject == scrolledView ifTrue:[ |
|
213 |
something == #sizeOfContents ifTrue:[ |
|
214 |
scrollBar setThumbFor:scrolledView. |
|
215 |
hScrollBar setThumbFor:scrolledView. |
|
216 |
^ self |
|
217 |
]. |
|
218 |
something == #originOfContents ifTrue:[ |
|
219 |
lockUpdates ifFalse:[ |
|
220 |
scrollBar setThumbOriginFor:scrolledView. |
|
221 |
hScrollBar setThumbOriginFor:scrolledView. |
|
222 |
]. |
|
223 |
^ self |
|
224 |
]. |
|
225 |
]. |
|
226 |
! ! |
|
227 |
||
228 |
!HVScrollableView methodsFor:'event processing'! |
|
229 |
||
230 |
sizeChanged:how |
|
818
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
231 |
|orgY orgX scroll| |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
232 |
|
216 | 233 |
super sizeChanged:how. |
234 |
scrolledView notNil ifTrue:[ |
|
818
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
235 |
scrollBar setThumbFor:scrolledView. |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
236 |
hScrollBar setThumbFor:scrolledView. |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
237 |
|
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
238 |
orgY := scrollBar thumbOrigin. |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
239 |
orgX := hScrollBar thumbOrigin. |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
240 |
scroll := false. |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
241 |
|
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
242 |
orgY + scrollBar thumbHeight >= 100 ifTrue:[ |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
243 |
scrollBar thumbOrigin:(100 - scrollBar thumbHeight). |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
244 |
orgY := scrollBar thumbOrigin. |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
245 |
scroll := true. |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
246 |
]. |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
247 |
orgX + hScrollBar thumbHeight >= 100 ifTrue:[ |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
248 |
hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight). |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
249 |
orgX := hScrollBar thumbOrigin. |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
250 |
scroll := true. |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
251 |
]. |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
252 |
scroll ifTrue:[ |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
253 |
scrolledView scrollToPercent:(orgX@orgY). |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
254 |
]. |
216 | 255 |
]. |
256 |
||
257 |
"Modified: 8.9.1995 / 12:46:36 / claus" |
|
818
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
258 |
"Modified: 5.8.1996 / 12:18:52 / stefan" |
216 | 259 |
! ! |
260 |
||
0 | 261 |
!HVScrollableView methodsFor:'initialization'! |
262 |
||
38 | 263 |
initializeFor:aViewClass miniScrollerH:miniH miniScrollerV:miniV |
130 | 264 |
|negativeOffset halfMargin orgX mrg halfSpacing |
265 |
is3D cls hBorderWidth isST80 isOpenWin extra| |
|
59 | 266 |
|
267 |
isST80 := StyleSheet name = #st80. "leftover - remove it" |
|
38 | 268 |
|
59 | 269 |
isST80 ifTrue:[ |
814 | 270 |
cls := HorizontalScrollBar |
59 | 271 |
] ifFalse:[ |
814 | 272 |
cls := miniH ifTrue:[HorizontalMiniScroller] ifFalse:[HorizontalScrollBar]. |
59 | 273 |
]. |
38 | 274 |
|
275 |
hScrollBar := cls in:self. |
|
0 | 276 |
|
38 | 277 |
super |
814 | 278 |
initializeFor:aViewClass |
279 |
miniScrollerH:miniH |
|
280 |
miniScrollerV:miniV. |
|
0 | 281 |
|
282 |
negativeOffset := borderWidth negated. |
|
283 |
halfMargin := innerMargin // 2. |
|
130 | 284 |
is3D := styleSheet is3D. |
285 |
isOpenWin := styleSheet name = #openwin. |
|
0 | 286 |
|
38 | 287 |
" |
288 |
change vertical scrollbars size |
|
289 |
" |
|
59 | 290 |
mrg := hScrollBar borderWidth. |
291 |
mrg isNil ifTrue:[mrg := 0]. |
|
292 |
hBorderWidth := mrg. |
|
293 |
||
38 | 294 |
is3D ifTrue:[ |
814 | 295 |
isST80 ifTrue:[ |
296 |
halfSpacing := 0 |
|
297 |
] ifFalse:[ |
|
298 |
mrg := mrg + innerMargin + innerMargin. |
|
299 |
halfSpacing := ViewSpacing // 2. |
|
300 |
]. |
|
0 | 301 |
]. |
130 | 302 |
|
303 |
extra := 0. |
|
304 |
isOpenWin ifTrue:[ |
|
814 | 305 |
extra := 2. |
130 | 306 |
]. |
307 |
||
308 |
scrollBar extent:[scrollBar width |
|
814 | 309 |
@ |
310 |
(height - hScrollBar height - mrg + extra)]. |
|
0 | 311 |
|
312 |
hScrollBar thumbOrigin:0 thumbHeight:100. |
|
38 | 313 |
|
314 |
scrollBarPosition == #left ifTrue:[ |
|
814 | 315 |
orgX := scrollBar origin x + scrollBar width. |
316 |
is3D ifTrue:[ |
|
317 |
orgX := orgX + halfSpacing + 1. |
|
951 | 318 |
scrolledView notNil ifTrue:[ |
319 |
isST80 ifTrue:[ |
|
320 |
orgX := orgX - (scrolledView margin) |
|
321 |
] |
|
814 | 322 |
] |
323 |
] |
|
0 | 324 |
] ifFalse:[ |
814 | 325 |
orgX := 0 - hBorderWidth. |
130 | 326 |
"/ isST80 ifTrue:[ |
59 | 327 |
"/ orgX := orgX + 1 |
130 | 328 |
"/ ] |
329 |
]. |
|
330 |
isOpenWin ifTrue:[ |
|
814 | 331 |
orgX := orgX + 1 |
59 | 332 |
]. |
333 |
||
334 |
is3D ifTrue:[ |
|
814 | 335 |
hScrollBar origin:[(orgX + innerMargin - halfSpacing - hScrollBar margin) |
336 |
@ |
|
337 |
(height - hScrollBar height - halfMargin) |
|
338 |
] |
|
339 |
extent:[(width - scrollBar width - (innerMargin * 2) + extra) |
|
340 |
@ |
|
341 |
hScrollBar height |
|
342 |
] |
|
59 | 343 |
] ifFalse:[ |
814 | 344 |
scrollBarPosition == #left ifTrue:[ |
345 |
hScrollBar |
|
346 |
origin:[(orgX + scrollBar borderWidth) |
|
347 |
@ |
|
348 |
(height - hScrollBar height - hBorderWidth) |
|
349 |
] |
|
350 |
extent:[(width - scrollBar width) @ hScrollBar height] |
|
351 |
] ifFalse:[ |
|
352 |
hScrollBar |
|
353 |
origin:[orgX @ (height - hScrollBar height - hBorderWidth) ] |
|
354 |
extent:[(width - scrollBar width - hBorderWidth) @ hScrollBar height] |
|
355 |
] |
|
0 | 356 |
]. |
357 |
||
38 | 358 |
scrolledView notNil ifTrue:[ |
814 | 359 |
"redefine subviews size" |
360 |
is3D ifTrue:[ |
|
361 |
scrolledView |
|
362 |
extent:[(width - scrollBar width - (innerMargin * 2)) |
|
363 |
@ |
|
364 |
(height - hScrollBar height - (innerMargin * 2)) ] |
|
365 |
] ifFalse:[ |
|
366 |
scrolledView |
|
367 |
extent:[(width - scrollBar width - scrollBar borderWidth) |
|
368 |
@ |
|
369 |
(height - hScrollBar height - hScrollBar borderWidth) |
|
370 |
] |
|
371 |
]. |
|
372 |
self setScrollActions. |
|
63 | 373 |
] |
814 | 374 |
|
951 | 375 |
"Modified: 16.1.1997 / 19:06:07 / cg" |
0 | 376 |
! |
377 |
||
378 |
realize |
|
379 |
super realize. |
|
38 | 380 |
scrolledView notNil ifTrue:[ |
59 | 381 |
hScrollBar setThumbFor:scrolledView |
38 | 382 |
] |
0 | 383 |
! ! |
384 |
||
7 | 385 |
!HVScrollableView methodsFor:'private'! |
386 |
||
387 |
setScrollActions |
|
814 | 388 |
lockUpdates := false. |
389 |
||
7 | 390 |
scrollBar scrollAction:[:position | |
814 | 391 |
lockUpdates := true. |
392 |
scrolledView scrollVerticalToPercent:position. |
|
393 |
lockUpdates := false |
|
7 | 394 |
]. |
395 |
scrollBar scrollUpAction:[scrolledView scrollUp]. |
|
396 |
scrollBar scrollDownAction:[scrolledView scrollDown]. |
|
397 |
||
398 |
hScrollBar scrollAction:[:position | |
|
814 | 399 |
lockUpdates := true. |
400 |
scrolledView scrollHorizontalToPercent:position. |
|
401 |
lockUpdates := false |
|
7 | 402 |
]. |
403 |
hScrollBar scrollLeftAction:[scrolledView scrollLeft]. |
|
404 |
hScrollBar scrollRightAction:[scrolledView scrollRight]. |
|
405 |
||
65 | 406 |
scrolledView addDependent:self. |
814 | 407 |
|
408 |
" |
|
409 |
pass my keyboard input (and other subviews input) |
|
410 |
to the scrolled view ... |
|
411 |
" |
|
412 |
self delegate:(KeyboardForwarder toView:scrolledView). |
|
413 |
||
414 |
"Modified: 1.8.1996 / 12:44:16 / cg" |
|
7 | 415 |
! ! |
416 |
||
105 | 417 |
!HVScrollableView methodsFor:'queries'! |
418 |
||
818
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
419 |
isHorizontalScrollable |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
420 |
"return true, because I am horizontal scrollable" |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
421 |
|
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
422 |
^ true |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
423 |
|
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
424 |
"Modified: 5.8.1996 / 12:29:10 / stefan" |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
425 |
! |
e922d238966c
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
426 |
|
130 | 427 |
preferredExtent |
572 | 428 |
"return the components preferredExtent." |
429 |
||
130 | 430 |
|pref m2| |
431 |
||
802 | 432 |
"/ If I have an explicit preferredExtent .. |
433 |
||
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
434 |
preferredExtent notNil ifTrue:[ |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
435 |
^ preferredExtent |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
436 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
678
diff
changeset
|
437 |
|
105 | 438 |
scrolledView notNil ifTrue:[ |
572 | 439 |
m2 := innerMargin * 2. |
440 |
pref := scrolledView preferredExtent. |
|
441 |
^ (pref x + scrollBar width + m2) |
|
442 |
@ |
|
443 |
(pref y + hScrollBar height + m2). |
|
105 | 444 |
]. |
130 | 445 |
^ super preferredExtent. |
572 | 446 |
|
802 | 447 |
"Modified: 19.7.1996 / 20:44:16 / cg" |
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
448 |
! |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
449 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
450 |
preferredExtentForLines:numLines cols:numCols |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
451 |
"return my preferredExtent for given number of lines and cols." |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
452 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
453 |
|pref m2| |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
454 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
455 |
scrolledView notNil ifTrue:[ |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
456 |
m2 := innerMargin * 2. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
457 |
pref := scrolledView preferredExtentForLines:numLines cols:numCols. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
458 |
^ (pref x + scrollBar width + m2) |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
459 |
@ |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
460 |
(pref y + hScrollBar height + m2). |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
461 |
]. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
462 |
^ super preferredExtent. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
463 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
464 |
"Modified: 23.4.1996 / 00:15:25 / cg" |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
584
diff
changeset
|
465 |
"Created: 24.5.1996 / 17:15:43 / cg" |
105 | 466 |
! ! |
467 |
||
845 | 468 |
!HVScrollableView class methodsFor:'documentation'! |
65 | 469 |
|
216 | 470 |
version |
951 | 471 |
^ '$Header: /cvs/stx/stx/libwidg/HVScrollableView.st,v 1.23 1997-01-16 18:07:13 cg Exp $' |
65 | 472 |
! ! |