author | mawalch |
Thu, 14 Jul 2016 21:33:34 +0200 | |
changeset 5784 | 0e5f3ae22323 |
parent 5753 | d8465881eb1f |
child 5809 | a5cecde02b21 |
child 5823 | 4b04551a5e84 |
permissions | -rw-r--r-- |
0 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1989 by Claus Gittinger |
3012 | 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 |
" |
|
2195
2117849dec53
forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
12 |
"{ Package: 'stx:libwidg' }" |
2117849dec53
forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
13 |
|
5407 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
119 | 16 |
SimpleView subclass:#ScrollableView |
3013 | 17 |
instanceVariableNames:'scrolledView vScrollBar hScrollBar scrollBarPosition lockUpdates |
18 |
hideVScrollBar hideHScrollBar hasHorizontalScrollBar |
|
19 |
hasVerticalScrollBar horizontalMini verticalMini vScrollBarHidden |
|
20 |
hScrollBarHidden scrolledViewHMargin scrolledViewVMargin |
|
21 |
scrollBarVSpacing scrollBarHSpacing scrolledViewLayout |
|
5478 | 22 |
hScrollBarLayout vScrollBarLayout hideScrollbarIfPointerOutside' |
3013 | 23 |
classVariableNames:'DefaultScrolledViewLevel DefaultScrolledViewMargin |
24 |
DefaultScrollBarSpacing DefaultScrolledViewBorderWidth |
|
25 |
DefaultLevel DefaultScrollBarLevel MyDefaultViewBackgroundColor' |
|
26 |
poolDictionaries:'' |
|
27 |
category:'Views-Basic' |
|
0 | 28 |
! |
29 |
||
852 | 30 |
!ScrollableView class methodsFor:'documentation'! |
38 | 31 |
|
32 |
copyright |
|
33 |
" |
|
34 |
COPYRIGHT (c) 1989 by Claus Gittinger |
|
3012 | 35 |
All Rights Reserved |
38 | 36 |
|
37 |
This software is furnished under a license and may be used |
|
38 |
only in accordance with the terms of that license and with the |
|
39 |
inclusion of the above copyright notice. This software may not |
|
40 |
be provided or otherwise made available to, or used by, any |
|
41 |
other person. No title to or ownership of the software is |
|
42 |
hereby transferred. |
|
43 |
" |
|
44 |
! |
|
45 |
||
46 |
documentation |
|
47 |
" |
|
48 |
a view containing a scrollbar and some other (slave-)view. |
|
130 | 49 |
This view wraps scrollbar(s) around the view to be scrolled. |
65 | 50 |
The scrollbars are setup to send scrollUp/scrollDown/scrollVerticalTo |
51 |
and scrollLeft/scrollRight/scrollHorizontalTo- messages whenever moved. |
|
130 | 52 |
The view itself has to implement these (there is a default implementation |
5784 | 53 |
in the common View class for this - so your widgets usually don't have to |
1459 | 54 |
care for this). |
65 | 55 |
|
56 |
For the scrollbars to know about the full (maximum) size, the view |
|
1459 | 57 |
MUST implement #heightOfContents and/or #widthOfContents. |
58 |
The values returned by those methods are used to compute the fraction |
|
130 | 59 |
which is visible (i.e. the scrollers thumb heights). |
65 | 60 |
|
1459 | 61 |
There are three ways to setup a scrollableView: |
38 | 62 |
if the type of the view to be scrolled is known in advance, |
63 |
use: |
|
3012 | 64 |
v := ScrollableView for:<ViewClass> |
130 | 65 |
or: |
3012 | 66 |
v := ScrollableView for:<ViewClass> in:someSuperView |
65 | 67 |
|
1459 | 68 |
|
69 |
otherwise, create an empty scrollableView with: |
|
130 | 70 |
|
3012 | 71 |
v := ScrollableView new |
130 | 72 |
or: |
3012 | 73 |
v := ScrollableView in:someSuperView |
130 | 74 |
|
65 | 75 |
and define the view later with: |
130 | 76 |
|
3012 | 77 |
v scrolledView:aViewToBeScrolled |
65 | 78 |
|
1459 | 79 |
|
130 | 80 |
Finally, if the view to be scrolled has been already created, |
81 |
use: |
|
82 |
||
3012 | 83 |
v := ScrollableView forView:aViewToBeScrolled |
130 | 84 |
or: |
3012 | 85 |
v := ScrollableView forView:aViewToBeScrolled in:someSuperView |
65 | 86 |
|
130 | 87 |
It is also possible to change the scrolledView later (even multiple times). |
5784 | 88 |
This may be useful if different views are needed to display different types |
130 | 89 |
of data (see example2) and at creation time, it is not known what type |
1459 | 90 |
of view is required (multidocument format applications). |
130 | 91 |
|
3568
976b80ebcda7
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3509
diff
changeset
|
92 |
If you want to scroll a bunch of other views (instead of a views contents), |
1459 | 93 |
you need a companion class (ViewScroller). See the documentation there. |
65 | 94 |
|
113 | 95 |
By default, scrollbars are full size scrollbars - for horizontal scrolling |
96 |
(which is less often used), scrollableViews can optionally be created with |
|
97 |
miniscrollers which take up less screen space. |
|
130 | 98 |
|
1459 | 99 |
Recent changes: |
3012 | 100 |
Originally, there where two classes, for vertical-only and |
101 |
horizontal+vertical scrollability. |
|
102 |
These have now been merged into the common ScrollableView class, |
|
103 |
and each scrollability can be controlled individually. |
|
3568
976b80ebcda7
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3509
diff
changeset
|
104 |
|
1459 | 105 |
|
584 | 106 |
[author:] |
3012 | 107 |
Claus Gittinger |
130 | 108 |
|
584 | 109 |
[see also:] |
5784 | 110 |
ScrollBar |
3568
976b80ebcda7
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3509
diff
changeset
|
111 |
Scroller |
976b80ebcda7
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3509
diff
changeset
|
112 |
ScrolledView |
63 | 113 |
" |
114 |
! |
|
38 | 115 |
|
63 | 116 |
examples |
117 |
" |
|
1138 | 118 |
simple scrolled text: |
3012 | 119 |
[exBegin] |
120 |
|top scr txt| |
|
121 |
||
122 |
top := StandardSystemView label:'scroll example1'. |
|
123 |
top extent:200@100. |
|
124 |
||
125 |
scr := ScrollableView for:EditTextView in:top. |
|
126 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
127 |
txt := scr scrolledView. |
|
128 |
||
129 |
txt list:#('line1' |
|
130 |
'line2' |
|
131 |
'line3' |
|
132 |
'line4' |
|
133 |
'line5' |
|
134 |
'line7' |
|
135 |
'line8' |
|
136 |
'line9' |
|
137 |
'line10' |
|
138 |
). |
|
139 |
top open |
|
140 |
[exEnd] |
|
38 | 141 |
|
65 | 142 |
|
1138 | 143 |
changing the scrolledView later: |
3012 | 144 |
[exBegin] |
145 |
|top scr txtView1 txtView2 browserView| |
|
146 |
||
147 |
top := StandardSystemView label:'scroll example2'. |
|
148 |
top extent:300@100. |
|
149 |
||
150 |
scr := ScrollableView in:top. |
|
151 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
152 |
||
153 |
top open. |
|
154 |
||
155 |
(Delay forSeconds:5) wait. |
|
156 |
||
157 |
txtView1 := EditTextView new. |
|
158 |
txtView1 list:#( |
|
159 |
'wait 5 seconds to see the other text' |
|
160 |
'line2' |
|
161 |
'line3' |
|
162 |
'line4' |
|
163 |
'line5' |
|
164 |
'line7' |
|
165 |
'line8' |
|
166 |
'line9' |
|
167 |
'line10' |
|
168 |
). |
|
169 |
scr scrolledView:txtView1. |
|
170 |
||
171 |
(Delay forSeconds:5) wait. |
|
172 |
||
173 |
txtView2 := EditTextView new. |
|
174 |
txtView2 list:#('this is the other views text' |
|
175 |
'alternative line2' |
|
176 |
'alternative line3' |
|
177 |
'alternative line4' |
|
178 |
'alternative line5' |
|
179 |
'alternative line6'). |
|
180 |
scr scrolledView:txtView2. |
|
181 |
[exEnd] |
|
113 | 182 |
|
183 |
||
184 |
||
185 |
||
1138 | 186 |
using a miniscroller: |
3012 | 187 |
[exBegin] |
188 |
|top scr txt| |
|
189 |
||
190 |
top := StandardSystemView label:'scroll example3'. |
|
191 |
top extent:200@100. |
|
192 |
||
193 |
scr := ScrollableView for:EditTextView miniScroller:true in:top. |
|
194 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
195 |
txt := scr scrolledView. |
|
196 |
||
197 |
txt list:#('line1' |
|
198 |
'line2' |
|
199 |
'line3' |
|
200 |
'line4' |
|
201 |
'line5' |
|
202 |
'line7' |
|
203 |
'line8' |
|
204 |
'line9' |
|
205 |
'line10' |
|
206 |
). |
|
207 |
top open |
|
208 |
[exEnd] |
|
113 | 209 |
|
210 |
||
211 |
||
1138 | 212 |
scrolling in both directions: |
213 |
Notice: HVScrollableView remains existent for backward compatibility; |
|
3012 | 214 |
scrollability can now be controlled in both directions at any |
215 |
time (see examples below). |
|
216 |
[exBegin] |
|
217 |
|top scr txt| |
|
218 |
||
219 |
top := StandardSystemView label:'scroll example4'. |
|
220 |
top extent:200@100. |
|
221 |
||
222 |
scr := HVScrollableView for:EditTextView in:top. |
|
223 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
224 |
txt := scr scrolledView. |
|
225 |
||
226 |
txt list:#('line1' |
|
227 |
'line2' |
|
228 |
'line3' |
|
229 |
'line4' |
|
230 |
'line5' |
|
231 |
'line7' |
|
232 |
'line8' |
|
233 |
'line9' |
|
234 |
'line10' |
|
235 |
). |
|
236 |
top open |
|
237 |
[exEnd] |
|
113 | 238 |
|
239 |
||
240 |
||
1138 | 241 |
using a full scroller vertically, miniscroller horizontally: |
242 |
Notice: HVScrollableView remains existent for backward compatibility; |
|
3012 | 243 |
scrollability can now be controlled in both directions at any |
244 |
time (see examples below). |
|
245 |
[exBegin] |
|
246 |
|top scr txt| |
|
247 |
||
248 |
top := StandardSystemView label:'scroll example5'. |
|
249 |
top extent:200@100. |
|
250 |
||
251 |
scr := HVScrollableView for:EditTextView miniScrollerH:true in:top. |
|
252 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
253 |
txt := scr scrolledView. |
|
254 |
||
255 |
txt list:#('line1' |
|
256 |
'line2' |
|
257 |
'line3' |
|
258 |
'line4' |
|
259 |
'line5' |
|
260 |
'line7' |
|
261 |
'line8' |
|
262 |
'line9' |
|
263 |
'line10' |
|
264 |
). |
|
265 |
top open |
|
266 |
[exEnd] |
|
113 | 267 |
|
268 |
||
269 |
||
1138 | 270 |
using miniscrollers for both directions: |
271 |
Notice: HVScrollableView remains existent for backward compatibility; |
|
3012 | 272 |
scrollability can now be controlled in both directions at any |
273 |
time (see examples below). |
|
274 |
[exBegin] |
|
275 |
|top scr txt| |
|
276 |
||
277 |
top := StandardSystemView label:'scroll example6'. |
|
278 |
top extent:200@100. |
|
279 |
||
280 |
scr := HVScrollableView for:EditTextView miniScroller:true in:top. |
|
281 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
282 |
txt := scr scrolledView. |
|
283 |
||
284 |
txt list:#('line1' |
|
285 |
'line2' |
|
286 |
'line3' |
|
287 |
'line4' |
|
288 |
'line5' |
|
289 |
'line7' |
|
290 |
'line8' |
|
291 |
'line9' |
|
292 |
'line10' |
|
293 |
). |
|
294 |
top open |
|
295 |
[exEnd] |
|
1138 | 296 |
controlling scrollability: |
3012 | 297 |
[exBegin] |
298 |
|top scr txt| |
|
299 |
||
300 |
top := StandardSystemView label:'scroll example6'. |
|
301 |
top extent:200@100. |
|
302 |
||
303 |
txt := EditTextView new. |
|
1138 | 304 |
|
3012 | 305 |
scr := ScrollableView forView:txt in:top. |
306 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
307 |
scr horizontalScrollable:true. |
|
308 |
scr verticalScrollable:false. |
|
309 |
||
310 |
txt list:#('line1' |
|
311 |
'line2' |
|
312 |
'line3' |
|
313 |
'line4' |
|
314 |
'line5' |
|
315 |
'line7' |
|
316 |
'line8' |
|
317 |
'line9' |
|
318 |
'line10' |
|
319 |
). |
|
320 |
top open |
|
321 |
[exEnd] |
|
1138 | 322 |
controlling scrollability and miniScroller: |
3012 | 323 |
[exBegin] |
324 |
|top scr txt| |
|
325 |
||
326 |
top := StandardSystemView label:'scroll example6'. |
|
327 |
top extent:200@100. |
|
328 |
||
329 |
txt := EditTextView new. |
|
330 |
||
331 |
scr := ScrollableView forView:txt in:top. |
|
332 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
333 |
scr horizontalScrollable:true; horizontalMini:false. |
|
334 |
scr verticalScrollable:true; verticalMini:true. |
|
335 |
||
336 |
txt list:#('line1' |
|
337 |
'line2' |
|
338 |
'line3' |
|
339 |
'line4' |
|
340 |
'line5' |
|
341 |
'line7' |
|
342 |
'line8' |
|
343 |
'line9' |
|
344 |
'line10' |
|
345 |
). |
|
346 |
top open |
|
347 |
[exEnd] |
|
1459 | 348 |
autohiding scrollbars (edit the text to make scrollbars visible/invisible) |
349 |
(NOTICE: |
|
3012 | 350 |
this is controlled by the styleSheet and |
351 |
should normally NOT be done by the program): |
|
352 |
[exBegin] |
|
353 |
|top scr txt| |
|
354 |
||
355 |
top := StandardSystemView label:'scroll example6'. |
|
356 |
top extent:200@100. |
|
357 |
||
358 |
txt := EditTextView new. |
|
359 |
||
360 |
scr := ScrollableView forView:txt in:top. |
|
361 |
scr origin:0.0@0.0 corner:1.0@1.0. |
|
362 |
scr horizontalScrollable:true; horizontalMini:false. |
|
363 |
scr verticalScrollable:true; verticalMini:true. |
|
364 |
scr autoHideScrollBars:true. |
|
365 |
||
366 |
txt list:#('line1' |
|
367 |
'line2' |
|
368 |
'line3' |
|
369 |
'line4' |
|
370 |
'line5' |
|
371 |
'line7' |
|
372 |
'line8' |
|
373 |
'line9' |
|
374 |
'line10' |
|
375 |
). |
|
376 |
top open |
|
377 |
[exEnd] |
|
38 | 378 |
" |
379 |
! ! |
|
0 | 380 |
|
852 | 381 |
!ScrollableView class methodsFor:'instance creation'! |
217 | 382 |
|
383 |
for:aViewClass |
|
384 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
385 |
The subview is created here. |
|
386 |
The view will have full scrollbars." |
|
387 |
||
1111 | 388 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
389 |
for:aViewClass |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
390 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
391 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
392 |
miniScrollerH:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
393 |
miniScrollerV:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
394 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
395 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
396 |
in:nil |
1111 | 397 |
|
398 |
"Created: 6.3.1997 / 18:06:22 / cg" |
|
399 |
"Modified: 6.3.1997 / 23:18:32 / cg" |
|
400 |
! |
|
401 |
||
1183 | 402 |
for:aViewClass hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV |
403 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
404 |
The subview is created here. |
|
405 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
406 |
is false, miniscrollers if true." |
|
407 |
||
408 |
|newView| |
|
409 |
||
410 |
aViewClass notNil ifTrue:[ |
|
3012 | 411 |
newView := aViewClass new. |
1183 | 412 |
]. |
413 |
^ self |
|
3012 | 414 |
forView:newView |
415 |
hasHorizontalScrollBar:hasH |
|
416 |
hasVerticalScrollBar:hasV |
|
417 |
miniScrollerH:miniH |
|
418 |
miniScrollerV:miniV |
|
419 |
origin:nil |
|
420 |
corner:nil |
|
421 |
in:nil |
|
1183 | 422 |
|
423 |
"Created: 7.4.1997 / 19:00:14 / cg" |
|
424 |
! |
|
425 |
||
1111 | 426 |
for:aViewClass hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn 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 if the corresponding miniH/miniV |
|
430 |
is false, miniscrollers if true." |
|
431 |
||
432 |
|newView| |
|
433 |
||
434 |
aViewClass notNil ifTrue:[ |
|
1953 | 435 |
newView := aViewClass new. |
1111 | 436 |
]. |
437 |
^ self |
|
1953 | 438 |
forView:newView |
439 |
hasHorizontalScrollBar:hasH |
|
440 |
hasVerticalScrollBar:hasV |
|
441 |
miniScrollerH:miniH |
|
442 |
miniScrollerV:miniV |
|
443 |
origin:org |
|
444 |
corner:corn |
|
445 |
in:aView |
|
1111 | 446 |
|
447 |
" |
|
448 |
|top scr| |
|
449 |
||
450 |
top := StandardSystemView extent:200@200. |
|
1953 | 451 |
scr := ScrollableView for:nil |
452 |
hasHorizontalScrollBar:true |
|
453 |
hasVerticalScrollBar:true |
|
454 |
miniScrollerH:false |
|
455 |
miniScrollerV:false |
|
456 |
origin:0.0@0.0 |
|
457 |
corner:1.0@1.0 |
|
458 |
in:top. |
|
1111 | 459 |
top open |
460 |
" |
|
461 |
||
462 |
"Modified: 6.3.1997 / 18:36:01 / cg" |
|
217 | 463 |
! |
464 |
||
465 |
for:aViewClass in:aView |
|
466 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
467 |
The subview is created here. |
|
468 |
The view will have full scrollbars." |
|
469 |
||
1111 | 470 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
471 |
for:aViewClass |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
472 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
473 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
474 |
miniScrollerH:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
475 |
miniScrollerV:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
476 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
477 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
478 |
in:aView |
1111 | 479 |
|
480 |
"Modified: 6.3.1997 / 23:18:41 / cg" |
|
217 | 481 |
! |
482 |
||
483 |
for:aViewClass miniScroller:mini |
|
484 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
485 |
The subview is created here. |
|
486 |
The view will have full scrollbars if mini is false, miniscrollers |
|
487 |
if true." |
|
488 |
||
1111 | 489 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
490 |
for:aViewClass |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
491 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
492 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
493 |
miniScrollerH:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
494 |
miniScrollerV:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
495 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
496 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
497 |
in:nil |
1111 | 498 |
|
499 |
"Modified: 6.3.1997 / 23:18:45 / cg" |
|
217 | 500 |
! |
501 |
||
502 |
for:aViewClass miniScroller:mini in:aView |
|
503 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
504 |
The subview is created here. |
|
505 |
The view will have full scrollbars if mini is false, miniscrollers |
|
506 |
if true." |
|
507 |
||
1111 | 508 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
509 |
for:aViewClass |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
510 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
511 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
512 |
miniScrollerH:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
513 |
miniScrollerV:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
514 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
515 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
516 |
in:aView |
1111 | 517 |
|
518 |
"Modified: 6.3.1997 / 23:18:50 / cg" |
|
217 | 519 |
! |
153 | 520 |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
521 |
for:aViewClass miniScroller:mini origin:org corner:corn in:aView |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
522 |
"return a new scrolling view scrolling an instance of aViewClass. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
523 |
The subview is created here. |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
524 |
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
|
525 |
if true." |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
526 |
|
1111 | 527 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
528 |
for:aViewClass |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
529 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
530 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
531 |
miniScrollerH:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
532 |
miniScrollerV:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
533 |
origin:org |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
534 |
corner:corn |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
535 |
in:aView |
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
536 |
|
1111 | 537 |
"Modified: 6.3.1997 / 23:18:53 / cg" |
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
538 |
! |
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
539 |
|
217 | 540 |
for:aViewClass miniScrollerH:miniH |
541 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
542 |
The subview is created here. |
|
543 |
The view will have full scrollbars if miniH is false, |
|
544 |
and a horizontal miniscroller if true." |
|
545 |
||
2777 | 546 |
^ self |
547 |
for:aViewClass |
|
548 |
hasHorizontalScrollBar:true |
|
549 |
hasVerticalScrollBar:true |
|
550 |
miniScrollerH:miniH |
|
551 |
miniScrollerV:false |
|
552 |
origin:nil |
|
553 |
corner:nil |
|
554 |
in:nil |
|
1111 | 555 |
|
556 |
"Modified: 6.3.1997 / 18:30:15 / cg" |
|
217 | 557 |
! |
558 |
||
559 |
for:aViewClass miniScrollerH:miniH in:aView |
|
560 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
561 |
The subview is created here. |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
562 |
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
|
563 |
is false, miniscrollers if true." |
217 | 564 |
|
2777 | 565 |
^ self |
566 |
for:aViewClass |
|
567 |
hasHorizontalScrollBar:true |
|
568 |
hasVerticalScrollBar:true |
|
569 |
miniScrollerH:miniH |
|
570 |
miniScrollerV:false |
|
571 |
origin:nil |
|
572 |
corner:nil |
|
573 |
in:aView |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
574 |
|
1111 | 575 |
"Modified: 6.3.1997 / 18:30:31 / cg" |
217 | 576 |
! |
153 | 577 |
|
217 | 578 |
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV |
579 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
580 |
The subview is created here. |
|
581 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
582 |
is false, miniscrollers if true." |
|
583 |
||
2777 | 584 |
^ self |
585 |
for:aViewClass |
|
586 |
hasHorizontalScrollBar:true |
|
587 |
hasVerticalScrollBar:true |
|
588 |
miniScrollerH:miniH |
|
589 |
miniScrollerV:miniV |
|
590 |
origin:nil |
|
591 |
corner:nil |
|
592 |
in:nil |
|
1111 | 593 |
|
594 |
"Modified: 6.3.1997 / 18:30:47 / cg" |
|
217 | 595 |
! |
596 |
||
597 |
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV in:aView |
|
598 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
599 |
The subview is created here. |
|
600 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
601 |
is false, miniscrollers if true." |
|
602 |
||
2777 | 603 |
^ self |
604 |
for:aViewClass |
|
605 |
hasHorizontalScrollBar:true |
|
606 |
hasVerticalScrollBar:true |
|
607 |
miniScrollerH:miniH |
|
608 |
miniScrollerV:miniV |
|
609 |
origin:nil |
|
610 |
corner:nil |
|
611 |
in:aView |
|
1111 | 612 |
|
613 |
"Modified: 6.3.1997 / 18:31:02 / cg" |
|
614 |
! |
|
615 |
||
616 |
for:aViewClass miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn in:aView |
|
617 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
618 |
The subview is created here. |
|
619 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
620 |
is false, miniscrollers if true." |
|
621 |
||
2777 | 622 |
^ self |
623 |
for:aViewClass |
|
624 |
hasHorizontalScrollBar:true |
|
625 |
hasVerticalScrollBar:true |
|
626 |
miniScrollerH:miniH |
|
627 |
miniScrollerV:miniV |
|
628 |
origin:org |
|
629 |
corner:corn |
|
630 |
in:aView |
|
1111 | 631 |
|
632 |
"Modified: 6.3.1997 / 18:31:17 / cg" |
|
633 |
! |
|
634 |
||
635 |
for:aViewClass miniScrollerH:miniH origin:org corner:corn in:aView |
|
636 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
637 |
The subview is created here. |
|
638 |
The view will have a full horizontal scrollbar if miniH is false, |
|
639 |
a miniscroller if true." |
|
640 |
||
2777 | 641 |
^ self |
642 |
for:aViewClass |
|
643 |
hasHorizontalScrollBar:true |
|
644 |
hasVerticalScrollBar:true |
|
645 |
miniScrollerH:miniH |
|
646 |
miniScrollerV:false |
|
647 |
origin:org |
|
648 |
corner:corn |
|
649 |
in:aView |
|
1111 | 650 |
|
651 |
"Modified: 6.3.1997 / 18:31:28 / cg" |
|
652 |
! |
|
653 |
||
654 |
for:aViewClass miniScrollerV:miniV origin:org corner:corn in:aView |
|
655 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
656 |
The subview is created here. |
|
657 |
The view will have a full vertical scrollbar if miniV is false, |
|
658 |
a miniscroller if true." |
|
659 |
||
2777 | 660 |
^ self |
661 |
for:aViewClass |
|
662 |
hasHorizontalScrollBar:true |
|
663 |
hasVerticalScrollBar:true |
|
664 |
miniScrollerH:false |
|
665 |
miniScrollerV:miniV |
|
666 |
origin:org |
|
667 |
corner:corn |
|
668 |
in:aView |
|
1111 | 669 |
|
670 |
"Modified: 6.3.1997 / 18:31:41 / cg" |
|
671 |
! |
|
672 |
||
673 |
for:aViewClass origin:org corner:corner in:aView |
|
674 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
675 |
The subview is created here. |
|
676 |
The view will have full scrollbars." |
|
677 |
||
2777 | 678 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
679 |
for:aViewClass |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
680 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
681 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
682 |
miniScrollerH:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
683 |
miniScrollerV:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
684 |
origin:org |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
685 |
corner:corner |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
686 |
in:aView |
1111 | 687 |
|
688 |
"Modified: 6.3.1997 / 23:19:05 / cg" |
|
689 |
! |
|
690 |
||
691 |
forView:aView |
|
692 |
"return a new scrolling view scrolling aView. |
|
693 |
The view will have full scrollbars." |
|
694 |
||
2777 | 695 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
696 |
forView:aView |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
697 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
698 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
699 |
miniScrollerH:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
700 |
miniScrollerV:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
701 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
702 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
703 |
in:nil |
1111 | 704 |
|
705 |
"Modified: 6.3.1997 / 23:19:08 / cg" |
|
706 |
! |
|
707 |
||
3590 | 708 |
forView:aView hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV |
709 |
"return a new scrolling view scrolling a aView. |
|
710 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
711 |
is false, miniscrollers if true." |
|
712 |
||
713 |
^ self |
|
714 |
forView:aView |
|
715 |
hasHorizontalScrollBar:hasH |
|
716 |
hasVerticalScrollBar:hasV |
|
717 |
miniScrollerH:miniH |
|
718 |
miniScrollerV:miniV |
|
719 |
origin:nil |
|
720 |
corner:nil |
|
721 |
in:nil |
|
722 |
! |
|
723 |
||
1111 | 724 |
forView:aScrolledView hasHorizontalScrollBar:hasH hasVerticalScrollBar:hasV miniScrollerH:miniH miniScrollerV:miniV origin:org corner:corn in:aView |
725 |
"return a new scrolling view scrolling an instance of aViewClass. |
|
726 |
The subview is created here. |
|
727 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
728 |
is false, miniscrollers if true." |
|
729 |
||
300 | 730 |
|newView dev| |
217 | 731 |
|
732 |
aView notNil ifTrue:[ |
|
1953 | 733 |
dev := aView graphicsDevice |
300 | 734 |
] ifFalse:[ |
1953 | 735 |
dev := Screen current |
300 | 736 |
]. |
737 |
newView := self basicNew device:dev. |
|
2526 | 738 |
"/ preset flags to avoid creation and later destruction of scrollBars ... |
739 |
newView setVertical:hasV mini:miniV horizontal:hasH mini:miniH. |
|
1111 | 740 |
newView initialize. |
741 |
newView setupVertical:hasV mini:miniV horizontal:hasH mini:miniH. |
|
742 |
||
743 |
aScrolledView notNil ifTrue:[ |
|
1953 | 744 |
newView scrolledView:aScrolledView. |
1111 | 745 |
]. |
746 |
||
747 |
org notNil ifTrue:[ |
|
1953 | 748 |
newView origin:org |
1111 | 749 |
]. |
750 |
corn notNil ifTrue:[ |
|
1953 | 751 |
newView corner:corn |
1111 | 752 |
]. |
753 |
||
300 | 754 |
aView notNil ifTrue:[ |
1953 | 755 |
aView addSubView:newView |
153 | 756 |
]. |
217 | 757 |
^ newView |
703 | 758 |
|
1111 | 759 |
" |
760 |
|top scr| |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
761 |
|
1111 | 762 |
top := StandardSystemView extent:200@200. |
1953 | 763 |
scr := ScrollableView |
764 |
forView:(TextView new) |
|
765 |
hasHorizontalScrollBar:true |
|
766 |
hasVerticalScrollBar:true |
|
767 |
miniScrollerH:false |
|
768 |
miniScrollerV:false |
|
769 |
origin:0.0@0.0 |
|
770 |
corner:1.0@1.0 |
|
771 |
in:top. |
|
772 |
top open |
|
773 |
" |
|
774 |
" |
|
775 |
|top scr| |
|
776 |
||
777 |
top := StandardSystemView extent:200@200. |
|
778 |
scr := ScrollableView |
|
779 |
forView:(TextView new) |
|
780 |
hasHorizontalScrollBar:false |
|
781 |
hasVerticalScrollBar:true |
|
782 |
miniScrollerH:false |
|
783 |
miniScrollerV:false |
|
784 |
origin:0.0@0.0 |
|
785 |
corner:1.0@1.0 |
|
786 |
in:top. |
|
1111 | 787 |
top open |
788 |
" |
|
546
b643875bda30
more inst creation variations
Claus Gittinger <cg@exept.de>
parents:
492
diff
changeset
|
789 |
|
1135
acdeed6efc13
Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents:
1134
diff
changeset
|
790 |
"Modified: 6.3.1997 / 18:42:40 / cg" |
acdeed6efc13
Fix prev fix from cg. Send setupDimensions only if scrolledView
Stefan Vogel <sv@exept.de>
parents:
1134
diff
changeset
|
791 |
"Modified: 19.3.1997 / 15:32:51 / stefan" |
217 | 792 |
! |
793 |
||
852 | 794 |
forView:aView in:aSuperView |
795 |
"return a new scrolling view scrolling aView. |
|
796 |
The view will have full scrollbars." |
|
797 |
||
2777 | 798 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
799 |
forView:aView |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
800 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
801 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
802 |
miniScrollerH:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
803 |
miniScrollerV:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
804 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
805 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
806 |
in:aSuperView |
852 | 807 |
|
1111 | 808 |
"Modified: 6.3.1997 / 23:19:12 / cg" |
852 | 809 |
! |
810 |
||
248 | 811 |
forView:aView miniScrollerH:mini |
812 |
"return a new scrolling view scrolling aView. |
|
813 |
The view will have a full vertical scrollbar and a horizontal |
|
814 |
miniScroller if mini is true." |
|
815 |
||
2777 | 816 |
^ self |
817 |
forView:aView |
|
818 |
hasHorizontalScrollBar:true |
|
819 |
hasVerticalScrollBar:true |
|
820 |
miniScrollerH:mini |
|
821 |
miniScrollerV:false |
|
822 |
origin:nil |
|
823 |
corner:nil |
|
824 |
in:nil |
|
248 | 825 |
|
1111 | 826 |
"Modified: 6.3.1997 / 18:32:58 / cg" |
248 | 827 |
! |
828 |
||
3401 | 829 |
forView:scrolledView miniScrollerH:miniH miniScrollerV:miniV |
830 |
"return a new scrolling view, scrolling aView. |
|
831 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
832 |
is false, miniscrollers if true." |
|
833 |
||
834 |
^ self forView:scrolledView miniScrollerH:miniH miniScrollerV:miniV in:nil |
|
835 |
||
836 |
"Created: / 06-10-2006 / 14:30:30 / cg" |
|
837 |
! |
|
838 |
||
217 | 839 |
forView:scrolledView miniScrollerH:miniH miniScrollerV:miniV in:aView |
840 |
"return a new scrolling view, scrolling aView. |
|
841 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
842 |
is false, miniscrollers if true." |
|
153 | 843 |
|
2777 | 844 |
^ self |
845 |
forView:scrolledView |
|
846 |
hasHorizontalScrollBar:true |
|
847 |
hasVerticalScrollBar:true |
|
848 |
miniScrollerH:miniH |
|
849 |
miniScrollerV:miniV |
|
850 |
origin:nil |
|
851 |
corner:nil |
|
852 |
in:aView |
|
217 | 853 |
|
1111 | 854 |
"Modified: 6.3.1997 / 18:33:20 / cg" |
217 | 855 |
! |
153 | 856 |
|
217 | 857 |
in:aView |
858 |
"return a new scrolling view to be contained in aView. |
|
859 |
There is no slave view now - this has to be set later via |
|
860 |
the scrolledView: method. |
|
861 |
The view will have full scrollbars." |
|
862 |
||
2777 | 863 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
864 |
forView:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
865 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
866 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
867 |
miniScrollerH:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
868 |
miniScrollerV:false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
869 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
870 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
871 |
in:aView |
1111 | 872 |
|
873 |
"Modified: 6.3.1997 / 23:19:19 / cg" |
|
217 | 874 |
! |
0 | 875 |
|
93 | 876 |
miniScroller:mini |
877 |
"return a new scrolling view. The subview will be created later. |
|
878 |
The view will have full scrollbars if mini is false, |
|
879 |
miniscrollers if true." |
|
880 |
||
2777 | 881 |
^ self |
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
882 |
forView:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
883 |
hasHorizontalScrollBar:self defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
884 |
hasVerticalScrollBar:self defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
885 |
miniScrollerH:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
886 |
miniScrollerV:mini |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
887 |
origin:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
888 |
corner:nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
889 |
in:nil |
1111 | 890 |
|
891 |
"Modified: 6.3.1997 / 23:19:21 / cg" |
|
93 | 892 |
! |
893 |
||
113 | 894 |
miniScrollerH:miniH |
895 |
"return a new scrolling view. The subview will be created later. |
|
896 |
The view will have full scrollbars if miniH is false, |
|
897 |
and a horizontal miniscroller if true." |
|
898 |
||
2777 | 899 |
^ self |
900 |
forView:nil |
|
901 |
hasHorizontalScrollBar:true |
|
902 |
hasVerticalScrollBar:true |
|
903 |
miniScrollerH:miniH |
|
904 |
miniScrollerV:false |
|
905 |
origin:nil |
|
906 |
corner:nil |
|
907 |
in:nil |
|
1111 | 908 |
|
909 |
"Modified: 6.3.1997 / 18:34:06 / cg" |
|
113 | 910 |
! |
911 |
||
93 | 912 |
miniScrollerH:miniH miniScrollerV:miniV |
913 |
"return a new scrolling view. The subview will be created later. |
|
914 |
The view will have full scrollbars if the corresponding miniH/miniV |
|
113 | 915 |
is false, miniscrollers if true." |
93 | 916 |
|
2777 | 917 |
^ self |
918 |
forView:nil |
|
919 |
hasHorizontalScrollBar:true |
|
920 |
hasVerticalScrollBar:true |
|
921 |
miniScrollerH:miniH |
|
922 |
miniScrollerV:miniV |
|
923 |
origin:nil |
|
924 |
corner:nil |
|
925 |
in:nil |
|
1111 | 926 |
|
927 |
"Modified: 6.3.1997 / 18:34:16 / cg" |
|
1719
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
928 |
! |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
929 |
|
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
930 |
new |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
931 |
"return a new scrolling view. |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
932 |
There is no slave view now - this has to be set later via |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
933 |
the scrolledView: method. |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
934 |
The view will have full scrollbars." |
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
935 |
|
2777 | 936 |
^ self in:nil |
1719
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
937 |
|
3d4adf98c079
added #new; gives a scrollableView with full scrollbars.
Claus Gittinger <cg@exept.de>
parents:
1695
diff
changeset
|
938 |
"Modified: / 12.11.1998 / 14:55:54 / cg" |
217 | 939 |
! ! |
93 | 940 |
|
852 | 941 |
!ScrollableView class methodsFor:'defaults'! |
217 | 942 |
|
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
943 |
defaultHorizontalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
944 |
^ false |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
945 |
! |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
946 |
|
1378 | 947 |
defaultScrollBarPosition |
948 |
"return the default position of the scrollBar. |
|
949 |
(max be of interest to panels, to make the handlePosition alike)" |
|
950 |
||
951 |
<resource: #style (#'scrollBar.position')> |
|
952 |
||
1870 | 953 |
^ StyleSheet at:#'scrollBar.position' default:#left. |
1378 | 954 |
|
955 |
" |
|
956 |
self defaultScrollBarPosition |
|
957 |
" |
|
958 |
||
959 |
"Modified: / 31.10.1997 / 12:58:15 / cg" |
|
960 |
! |
|
961 |
||
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
962 |
defaultVerticalScrollable |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
963 |
^ true |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
964 |
! |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
965 |
|
217 | 966 |
updateStyleCache |
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
967 |
"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
|
968 |
|
1354 | 969 |
<resource: #style (#'scrolledView.level' #'scrolledView.margin' |
3012 | 970 |
#'scrolledView.borderWidth' |
971 |
#'scrollBar.spacing' #'scrollBar.level' |
|
972 |
#'scrollableView.level' #'scrollableView.backgroundColor' )> |
|
1111 | 973 |
|
974 |
|defLevel defMargin defSpacing| |
|
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
975 |
|
1111 | 976 |
StyleSheet is3D ifTrue:[ |
3012 | 977 |
defLevel := -1. |
978 |
defMargin := ViewSpacing // 2. |
|
979 |
defSpacing := defMargin. |
|
217 | 980 |
] ifFalse:[ |
3012 | 981 |
defLevel := 0. |
982 |
defMargin := 0. |
|
983 |
defSpacing := 0 |
|
217 | 984 |
]. |
1870 | 985 |
DefaultScrolledViewLevel := StyleSheet at:#'scrolledView.level' default:defLevel. |
986 |
DefaultScrolledViewBorderWidth := StyleSheet at:#'scrolledView.borderWidth' default:nil. |
|
987 |
DefaultScrolledViewMargin := StyleSheet at:#'scrolledView.margin' default:defMargin. |
|
988 |
DefaultScrollBarSpacing := StyleSheet at:#'scrollBar.spacing' default:defSpacing. |
|
989 |
DefaultLevel := StyleSheet at:#'scrollableView.level' default:nil. |
|
990 |
DefaultScrollBarLevel := StyleSheet at:#'scrollBar.level' default:nil. |
|
991 |
MyDefaultViewBackgroundColor := StyleSheet at:#'scrollableView.backgroundColor' default:DefaultViewBackgroundColor. |
|
0 | 992 |
|
1111 | 993 |
" |
994 |
self updateStyleCache |
|
995 |
" |
|
996 |
||
1378 | 997 |
"Modified: / 31.10.1997 / 20:57:10 / cg" |
217 | 998 |
! ! |
999 |
||
1140 | 1000 |
!ScrollableView methodsFor:'accessing-behavior'! |
1001 |
||
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1002 |
autoHideHorizontalScrollBar:aBoolean |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1003 |
"set/clear the flag which controls if the horizontal scrollBar should |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1004 |
be made invisible dynamically, if there is nothing to scroll |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1005 |
(and shown if there is). |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1006 |
This flags setting is normally controlled by the styleSheet." |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1007 |
|
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1008 |
hideHScrollBar := aBoolean. |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1009 |
|
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1010 |
"Modified: 19.3.1997 / 16:28:42 / cg" |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1011 |
"Created: 19.3.1997 / 17:24:39 / cg" |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1012 |
! |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1013 |
|
1140 | 1014 |
autoHideScrollBars:aBoolean |
1015 |
"set/clear the flag which controls if scrollBars should |
|
1016 |
be made invisible dynamically, if there is nothing to scroll |
|
1017 |
(and shown if there is). |
|
1018 |
This flags setting is normally controlled by the styleSheet." |
|
1019 |
||
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1020 |
hideVScrollBar := hideHScrollBar := aBoolean. |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1021 |
|
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1022 |
"Modified: 19.3.1997 / 16:28:42 / cg" |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1023 |
"Created: 19.3.1997 / 17:24:39 / cg" |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1024 |
! |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1025 |
|
1904 | 1026 |
autoHideVerticalScrollBar:aBoolean |
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1027 |
"set/clear the flag which controls if the vertical scrollBar should |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1028 |
be made invisible dynamically, if there is nothing to scroll |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1029 |
(and shown if there is). |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1030 |
This flags setting is normally controlled by the styleSheet." |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1031 |
|
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1032 |
hideVScrollBar := aBoolean. |
1140 | 1033 |
|
1034 |
"Modified: 19.3.1997 / 16:28:42 / cg" |
|
1035 |
"Created: 19.3.1997 / 17:24:39 / cg" |
|
4827 | 1036 |
! |
1037 |
||
1038 |
readOnly:aBoolean |
|
1039 |
scrolledView readOnly:aBoolean |
|
1140 | 1040 |
! ! |
1041 |
||
1138 | 1042 |
!ScrollableView methodsFor:'accessing-components'! |
119 | 1043 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1044 |
horizontalScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1045 |
"return the horizontal scrollbar (or nil, if there is none)" |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1046 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1047 |
"/ hScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1048 |
"/ self horizontalScrollable:true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1049 |
"/ ]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1050 |
^ hScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1051 |
|
1549
b64b2dd7d5df
create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents:
1536
diff
changeset
|
1052 |
"Created: / 6.3.1997 / 18:06:23 / cg" |
b64b2dd7d5df
create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents:
1536
diff
changeset
|
1053 |
"Modified: / 25.5.1998 / 12:53:58 / cg" |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1054 |
! |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1055 |
|
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1056 |
removeSubView:aView |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1057 |
super removeSubView:aView. |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1058 |
aView == scrolledView ifTrue:[ |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1059 |
scrolledView := nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1060 |
]. |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1061 |
aView == vScrollBar ifTrue:[ |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1062 |
vScrollBar := nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1063 |
]. |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1064 |
aView == hScrollBar ifTrue:[ |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1065 |
hScrollBar := nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1066 |
]. |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1067 |
|
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1068 |
|
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1069 |
|
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1070 |
|
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1071 |
! |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1072 |
|
217 | 1073 |
scrollBar |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1074 |
"return the vertical scrollbar (or nil, if there is none)" |
217 | 1075 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1076 |
"/ vScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1077 |
"/ self verticalScrollable:true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1078 |
"/ ]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1079 |
^ vScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1080 |
|
1549
b64b2dd7d5df
create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents:
1536
diff
changeset
|
1081 |
"Created: / 6.3.1997 / 18:06:23 / cg" |
b64b2dd7d5df
create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents:
1536
diff
changeset
|
1082 |
"Modified: / 25.5.1998 / 12:54:06 / cg" |
119 | 1083 |
! |
1084 |
||
217 | 1085 |
scrolledView |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1086 |
"return the scrolled view (or nil, if there is none)" |
38 | 1087 |
|
217 | 1088 |
^ scrolledView |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1089 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1090 |
"Modified: 6.3.1997 / 16:48:09 / cg" |
1111 | 1091 |
"Created: 6.3.1997 / 18:06:23 / cg" |
113 | 1092 |
! |
1093 |
||
217 | 1094 |
scrolledView:aView |
1095 |
"set the view to scroll" |
|
1096 |
||
2319
83b000a1928a
ignore useless scrolledView setting.
Claus Gittinger <cg@exept.de>
parents:
2272
diff
changeset
|
1097 |
aView == scrolledView ifTrue:[^ self "already"]. |
83b000a1928a
ignore useless scrolledView setting.
Claus Gittinger <cg@exept.de>
parents:
2272
diff
changeset
|
1098 |
|
217 | 1099 |
scrolledView notNil ifTrue:[ |
2271 | 1100 |
scrolledView removeDependent:self. |
1101 |
scrolledView destroy. |
|
1102 |
scrolledView := nil. |
|
217 | 1103 |
]. |
982 | 1104 |
|
217 | 1105 |
scrolledView := aView. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1106 |
|
2320
158b10553017
scrolledView setting (nil arg)
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
1107 |
aView notNil ifTrue:[ |
158b10553017
scrolledView setting (nil arg)
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
1108 |
super addSubViewFirst:aView. |
2271 | 1109 |
self setScrollActions. |
217 | 1110 |
|
2271 | 1111 |
realized ifTrue:[ |
1112 |
self setupDimensionsConfigureScrolledView:true. |
|
1113 |
self sizeChanged:nil. |
|
2320
158b10553017
scrolledView setting (nil arg)
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
1114 |
aView realize |
2271 | 1115 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1116 |
] |
217 | 1117 |
|
1535
b769ae01e418
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
1118 |
"Modified: / 19.3.1997 / 15:32:37 / stefan" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1119 |
"Modified: / 21.5.1998 / 00:48:57 / cg" |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1120 |
! |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1121 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1122 |
verticalScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1123 |
"return the vertical scrollbar (or nil, if there is none)" |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1124 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1125 |
"/ vScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1126 |
"/ self verticalScrollable:true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1127 |
"/ ]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1128 |
^ vScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1129 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1130 |
"Modified: 6.3.1997 / 16:59:24 / cg" |
1111 | 1131 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1253 | 1132 |
! |
1133 |
||
1134 |
widget |
|
1135 |
"for ST80 compatibility (where a wrapper returns its wrapped |
|
1136 |
widget), return the scrolledView here" |
|
1137 |
||
1138 |
^ scrolledView |
|
1139 |
||
1140 |
"Created: 20.6.1997 / 14:45:16 / cg" |
|
217 | 1141 |
! ! |
1142 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1143 |
!ScrollableView methodsFor:'accessing-look'! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1144 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1145 |
horizontalMini:aBoolean |
1138 | 1146 |
"control the horizontal scrollBar to be either a miniScroller, |
1147 |
or a full scrollBar." |
|
1148 |
||
2526 | 1149 |
|newMini| |
1150 |
||
1151 |
newMini := aBoolean. |
|
1152 |
(styleSheet at:#'scrollBar.neverMini' default:false) == true ifTrue:[ |
|
1153 |
newMini := false. |
|
1154 |
]. |
|
1155 |
||
1156 |
horizontalMini ~~ newMini ifTrue:[ |
|
1157 |
horizontalMini := newMini. |
|
1158 |
self setupForChangedScrollbars. |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1159 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1160 |
|
1498 | 1161 |
"Created: / 7.3.1997 / 21:57:02 / cg" |
1502 | 1162 |
"Modified: / 22.4.1998 / 22:42:25 / ca" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1163 |
"Modified: / 21.5.1998 / 00:48:25 / cg" |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1164 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1165 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1166 |
horizontalScrollable:aBoolean |
1138 | 1167 |
"enable/disable horizontal scrollability. |
1168 |
If disabled, the horizontal scrollBar is made invisible." |
|
1169 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1170 |
hasHorizontalScrollBar ~~ aBoolean ifTrue:[ |
1953 | 1171 |
hasHorizontalScrollBar := aBoolean. |
1172 |
hScrollBarHidden := false. |
|
2526 | 1173 |
self setupForChangedScrollbars. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1174 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1175 |
|
1498 | 1176 |
"Created: / 7.3.1997 / 21:56:28 / cg" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1177 |
"Modified: / 21.5.1998 / 00:48:44 / cg" |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1178 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1179 |
|
2526 | 1180 |
horizontalScrollable:scrollableBoolean miniScroller:miniScrollerBoolean |
1181 |
"enable/disable horizontal scrollability. |
|
1182 |
If disabled, the horizontal scrollBar is made invisible." |
|
1183 |
||
1184 |
|newMini| |
|
1185 |
||
1186 |
newMini := miniScrollerBoolean. |
|
1187 |
(styleSheet at:#'scrollBar.neverMini' default:false) == true ifTrue:[ |
|
1188 |
newMini := false. |
|
1189 |
]. |
|
1190 |
||
1191 |
(hasHorizontalScrollBar ~~ scrollableBoolean |
|
1192 |
or:[scrollableBoolean and:[horizontalMini ~~ newMini]]) ifTrue:[ |
|
1193 |
horizontalMini := newMini. |
|
1194 |
hasHorizontalScrollBar := scrollableBoolean. |
|
1195 |
hScrollBarHidden := false. |
|
1196 |
self setupForChangedScrollbars. |
|
1197 |
]. |
|
1198 |
horizontalMini := newMini. |
|
1199 |
! |
|
1200 |
||
1201 |
setupForChangedScrollbars |
|
1202 |
self setupViews. |
|
1203 |
shown ifTrue:[ |
|
1204 |
self setupDimensionsConfigureScrolledView:false. |
|
1205 |
] |
|
1206 |
! |
|
1207 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1208 |
verticalMini:aBoolean |
1138 | 1209 |
"control the vertical scrollBar to be either a miniScroller, |
1210 |
or a full scrollBar." |
|
1211 |
||
2526 | 1212 |
|newMini| |
1213 |
||
1214 |
newMini := aBoolean. |
|
1215 |
(styleSheet at:#'scrollBar.neverMini' default:false) == true ifTrue:[ |
|
1216 |
newMini := false. |
|
1217 |
]. |
|
1218 |
||
1219 |
verticalMini ~~ newMini ifTrue:[ |
|
1220 |
verticalMini := newMini. |
|
1221 |
self setupForChangedScrollbars. |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1222 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1223 |
|
1498 | 1224 |
"Created: / 7.3.1997 / 21:56:57 / cg" |
1502 | 1225 |
"Modified: / 22.4.1998 / 22:42:32 / ca" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1226 |
"Modified: / 21.5.1998 / 00:49:10 / cg" |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1227 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1228 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1229 |
verticalScrollable:aBoolean |
1138 | 1230 |
"enable/disable vertical scrollability. |
1231 |
If disabled, the vertical scrollBar is made invisible." |
|
1232 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1233 |
hasVerticalScrollBar ~~ aBoolean ifTrue:[ |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1234 |
hasVerticalScrollBar := aBoolean. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1235 |
"/ vScrollBarHidden := false. |
2526 | 1236 |
self setupForChangedScrollbars. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1237 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1238 |
|
1498 | 1239 |
"Created: / 7.3.1997 / 21:56:39 / cg" |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1240 |
"Modified: / 24.8.2001 / 14:55:20 / cg" |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1241 |
! ! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1242 |
|
2227 | 1243 |
!ScrollableView methodsFor:'change & update'! |
217 | 1244 |
|
5461 | 1245 |
pointerInView |
5488
0d471ab42047
Do not acces device instavar (delegated GC)!!
Stefan Vogel <sv@exept.de>
parents:
5478
diff
changeset
|
1246 |
|pv dev| |
5461 | 1247 |
|
5463 | 1248 |
windowGroup isNil ifTrue:[^ false]. |
5461 | 1249 |
(pv := windowGroup pointerView) isNil ifTrue:[ |
5625 | 1250 |
dev := device. |
1251 |
dev isNil ifTrue:[^ false]. |
|
1252 |
pv := dev viewFromPoint:(dev pointerPosition). |
|
5461 | 1253 |
pv isNil ifTrue:[^ false]. |
1254 |
]. |
|
1255 |
(pv isSameOrComponentOf:self) ifTrue:[^ true]. |
|
5463 | 1256 |
"/ Transcript showCR:pv. |
5461 | 1257 |
^ false. |
1258 |
! |
|
1259 |
||
217 | 1260 |
update:something with:argument from:changedObject |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1261 |
"whenever the scrolledView changes its contents, the scroller(s) must |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1262 |
be updated as well" |
132 | 1263 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1264 |
|doUpdate| |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1265 |
|
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1266 |
doUpdate := false. |
5461 | 1267 |
|
1268 |
something == #pointerInView ifTrue:[ |
|
5478 | 1269 |
(hideScrollbarIfPointerOutside ? false) ifTrue:[ |
5461 | 1270 |
doUpdate := true |
1271 |
] |
|
1272 |
]. |
|
1273 |
||
217 | 1274 |
changedObject == scrolledView ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1275 |
something == #sizeOfContents ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1276 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1277 |
vScrollBar setThumbFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1278 |
doUpdate := true |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1279 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1280 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1281 |
hScrollBar setThumbFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1282 |
doUpdate := true |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1283 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1284 |
] ifFalse:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1285 |
something == #originOfContents ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1286 |
lockUpdates ifFalse:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1287 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1288 |
vScrollBar setThumbOriginFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1289 |
doUpdate := true |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1290 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1291 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1292 |
hScrollBar setThumbOriginFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1293 |
doUpdate := true |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1294 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1295 |
]. |
5461 | 1296 |
]. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1297 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1298 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1299 |
|
5461 | 1300 |
doUpdate ifTrue:[ |
1301 |
self updateScrollBarVisibility |
|
1302 |
] |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1303 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1304 |
|
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1305 |
updateHScrollBarVisibility |
5461 | 1306 |
|hide anyChange scrollToOriginOnHide| |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1307 |
|
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1308 |
anyChange := false. |
5461 | 1309 |
scrollToOriginOnHide := true. |
1310 |
||
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1311 |
hideHScrollBar ~~ false ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1312 |
hScrollBar notNil ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1313 |
hide := hScrollBar thumbHeight >= 100. |
5461 | 1314 |
hide ifFalse:[ |
5478 | 1315 |
(hideScrollbarIfPointerOutside ? false) ifTrue:[ |
5461 | 1316 |
(self pointerInView) ifFalse:[ |
1317 |
scrollToOriginOnHide := false. |
|
1318 |
hide := true. |
|
1319 |
]. |
|
1320 |
]. |
|
1321 |
]. |
|
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1322 |
hide ~~ hScrollBar realized not "hScrollBarHidden" ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1323 |
hScrollBarHidden := hide. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1324 |
hide ifTrue:[ |
5461 | 1325 |
scrollToOriginOnHide ifTrue:[ |
1326 |
"/ just in case: scroll to left |
|
1327 |
scrolledView scrollHorizontalToPercent:0. |
|
1328 |
]. |
|
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1329 |
hScrollBar beInvisible |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1330 |
] ifFalse:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1331 |
hScrollBar beVisible |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1332 |
]. |
5022 | 1333 |
"/ hScrollBar setRealized:hide not. |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1334 |
anyChange := true. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1335 |
] |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1336 |
]. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1337 |
]. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1338 |
^ anyChange |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1339 |
|
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1340 |
"Modified: / 24.8.2001 / 15:05:57 / cg" |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1341 |
"Created: / 24.8.2001 / 15:06:05 / cg" |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1342 |
! |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1343 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1344 |
updateScrollBarVisibility |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1345 |
"check if any scrollbar needs to be hidden or shown" |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1346 |
|
5461 | 1347 |
|anyChange| |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1348 |
|
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1349 |
anyChange := self updateVScrollBarVisibility. |
5753 | 1350 |
"/ evaluating or here |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1351 |
anyChange := anyChange | self updateHScrollBarVisibility. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1352 |
|
5461 | 1353 |
"/ stupid - showing one may need the other and vice versa... |
1354 |
"/ ...therefore, check again |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1355 |
anyChange ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1356 |
self setupDimensionsConfigureScrolledView:false. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1357 |
|
5461 | 1358 |
"/ force bars to recompute... |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1359 |
scrolledView notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1360 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1361 |
vScrollBar setThumbFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1362 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1363 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1364 |
hScrollBar setThumbFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1365 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1366 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1367 |
|
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1368 |
anyChange := self updateVScrollBarVisibility. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1369 |
anyChange := anyChange | self updateHScrollBarVisibility. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1370 |
anyChange ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1371 |
self setupDimensionsConfigureScrolledView:false. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1372 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1373 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1374 |
|
1535
b769ae01e418
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
1375 |
"Modified: / 19.3.1997 / 15:33:36 / stefan" |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1376 |
"Modified: / 24.8.2001 / 15:08:58 / cg" |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1377 |
! |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1378 |
|
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1379 |
updateVScrollBarVisibility |
5461 | 1380 |
|hide anyChange scrollToOriginOnHide| |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1381 |
|
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1382 |
anyChange := false. |
5461 | 1383 |
scrollToOriginOnHide := true. |
1384 |
||
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1385 |
hideVScrollBar ~~ false ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1386 |
vScrollBar notNil ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1387 |
hide := vScrollBar thumbHeight >= 100. |
5478 | 1388 |
(hideScrollbarIfPointerOutside ? false) ifTrue:[ |
5461 | 1389 |
(self pointerInView) ifFalse:[ |
1390 |
scrollToOriginOnHide := false. |
|
1391 |
hide := true. |
|
1392 |
]. |
|
1393 |
]. |
|
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1394 |
hide ~~ vScrollBar realized not" vScrollBarHidden" ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1395 |
vScrollBarHidden := hide. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1396 |
hide ifTrue:[ |
5461 | 1397 |
scrollToOriginOnHide ifTrue:[ |
1398 |
"/ just in case: scroll to top |
|
1399 |
scrolledView scrollVerticalToPercent:0. |
|
1400 |
]. |
|
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1401 |
vScrollBar beInvisible |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1402 |
] ifFalse:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1403 |
vScrollBar beVisible |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1404 |
]. |
5022 | 1405 |
"/vScrollBar setRealized:hide not. |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1406 |
anyChange := true. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1407 |
] |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1408 |
]. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1409 |
]. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1410 |
^ anyChange |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1411 |
|
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1412 |
"Modified: / 24.8.2001 / 15:05:57 / cg" |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1413 |
"Created: / 24.8.2001 / 15:07:38 / cg" |
217 | 1414 |
! ! |
38 | 1415 |
|
3395 | 1416 |
!ScrollableView methodsFor:'drag & drop'! |
3242 | 1417 |
|
1418 |
dropTarget |
|
1419 |
scrolledView isNil ifTrue:[^ nil]. |
|
1420 |
^ scrolledView dropTarget |
|
1421 |
! |
|
1422 |
||
1423 |
dropTarget:aDropTarget |
|
1424 |
scrolledView isNil ifTrue:[^ self]. |
|
1425 |
scrolledView dropTarget:aDropTarget |
|
1426 |
! ! |
|
1427 |
||
2752 | 1428 |
!ScrollableView methodsFor:'event handling'! |
217 | 1429 |
|
1430 |
keyPress:key x:x y:y |
|
1431 |
"a key was pressed - handle page-keys here" |
|
1432 |
||
1433 |
<resource: #keyboard ( #Prior #Next ) > |
|
1434 |
||
1435 |
(key == #Prior) ifTrue: [^ self pageUp]. |
|
1436 |
(key == #Next) ifTrue: [^ self pageDown]. |
|
1437 |
||
1438 |
super keyPress:key x:x y:y |
|
1111 | 1439 |
|
1440 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
38 | 1441 |
! |
1442 |
||
5461 | 1443 |
pointerEnter:state x:x y:y |
1444 |
super pointerEnter:state x:x y:y. |
|
5478 | 1445 |
(hideScrollbarIfPointerOutside ? false) ifTrue:[ |
5461 | 1446 |
self updateScrollBarVisibility |
1447 |
] |
|
1448 |
! |
|
1449 |
||
1450 |
pointerLeave:state |
|
1451 |
super pointerLeave:state. |
|
1452 |
||
5478 | 1453 |
(hideScrollbarIfPointerOutside ? false) ifTrue:[ |
5461 | 1454 |
self updateScrollBarVisibility |
1455 |
] |
|
1456 |
! |
|
1457 |
||
5073 | 1458 |
requestAutoAccept |
1459 |
"request to accept: this is invoked when a dialog closes via accept or cancel. |
|
1460 |
This forces my value to be accepted into my model. |
|
1461 |
Any widget may suppress the ok/cancel, by returning false." |
|
1462 |
||
1463 |
^ scrolledView requestAutoAccept |
|
1464 |
! |
|
1465 |
||
217 | 1466 |
sizeChanged:how |
1138 | 1467 |
"handle size changes - this may change any scrollBars visibility" |
1468 |
||
1986 | 1469 |
|orgX orgY thV thH scrollH scrollV| |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1470 |
|
3671
15b7958e549b
dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents:
3590
diff
changeset
|
1471 |
self changed:#sizeOfView with:how. |
15b7958e549b
dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents:
3590
diff
changeset
|
1472 |
|
15b7958e549b
dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents:
3590
diff
changeset
|
1473 |
superView notNil ifTrue:[ |
15b7958e549b
dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents:
3590
diff
changeset
|
1474 |
superView subViewChangedSize |
15b7958e549b
dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents:
3590
diff
changeset
|
1475 |
]. |
15b7958e549b
dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents:
3590
diff
changeset
|
1476 |
|
1111 | 1477 |
"/ resize components manually, in an order which is optimal |
1478 |
||
1479 |
how == #smaller ifTrue:[ |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1480 |
"/ first resize the horizontalScrollBar, |
1111 | 1481 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1482 |
scrolledView notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1483 |
scrolledView containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1484 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1485 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1486 |
hScrollBar containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1487 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1488 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1489 |
vScrollBar containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1490 |
]. |
1111 | 1491 |
] ifFalse:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1492 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1493 |
hScrollBar containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1494 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1495 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1496 |
vScrollBar containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1497 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1498 |
scrolledView notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1499 |
scrolledView containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1500 |
]. |
1111 | 1501 |
]. |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1502 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1503 |
scrolledView isNil ifTrue:[^ self]. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1504 |
(hScrollBar isNil and:[vScrollBar isNil]) ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1505 |
^ self |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1506 |
]. |
1111 | 1507 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1508 |
vScrollBar notNil ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1509 |
vScrollBar setThumbFor:scrolledView. |
1986 | 1510 |
orgY := vScrollBar thumbOrigin. |
1511 |
thV := vScrollBar thumbHeight. |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1512 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1513 |
hScrollBar notNil ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1514 |
hScrollBar setThumbFor:scrolledView. |
1986 | 1515 |
orgX := hScrollBar thumbOrigin. |
1516 |
thH := hScrollBar thumbHeight. |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1517 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1518 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1519 |
"/ splitted, since there are optimized scrollProcedures for each case ... |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1520 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1521 |
hScrollBar isNil ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1522 |
"/ only care for vertical ... |
1986 | 1523 |
orgY + thV >= 100 ifTrue:[ |
1524 |
vScrollBar thumbOrigin:(100 - thV). |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1525 |
scrolledView scrollVerticalToPercent:vScrollBar thumbOrigin. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1526 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1527 |
] ifFalse:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1528 |
vScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1529 |
"/ only care for horizontal ... |
1986 | 1530 |
orgX + thH >= 100 ifTrue:[ |
1531 |
hScrollBar thumbOrigin:(100 - thH). |
|
1532 |
scrolledView scrollHorizontalToPercent:hScrollBar thumbOrigin. |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1533 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1534 |
] ifFalse:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1535 |
"/ care for both ... |
113 | 1536 |
|
1986 | 1537 |
scrollH := scrollV := false. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1538 |
|
1986 | 1539 |
orgY + thV >= 100 ifTrue:[ |
1540 |
vScrollBar thumbOrigin:(100 - thV). |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1541 |
orgY := vScrollBar thumbOrigin. |
1986 | 1542 |
scrollV := true. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1543 |
]. |
1986 | 1544 |
orgX + thH >= 100 ifTrue:[ |
1545 |
hScrollBar thumbOrigin:(100 - thH). |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1546 |
orgX := hScrollBar thumbOrigin. |
1986 | 1547 |
scrollH := true. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1548 |
]. |
1986 | 1549 |
scrollV ifTrue:[ |
1550 |
scrollH ifTrue:[ |
|
1551 |
scrolledView scrollToPercent:(orgX@orgY). |
|
1552 |
] ifFalse:[ |
|
1553 |
scrolledView scrollVerticalToPercent:orgY. |
|
1554 |
] |
|
1555 |
] ifFalse:[ |
|
1556 |
scrollH ifTrue:[ |
|
1557 |
scrolledView scrollHorizontalToPercent:orgX. |
|
1558 |
] |
|
1559 |
] |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1560 |
] |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1561 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1562 |
self updateScrollBarVisibility. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1563 |
|
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1564 |
"/ just in case there are more views... (DSV - sigh) |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1565 |
subViews do:[:eachSubView | |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1566 |
((eachSubView ~~ scrolledView) |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1567 |
and:[(eachSubView ~~ hScrollBar) |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1568 |
and:[eachSubView ~~ vScrollBar]]) |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1569 |
ifTrue:[ |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1570 |
eachSubView containerChangedSize |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1571 |
] |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1572 |
] |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1573 |
|
1160
f3204cabcce8
must update scrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1574 |
"Modified: 28.3.1997 / 17:25:38 / cg" |
3508 | 1575 |
! |
1576 |
||
1577 |
win32NativeScroll:scrollCode position:newPosition |
|
1578 |
"this is generated by a native scrollBar widget" |
|
1579 |
||
1580 |
scrollCode == #SB_LINEDOWN ifTrue:[ |
|
1581 |
scrolledView scrollDown. |
|
1582 |
^ self. |
|
1583 |
]. |
|
1584 |
scrollCode == #SB_LINEUP ifTrue:[ |
|
1585 |
scrolledView scrollUp. |
|
1586 |
^ self. |
|
1587 |
]. |
|
1588 |
scrollCode == #SB_LINELEFT ifTrue:[ |
|
1589 |
scrolledView scrollLeft. |
|
1590 |
^ self. |
|
1591 |
]. |
|
1592 |
scrollCode == #SB_LINERIGHT ifTrue:[ |
|
1593 |
scrolledView scrollRight. |
|
1594 |
^ self. |
|
1595 |
]. |
|
1596 |
scrollCode == #SB_PAGEDOWN ifTrue:[ |
|
1597 |
self pageDown. |
|
1598 |
^ self. |
|
1599 |
]. |
|
1600 |
scrollCode == #SB_PAGEUP ifTrue:[ |
|
1601 |
self pageUp. |
|
1602 |
^ self. |
|
1603 |
]. |
|
1604 |
scrollCode == #SB_PAGELEFT ifTrue:[ |
|
1605 |
self pageLeft. |
|
1606 |
^ self. |
|
1607 |
]. |
|
1608 |
scrollCode == #SB_PAGERIGHT ifTrue:[ |
|
1609 |
self pageRight. |
|
1610 |
^ self. |
|
1611 |
]. |
|
1612 |
scrollCode == #SB_THUMBPOSITIONVERTICAL ifTrue:[ |
|
1613 |
scrolledView scrollVerticalToPercent:newPosition. |
|
1614 |
^ self. |
|
1615 |
]. |
|
1616 |
scrollCode == #SB_THUMBPOSITIONHORIZONTAL ifTrue:[ |
|
1617 |
scrolledView scrollHorizontalToPercent:newPosition. |
|
1618 |
^ self. |
|
1619 |
]. |
|
1620 |
scrollCode == #SB_THUMBTRACKVERTICAL ifTrue:[ |
|
1621 |
vScrollBar isSynchronous ifTrue:[ |
|
1622 |
scrolledView scrollVerticalToPercent:newPosition. |
|
1623 |
]. |
|
1624 |
^ self. |
|
1625 |
]. |
|
1626 |
scrollCode == #SB_THUMBTRACKHORIZONTAL ifTrue:[ |
|
1627 |
hScrollBar isSynchronous ifTrue:[ |
|
1628 |
scrolledView scrollHorizontalToPercent:newPosition. |
|
1629 |
]. |
|
1630 |
^ self. |
|
1631 |
]. |
|
1632 |
||
1633 |
scrollCode == #SB_ENDSCROLL ifTrue:[ |
|
1634 |
^ self. |
|
1635 |
]. |
|
1636 |
self halt:'unexpected scroll operation'. |
|
217 | 1637 |
! ! |
1638 |
||
1639 |
!ScrollableView methodsFor:'forced scroll'! |
|
1640 |
||
1641 |
pageDown |
|
1138 | 1642 |
"page down - but only if there is a vertical scrollbar" |
217 | 1643 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1644 |
vScrollBar notNil ifTrue:[ |
3012 | 1645 |
vScrollBar pageDown |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1646 |
] |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1647 |
|
1111 | 1648 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1138 | 1649 |
"Modified: 19.3.1997 / 16:32:34 / cg" |
1650 |
! |
|
1651 |
||
1652 |
pageLeft |
|
1653 |
"page left - but only if there is a horizontal scrollbar" |
|
1654 |
||
1655 |
hScrollBar notNil ifTrue:[ |
|
3037 | 1656 |
hScrollBar pageUp |
1138 | 1657 |
] |
1658 |
||
1659 |
"Created: 19.3.1997 / 16:32:14 / cg" |
|
1660 |
"Modified: 19.3.1997 / 16:32:44 / cg" |
|
1661 |
! |
|
1662 |
||
1663 |
pageRight |
|
1664 |
"page right - but only if there is a horizontal scrollbar" |
|
1665 |
||
1666 |
hScrollBar notNil ifTrue:[ |
|
3037 | 1667 |
hScrollBar pageDown |
1138 | 1668 |
] |
1669 |
||
1670 |
"Created: 19.3.1997 / 16:32:22 / cg" |
|
1671 |
"Modified: 19.3.1997 / 16:32:48 / cg" |
|
113 | 1672 |
! |
1673 |
||
217 | 1674 |
pageUp |
1138 | 1675 |
"page up - but only if there is a vertical scrollbar" |
0 | 1676 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1677 |
vScrollBar notNil ifTrue:[ |
3012 | 1678 |
vScrollBar pageUp |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1679 |
] |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1680 |
|
1111 | 1681 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1138 | 1682 |
"Modified: 19.3.1997 / 16:32:38 / cg" |
0 | 1683 |
! ! |
1684 |
||
1685 |
!ScrollableView methodsFor:'initialization'! |
|
1686 |
||
217 | 1687 |
initStyle |
958 | 1688 |
"initialize style specifics" |
1689 |
||
3263 | 1690 |
<resource: #style (#'scrollBar.position' |
5461 | 1691 |
#'scrollBar.hiding' |
1692 |
#'scrollBar.hideIfPointerOutside')> |
|
608 | 1693 |
|
217 | 1694 |
super initStyle. |
1695 |
||
5478 | 1696 |
DefaultLevel notNil ifTrue:[self level:DefaultLevel]. |
1111 | 1697 |
viewBackground := MyDefaultViewBackgroundColor. |
1870 | 1698 |
scrollBarPosition := styleSheet at:#'scrollBar.position' default:#left. |
5478 | 1699 |
"/ this controls hiding if there is nothing to scroll (contents fits) |
1870 | 1700 |
hideHScrollBar := hideVScrollBar := styleSheet at:#'scrollBar.hiding' default:false. |
5478 | 1701 |
"/ this controls automatic hiding if the pointer is outside |
1702 |
hideScrollbarIfPointerOutside := styleSheet at:#'scrollBar.hideIfPointerOutside' default:false. |
|
1703 |
||
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1704 |
scrolledViewHMargin := scrolledViewVMargin := DefaultScrolledViewMargin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1705 |
scrollBarVSpacing := scrollBarHSpacing := DefaultScrollBarSpacing. |
5461 | 1706 |
|
1707 |
"/ self level:0. |
|
1708 |
"/ self border:(SimpleBorder width:1 color:Color grey). |
|
0 | 1709 |
! |
1710 |
||
1247 | 1711 |
initialize |
1712 |
"setup some default" |
|
1713 |
||
1714 |
verticalMini := horizontalMini := false. |
|
1715 |
hasVerticalScrollBar := hasHorizontalScrollBar := false. |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1716 |
vScrollBarHidden := hScrollBarHidden := true. |
5478 | 1717 |
hideScrollbarIfPointerOutside := false. |
1718 |
||
1247 | 1719 |
super initialize. |
1720 |
! |
|
1721 |
||
0 | 1722 |
realize |
1161
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1723 |
"realize (i.e. make me visible). |
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1724 |
Since scrolledView may have done something to its contents |
0 | 1725 |
during init-time we had no chance yet to catch contents- |
1161
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1726 |
changes; do it now" |
1160
f3204cabcce8
must update scrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1727 |
|
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1728 |
self setupDimensionsConfigureScrolledView:true. |
1176
29d0a646cbdf
must realize before setting scroller values
Claus Gittinger <cg@exept.de>
parents:
1161
diff
changeset
|
1729 |
super realize. |
1201
e7f1cf0180ca
must updateScrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1730 |
|
38 | 1731 |
scrolledView notNil ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1732 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1733 |
vScrollBar setThumbFor:scrolledView |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1734 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1735 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1736 |
hScrollBar setThumbFor:scrolledView |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1737 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1738 |
self updateScrollBarVisibility. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1739 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1740 |
|
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1741 |
"Modified: / 21.5.1998 / 00:52:18 / cg" |
1111 | 1742 |
! |
1743 |
||
1744 |
releaseHorizontalScrollBar |
|
1745 |
"destroy any horizontal scrollBar" |
|
1746 |
||
1747 |
hScrollBar notNil ifTrue:[ |
|
5461 | 1748 |
hScrollBar removeDependent:self. |
3012 | 1749 |
hScrollBar destroy. |
1750 |
hScrollBar := nil |
|
1111 | 1751 |
]. |
1752 |
||
1753 |
"Modified: 6.3.1997 / 17:43:20 / cg" |
|
1754 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
1755 |
! |
|
1756 |
||
1757 |
releaseVerticalScrollBar |
|
1758 |
"destroy any vertical scrollBar" |
|
1759 |
||
1760 |
vScrollBar notNil ifTrue:[ |
|
5461 | 1761 |
vScrollBar removeDependent:self. |
3012 | 1762 |
vScrollBar destroy. |
1763 |
vScrollBar := nil |
|
1111 | 1764 |
]. |
1765 |
||
1766 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
1097 | 1767 |
! |
7 | 1768 |
|
1769 |
setScrollActions |
|
1770 |
"lock prevents repositioning the scroller to the |
|
1771 |
actual (often rounded) position while scrolling, |
|
1772 |
and keeps it instead at the pointer position. |
|
1773 |
||
1774 |
(this avoids run-away scroller when scrolling |
|
1775 |
textviews, when the text is aligned line-wise). |
|
38 | 1776 |
Consider this as a kludge." |
7 | 1777 |
|
65 | 1778 |
lockUpdates := false. |
7 | 1779 |
|
5478 | 1780 |
scrolledView notNil ifTrue:[ |
1781 |
(scrolledView heightOfContentsDependsOnWidth |
|
1782 |
or:[scrolledView widthOfContentsDependsOnHeight]) ifTrue:[ |
|
1783 |
hideScrollbarIfPointerOutside := false. |
|
1784 |
]. |
|
1785 |
]. |
|
1786 |
||
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1787 |
vScrollBar notNil ifTrue:[ |
5730 | 1788 |
vScrollBar scrollAction: |
1789 |
[:position | |
|
1790 |
"/ in case the event came after the view was already deconstructed |
|
1791 |
scrolledView notNil ifTrue:[ |
|
1792 |
lockUpdates := true. |
|
1793 |
scrolledView scrollVerticalToPercent:position. |
|
1794 |
lockUpdates := false |
|
1795 |
]. |
|
1796 |
]. |
|
1797 |
||
1798 |
vScrollBar scrollUpAction: |
|
1799 |
[ |
|
1800 |
|sensor| |
|
1801 |
"/ in case the event came after the view was already deconstructed |
|
1802 |
scrolledView notNil ifTrue:[ |
|
1803 |
sensor := self sensor. |
|
1804 |
(sensor shiftDown or:[sensor ctrlDown]) ifTrue:[ |
|
1805 |
scrolledView scrollToTop |
|
1806 |
] ifFalse:[ |
|
1807 |
scrolledView scrollUp |
|
1808 |
] |
|
1809 |
]. |
|
1810 |
]. |
|
1811 |
||
1812 |
vScrollBar scrollDownAction: |
|
1813 |
[ |
|
1814 |
|sensor| |
|
1815 |
||
1816 |
"/ in case the event came after the view was already deconstructed |
|
1817 |
scrolledView notNil ifTrue:[ |
|
1818 |
sensor := self sensor. |
|
1819 |
(sensor shiftDown or:[sensor ctrlDown]) ifTrue:[ |
|
1820 |
scrolledView scrollToBottom |
|
1821 |
] ifFalse:[ |
|
1822 |
scrolledView scrollDown |
|
1823 |
] |
|
1824 |
]. |
|
1825 |
]. |
|
7 | 1826 |
]. |
5730 | 1827 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1828 |
hScrollBar notNil ifTrue:[ |
5730 | 1829 |
hScrollBar scrollAction: |
1830 |
[:position | |
|
1831 |
"/ in case the event came after the view was already deconstructed |
|
1832 |
scrolledView notNil ifTrue:[ |
|
1833 |
lockUpdates := true. |
|
1834 |
scrolledView scrollHorizontalToPercent:position. |
|
1835 |
lockUpdates := false |
|
1836 |
]. |
|
1837 |
]. |
|
1838 |
||
1839 |
hScrollBar scrollUpAction: |
|
1840 |
[ |
|
1841 |
|sensor| |
|
1842 |
||
1843 |
"/ in case the event came after the view was already deconstructed |
|
1844 |
scrolledView notNil ifTrue:[ |
|
1845 |
sensor := self sensor. |
|
1846 |
(sensor shiftDown or:[sensor ctrlDown]) ifTrue:[ |
|
1847 |
scrolledView scrollToLeft |
|
1848 |
] ifFalse:[ |
|
1849 |
scrolledView scrollLeft |
|
1850 |
] |
|
1851 |
]. |
|
1852 |
]. |
|
1853 |
||
1854 |
hScrollBar scrollDownAction: |
|
1855 |
[ |
|
1856 |
|sensor| |
|
1857 |
||
1858 |
"/ in case the event came after the view was already deconstructed |
|
1859 |
scrolledView notNil ifTrue:[ |
|
1860 |
sensor := self sensor. |
|
1861 |
(sensor shiftDown or:[sensor ctrlDown]) ifTrue:[ |
|
1862 |
scrolledView scrollToRight |
|
1863 |
] ifFalse:[ |
|
1864 |
scrolledView scrollRight |
|
1865 |
] |
|
1866 |
]. |
|
1867 |
]. |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1868 |
]. |
7 | 1869 |
|
65 | 1870 |
scrolledView addDependent:self. |
814 | 1871 |
|
1872 |
" |
|
1873 |
pass my keyboard input (and other subviews input) |
|
1874 |
to the scrolled view ... |
|
1875 |
" |
|
1876 |
self delegate:(KeyboardForwarder toView:scrolledView). |
|
1877 |
||
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1878 |
"Modified: 6.3.1997 / 17:03:43 / cg" |
1111 | 1879 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1880 |
! |
|
1881 |
||
2526 | 1882 |
setVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH |
1883 |
"set scrollbar-flags as specified in the arguments" |
|
1111 | 1884 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1885 |
|noMiniScrollers| |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1886 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1887 |
vScrollBarHidden := hScrollBarHidden := false. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1888 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1889 |
hasVerticalScrollBar := isVertical. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1890 |
hasHorizontalScrollBar := isHorizontal. |
1111 | 1891 |
|
2526 | 1892 |
noMiniScrollers := StyleSheet at:#'scrollBar.neverMini' default:false. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1893 |
verticalMini := miniV. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1894 |
horizontalMini := miniH. |
1753
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1895 |
|
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1896 |
noMiniScrollers == true ifTrue:[ |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1897 |
verticalMini := false. |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1898 |
horizontalMini := false. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1899 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1900 |
|
2526 | 1901 |
! |
1902 |
||
1903 |
setupVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH |
|
1904 |
"setup scrollbars as specified in the arguments" |
|
1905 |
||
1906 |
self setVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH. |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1907 |
self setupViews. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1908 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1909 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1910 |
setupViews |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1911 |
"setup scrollbars as specified in the arguments" |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1912 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1913 |
|cls| |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1914 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1915 |
hasVerticalScrollBar ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1916 |
cls := ScrollBar. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1917 |
verticalMini ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1918 |
cls := MiniScroller |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1919 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1920 |
(vScrollBar notNil |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1921 |
and:[vScrollBar class ~~ cls]) ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1922 |
self releaseVerticalScrollBar |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1923 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1924 |
vScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1925 |
vScrollBar := cls in:self. |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1926 |
"/ realized ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1927 |
vScrollBar beVisible. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1928 |
"/ vScrollBar realize. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1929 |
vScrollBarHidden := false. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1930 |
"/ ] |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1931 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1932 |
vScrollBar thumbOrigin:0 thumbHeight:100. |
5461 | 1933 |
vScrollBar addDependent:self. |
1111 | 1934 |
] ifFalse:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1935 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1936 |
self releaseVerticalScrollBar |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1937 |
] |
1111 | 1938 |
]. |
1939 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1940 |
hasHorizontalScrollBar ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1941 |
cls := HorizontalScrollBar. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1942 |
horizontalMini ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1943 |
cls := HorizontalMiniScroller |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1944 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1945 |
(hScrollBar notNil |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1946 |
and:[hScrollBar class ~~ cls]) ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1947 |
self releaseHorizontalScrollBar |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1948 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1949 |
hScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1950 |
hScrollBar := cls in:self. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1951 |
realized ifTrue:[ |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1952 |
hScrollBar beVisible. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1953 |
"/ hScrollBar realize. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1954 |
hScrollBarHidden := false. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1955 |
] |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1956 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1957 |
hScrollBar thumbOrigin:0 thumbHeight:100. |
5461 | 1958 |
hScrollBar addDependent:self. |
1111 | 1959 |
] ifFalse:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1960 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1961 |
self releaseHorizontalScrollBar |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1962 |
] |
1111 | 1963 |
]. |
1964 |
||
1965 |
scrolledView notNil ifTrue:[ |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1966 |
self setScrollActions. |
1111 | 1967 |
] |
1968 |
||
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1969 |
"Created: / 6.3.1997 / 18:06:23 / cg" |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1970 |
"Modified: / 24.8.2001 / 14:58:26 / cg" |
7 | 1971 |
! ! |
1972 |
||
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1973 |
!ScrollableView methodsFor:'layout'! |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1974 |
|
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1975 |
horizontalScrollBarLayout:aLayout |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1976 |
hScrollBar layout:aLayout |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1977 |
! |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1978 |
|
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1979 |
scrolledViewLayout:aLayout |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1980 |
scrolledView layout:aLayout |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1981 |
! |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1982 |
|
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1983 |
setupDimensionsConfigureScrolledView:configureScrolledView |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1984 |
"set the components dimensions (i.e. layouts) according to |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1985 |
the scrollability and hidden settings. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1986 |
This may heavily move around the parts ... |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1987 |
This method is overly complex and we should think about alternatives; |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1988 |
the reason is that it tries to shift views so that borders overlap |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1989 |
(to avoid thick borders in-between components). |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1990 |
This is very questionable, since borders are only used with 2D styles, |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1991 |
and those 2D styles are more-or-less obsolete anyway. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1992 |
" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1993 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1994 |
|usedScrolledViewHMargin usedScrolledViewVMargin |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1995 |
usedScrollBarHSpacing usedScrollBarVSpacing hasV hasH |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1996 |
vBd "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1997 |
hBd "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1998 |
sBd "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1999 |
wVScroll "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2000 |
hHScroll "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2001 |
hLeftOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2002 |
hRightOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2003 |
hTopOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2004 |
hBottomOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2005 |
sLeftOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2006 |
sRightOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2007 |
sTopOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2008 |
sBottomOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2009 |
vLeftOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2010 |
vRightOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2011 |
vTopOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2012 |
vBottomOffs "{ Class: SmallInteger }" |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2013 |
addMargin "{ Class: SmallInteger }" |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2014 |
scrolledViewLevel |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2015 |
| |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2016 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2017 |
sBd := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2018 |
DefaultScrolledViewBorderWidth notNil ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2019 |
sBd := DefaultScrolledViewBorderWidth. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2020 |
scrolledView notNil ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2021 |
scrolledView borderWidth:DefaultScrolledViewBorderWidth. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2022 |
] |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2023 |
] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2024 |
scrolledView notNil ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2025 |
sBd := scrolledView borderWidth |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2026 |
] |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2027 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2028 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2029 |
(hasV := (vScrollBar notNil and:[vScrollBarHidden not])) ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2030 |
vBd := vScrollBar borderWidth. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2031 |
wVScroll := vScrollBar widthIncludingBorder. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2032 |
] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2033 |
vBd := wVScroll := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2034 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2035 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2036 |
(hasH := (hScrollBar notNil and:[hScrollBarHidden not])) ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2037 |
hBd := hScrollBar borderWidth. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2038 |
hHScroll := hScrollBar heightIncludingBorder. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2039 |
] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2040 |
hBd := hHScroll := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2041 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2042 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2043 |
"/ the raw layout ... |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2044 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2045 |
scrolledViewLayout := ((0.0 @ 0.0) corner:(1.0@1.0)) asLayout. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2046 |
hScrollBarLayout := ((0.0 @ 1.0) corner:(1.0@1.0)) asLayout. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2047 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2048 |
"/ the painful details; mostly complicated for 2D styles, |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2049 |
"/ where the positions are setUp to overlay borders ... |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2050 |
"/ (well, with 3D styles, a single pixel error will not be noticed; |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2051 |
"/ but 2D styles are very sensitive to those; |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2052 |
"/ the code below may not work correctly with different borderWidths). |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2053 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2054 |
"/ DefaultScrolledViewMargin := 10. "/ margin around |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2055 |
"/ DefaultScrollBarSpacing := 2. "/ space between scrolledView and scrollBar. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2056 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2057 |
usedScrolledViewHMargin := self usedScrolledViewHMarginWhenHasV:hasV andHasH:hasH. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2058 |
usedScrolledViewVMargin := self usedScrolledViewVMarginWhenHasV:hasV andHasH:hasH. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2059 |
usedScrollBarVSpacing := self usedScrollBarVSpacingWhenHasV:hasV andHasH:hasH. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2060 |
usedScrollBarHSpacing := self usedScrollBarHSpacingWhenHasV:hasV andHasH:hasH. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2061 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2062 |
vTopOffs := 0 - vBd + usedScrolledViewVMargin + margin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2063 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2064 |
usedScrolledViewVMargin == 0 ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2065 |
vBottomOffs := vBd - sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2066 |
] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2067 |
vBottomOffs := vBd - usedScrolledViewVMargin + sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2068 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2069 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2070 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2071 |
hLeftOffs := 0 - hBd + usedScrolledViewHMargin + margin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2072 |
hRightOffs := hBd - usedScrolledViewHMargin - sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2073 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2074 |
sLeftOffs := 0 - hBd + usedScrolledViewHMargin + margin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2075 |
sRightOffs := hBd - usedScrolledViewHMargin - sBd - sBd - sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2076 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2077 |
usedScrolledViewVMargin == 0 ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2078 |
sTopOffs := 0 - sBd + margin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2079 |
sBottomOffs := sBd - sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2080 |
] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2081 |
sTopOffs := 0 + usedScrolledViewVMargin + margin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2082 |
sBottomOffs := sBd - usedScrolledViewVMargin - sBd - sBd - sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2083 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2084 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2085 |
"/ kludge - for now |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2086 |
(styleSheet at:#'scrolledView.zeroOffsets') == true ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2087 |
vTopOffs := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2088 |
hLeftOffs := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2089 |
sLeftOffs := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2090 |
sTopOffs := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2091 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2092 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2093 |
addMargin := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2094 |
"/ DefaultScrollBarLevel == DefaultScrolledViewLevel |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2095 |
"/ addMargin := 1. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2096 |
"/ ]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2097 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2098 |
hasV ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2099 |
scrollBarPosition == #right ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2100 |
"/ right/bottom |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2101 |
vScrollBarLayout := ((1.0 @ 0.0) corner:(1.0@1.0)) asLayout. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2102 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2103 |
vRightOffs := 0 - usedScrolledViewHMargin + margin "???". |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2104 |
vLeftOffs := vRightOffs - wVScroll. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2105 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2106 |
sRightOffs := sRightOffs - usedScrollBarHSpacing - wVScroll + sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2107 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2108 |
hRightOffs := hRightOffs - wVScroll - usedScrollBarHSpacing - sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2109 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2110 |
sRightOffs := sRightOffs - addMargin |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2111 |
] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2112 |
"/ left/top |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2113 |
vScrollBarLayout := ((0.0 @ 0.0) corner:(0.0@1.0)) asLayout. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2114 |
vLeftOffs := 0 - vBd + usedScrolledViewHMargin + margin. |
2643 | 2115 |
vRightOffs := vLeftOffs + wVScroll "+ margin". |
2116 |
||
2117 |
sLeftOffs := vRightOffs + usedScrollBarHSpacing. |
|
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2118 |
sRightOffs := 0 - usedScrolledViewHMargin - margin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2119 |
hLeftOffs := hLeftOffs + wVScroll + vBd + usedScrollBarHSpacing. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2120 |
|
2643 | 2121 |
sLeftOffs := sLeftOffs + addMargin. |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2122 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2123 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2124 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2125 |
hasH ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2126 |
hBottomOffs := 0 - usedScrolledViewVMargin - hBd + margin "???". |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2127 |
hTopOffs := hBottomOffs - hHScroll. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2128 |
usedScrolledViewVMargin == 0 ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2129 |
hTopOffs := hTopOffs + sBd + sBd |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2130 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2131 |
sBottomOffs := sBottomOffs - usedScrollBarVSpacing - hHScroll. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2132 |
(vScrollBar notNil and:[vScrollBarHidden not]) ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2133 |
vBottomOffs := vBottomOffs - usedScrollBarVSpacing - hHScroll. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2134 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2135 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2136 |
sBottomOffs := sBottomOffs - addMargin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2137 |
hRightOffs := hRightOffs - addMargin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2138 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2139 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2140 |
(hScrollBar notNil |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2141 |
and:[ hScrollBar borderWidth == 0 |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2142 |
and:[sBd ~~ 0 |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2143 |
and:[scrollBarPosition == #right]]]) ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2144 |
hRightOffs := hRightOffs + sBd + sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2145 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2146 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2147 |
scrolledView notNil ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2148 |
scrolledViewLayout |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2149 |
leftOffset:sLeftOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2150 |
rightOffset:sRightOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2151 |
topOffset:sTopOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2152 |
bottomOffset:sBottomOffs. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2153 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2154 |
configureScrolledView ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2155 |
((hideVScrollBar or:[hideHScrollBar]) not |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2156 |
and:[(hScrollBar isNil or:[hScrollBarHidden]) |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2157 |
and:[(vScrollBar isNil or:[vScrollBarHidden])]]) ifTrue:[ |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2158 |
scrolledViewLevel := 0 |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2159 |
] ifFalse:[ |
2337
66d637032be7
level fix (when there is no scrollBar)
Claus Gittinger <cg@exept.de>
parents:
2320
diff
changeset
|
2160 |
(hScrollBar isNil and:[vScrollBar isNil]) ifTrue:[ |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2161 |
scrolledViewLevel := 0 |
2337
66d637032be7
level fix (when there is no scrollBar)
Claus Gittinger <cg@exept.de>
parents:
2320
diff
changeset
|
2162 |
] ifFalse:[ |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2163 |
scrolledViewLevel := DefaultScrolledViewLevel. |
2337
66d637032be7
level fix (when there is no scrollBar)
Claus Gittinger <cg@exept.de>
parents:
2320
diff
changeset
|
2164 |
] |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2165 |
]. |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2166 |
scrolledView level:scrolledViewLevel |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2167 |
]. |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2168 |
self scrolledViewLayout:scrolledViewLayout. |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2169 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2170 |
hasH ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2171 |
hScrollBarLayout |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2172 |
leftOffset:hLeftOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2173 |
rightOffset:hRightOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2174 |
topOffset:hTopOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2175 |
bottomOffset:hBottomOffs. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2176 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2177 |
hScrollBar level:DefaultScrollBarLevel. |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2178 |
self horizontalScrollBarLayout:hScrollBarLayout. |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2179 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2180 |
"/ scrollBarPosition == #right ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2181 |
"/ "/ right/bottom |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2182 |
"/ hScrollBar viewGravity:#SouthWest. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2183 |
"/ ] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2184 |
"/ hScrollBar viewGravity:#NorthWest. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2185 |
"/ ] |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2186 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2187 |
(hasV and:[vScrollBar notNil and:[vScrollBarHidden not]]) ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2188 |
vScrollBarLayout |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2189 |
leftOffset:vLeftOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2190 |
rightOffset:vRightOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2191 |
topOffset:vTopOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2192 |
bottomOffset:vBottomOffs. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2193 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2194 |
vScrollBar level:DefaultScrollBarLevel. |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2195 |
self verticalScrollBarLayout:vScrollBarLayout. |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2196 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2197 |
"/ scrollBarPosition == #right ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2198 |
"/ "/ right/bottom |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2199 |
"/ vScrollBar viewGravity:#NorthEast. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2200 |
"/ ] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2201 |
"/ vScrollBar viewGravity:#NorthWest. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2202 |
"/ ] |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2203 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2204 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2205 |
"Created: / 21.5.1998 / 00:48:35 / cg" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2206 |
"Modified: / 11.2.2000 / 00:00:36 / cg" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2207 |
! |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2208 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2209 |
usedScrollBarHSpacingWhenHasV:hasV andHasH:hasH |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2210 |
"return the horizontal spacing between scrollBar and scrolledView. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2211 |
Made a separate method to allow subclasses to overwrite this (subCanvas)" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2212 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2213 |
^ hasV ifTrue:[scrollBarHSpacing] ifFalse:[0] |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2214 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2215 |
! |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2216 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2217 |
usedScrollBarVSpacingWhenHasV:hasV andHasH:hasH |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2218 |
"return the vertical spacing between scrollBar and scrolledView. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2219 |
Made a separate method to allow subclasses to overwrite this (subCanvas)" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2220 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2221 |
^ hasH ifTrue:[scrollBarVSpacing] ifFalse:[0] |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2222 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2223 |
! |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2224 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2225 |
usedScrolledViewHMarginWhenHasV:hasV andHasH:hasH |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2226 |
"return the horizontal margin around (outer margin). |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2227 |
Made a separate method to allow subclasses to overwrite this (subCanvas)" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2228 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2229 |
^ scrolledViewHMargin |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2230 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2231 |
! |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2232 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2233 |
usedScrolledViewVMarginWhenHasV:hasV andHasH:hasH |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2234 |
"return the vertical margin around (outer margin). |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2235 |
Made a separate method to allow subclasses to overwrite this (subCanvas)" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2236 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2237 |
^ scrolledViewVMargin |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2238 |
|
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2239 |
! |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2240 |
|
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2241 |
verticalScrollBarLayout:aLayout |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2242 |
vScrollBar layout:aLayout |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2243 |
! ! |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2244 |
|
217 | 2245 |
!ScrollableView methodsFor:'queries'! |
38 | 2246 |
|
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
2247 |
isHorizontalScrollable |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2248 |
"return true if I am horizontally scrollable" |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
2249 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2250 |
^ hScrollBar notNil |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
2251 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2252 |
"Modified: 6.3.1997 / 17:03:49 / cg" |
1111 | 2253 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2254 |
! |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2255 |
|
1593
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2256 |
isScrollWrapper |
3568
976b80ebcda7
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3509
diff
changeset
|
2257 |
"answer true if this view wraps a possibly larger view and has scroll bars" |
976b80ebcda7
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3509
diff
changeset
|
2258 |
|
1593
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2259 |
^ true |
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2260 |
|
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2261 |
"Created: / 20.6.1998 / 14:15:42 / cg" |
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2262 |
! |
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2263 |
|
2358 | 2264 |
isScrolling |
2265 |
"true, if scrollbars thumb is being moved (by user)" |
|
2266 |
||
2267 |
^ (vScrollBar notNil and:[vScrollBar isScrolling]) |
|
2268 |
or:[ |
|
2269 |
(hScrollBar notNil and:[hScrollBar isScrolling]) |
|
2270 |
] |
|
2271 |
! |
|
2272 |
||
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2273 |
isVerticalScrollable |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2274 |
"return true if I am vertically scrollable" |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2275 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2276 |
^ vScrollBar notNil |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2277 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2278 |
"Modified: 6.3.1997 / 17:03:52 / cg" |
1111 | 2279 |
"Created: 6.3.1997 / 18:06:23 / cg" |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
2280 |
! |
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
2281 |
|
217 | 2282 |
preferredExtent |
572 | 2283 |
"return my preferredExtent from the scrolledViews prefExtent |
2284 |
plus the size of the scrollBar" |
|
2285 |
||
1855 | 2286 |
|slavesPref prefX prefY margin| |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2287 |
|
3767
30ede36bb2ee
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3685
diff
changeset
|
2288 |
"/ If I have an explicit preferredExtent.. |
30ede36bb2ee
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3685
diff
changeset
|
2289 |
explicitExtent notNil ifTrue:[ |
30ede36bb2ee
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3685
diff
changeset
|
2290 |
^ explicitExtent |
30ede36bb2ee
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3685
diff
changeset
|
2291 |
]. |
30ede36bb2ee
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3685
diff
changeset
|
2292 |
|
30ede36bb2ee
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3685
diff
changeset
|
2293 |
"/ If I have a cached preferredExtent value.. |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
2294 |
preferredExtent notNil ifTrue:[ |
1855 | 2295 |
^ preferredExtent |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
2296 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
2297 |
|
217 | 2298 |
scrolledView notNil ifTrue:[ |
1855 | 2299 |
slavesPref := scrolledView preferredExtent. |
2300 |
prefX := slavesPref x. |
|
2301 |
prefY := slavesPref y. |
|
2302 |
margin := (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
|
2303 |
vScrollBar notNil ifTrue:[ |
|
2304 |
prefX := prefX + vScrollBar width + margin. |
|
2305 |
]. |
|
2306 |
hScrollBar notNil ifTrue:[ |
|
2307 |
prefY := prefY + hScrollBar height + margin. |
|
2308 |
]. |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2309 |
|
1855 | 2310 |
^ prefX @ prefY. |
0 | 2311 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2312 |
|
217 | 2313 |
^ super preferredExtent. |
572 | 2314 |
|
1111 | 2315 |
"Created: 6.3.1997 / 18:06:24 / cg" |
2316 |
"Modified: 6.3.1997 / 22:34:09 / cg" |
|
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2317 |
! |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2318 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2319 |
preferredExtentForLines:numLines cols:numCols |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2320 |
"return my preferredExtent from the scrolledViews prefExtent |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2321 |
plus the size of the scrollBar" |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2322 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2323 |
|slavesPref prefX prefY| |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2324 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2325 |
"/ If I have an explicit preferredExtent .. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2326 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2327 |
preferredExtent notNil ifTrue:[ |
3012 | 2328 |
^ preferredExtent |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2329 |
]. |
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2330 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2331 |
scrolledView notNil ifTrue:[ |
3012 | 2332 |
slavesPref := scrolledView preferredExtentForLines:numLines cols:numCols. |
2333 |
prefX := slavesPref x. |
|
2334 |
prefY := slavesPref y. |
|
2335 |
vScrollBar notNil ifTrue:[ |
|
2336 |
prefX := prefX + vScrollBar width + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
|
2337 |
]. |
|
2338 |
hScrollBar notNil ifTrue:[ |
|
2339 |
prefY := prefY + hScrollBar height + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
|
2340 |
]. |
|
2341 |
||
2342 |
^ prefX @ prefY. |
|
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2343 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2344 |
|
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2345 |
^ super preferredExtent. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2346 |
|
1111 | 2347 |
"Created: 6.3.1997 / 18:06:24 / cg" |
2348 |
"Modified: 6.3.1997 / 22:34:30 / cg" |
|
1231 | 2349 |
! |
2350 |
||
2351 |
specClass |
|
1378 | 2352 |
"redefined, since my subclasses also want ScrollableViewSpecs" |
2353 |
||
1231 | 2354 |
^ ScrollableViewSpec |
2355 |
||
1378 | 2356 |
"Modified: / 31.10.1997 / 19:48:48 / cg" |
0 | 2357 |
! ! |
2358 |
||
2359 |
!ScrollableView methodsFor:'slave-view messages'! |
|
2360 |
||
1024 | 2361 |
clear |
1138 | 2362 |
"convenient method: forward this to the scrolledView" |
2363 |
||
1073 | 2364 |
scrolledView notNil ifTrue:[scrolledView clear] |
1024 | 2365 |
|
1111 | 2366 |
"Created: 6.3.1997 / 18:06:24 / cg" |
1138 | 2367 |
"Modified: 19.3.1997 / 16:34:19 / cg" |
1024 | 2368 |
! |
2369 |
||
2927 | 2370 |
clearView |
2371 |
"convenient method: forward this to the scrolledView" |
|
2372 |
||
2373 |
scrolledView notNil ifTrue:[scrolledView clearView] |
|
2374 |
! |
|
2375 |
||
217 | 2376 |
doesNotUnderstand:aMessage |
2377 |
"this is funny: all message we do not understand, are passed |
|
2378 |
on to the scrolledView - so we do not have to care for all |
|
2379 |
possible messages ...(thanks to the Message class)" |
|
2380 |
||
3006 | 2381 |
scrolledView notNil ifTrue:[ |
2382 |
^ aMessage sendTo:scrolledView. |
|
1111 | 2383 |
]. |
2384 |
^ super doesNotUnderstand:aMessage |
|
2385 |
||
2386 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
2387 |
"Modified: 6.3.1997 / 18:38:54 / cg" |
|
217 | 2388 |
! |
2389 |
||
2195
2117849dec53
forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
2390 |
flash |
2117849dec53
forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
2391 |
"convenient method: forward this to the scrolledView" |
2117849dec53
forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
2392 |
|
2117849dec53
forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
2393 |
scrolledView notNil ifTrue:[scrolledView flash] |
2117849dec53
forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
2394 |
! |
2117849dec53
forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
2395 |
|
5407 | 2396 |
flash:message withColor:flashColor |
2397 |
"convenient method: forward this to the scrolledView" |
|
2398 |
||
2399 |
scrolledView notNil ifTrue:[ |
|
2400 |
scrolledView flash:message withColor:flashColor |
|
2401 |
] |
|
2402 |
! |
|
2403 |
||
2271 | 2404 |
font:aFont |
2405 |
super font:aFont. |
|
2934
ede340a08539
forward font changes to the scrolledView
Claus Gittinger <cg@exept.de>
parents:
2927
diff
changeset
|
2406 |
scrolledView notNil ifTrue:[ |
ede340a08539
forward font changes to the scrolledView
Claus Gittinger <cg@exept.de>
parents:
2927
diff
changeset
|
2407 |
scrolledView font:aFont |
ede340a08539
forward font changes to the scrolledView
Claus Gittinger <cg@exept.de>
parents:
2927
diff
changeset
|
2408 |
] |
2271 | 2409 |
! |
2410 |
||
0 | 2411 |
leftButtonMenu |
38 | 2412 |
"return scrolledViews leftbuttonmenu" |
2413 |
||
2414 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 2415 |
^ scrolledView leftButtonMenu |
1111 | 2416 |
|
2417 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2418 |
! |
2419 |
||
2420 |
leftButtonMenu:aMenu |
|
2421 |
"pass on leftbuttonmenu to scrolledView" |
|
2422 |
||
2423 |
scrolledView leftButtonMenu:aMenu |
|
1111 | 2424 |
|
2425 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2426 |
! |
2427 |
||
2428 |
middleButtonMenu |
|
38 | 2429 |
"return scrolledViews middlebuttonmenu" |
2430 |
||
2431 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 2432 |
^ scrolledView middleButtonMenu |
1111 | 2433 |
|
2434 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2435 |
! |
2436 |
||
2437 |
middleButtonMenu:aMenu |
|
2438 |
"pass on middlebuttonmenu to scrolledView" |
|
2439 |
||
3685 | 2440 |
scrolledView notNil ifTrue:[ |
2441 |
scrolledView middleButtonMenu:aMenu |
|
2442 |
]. |
|
1111 | 2443 |
|
2444 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
3685 | 2445 |
|
2446 |
||
2447 |
||
2448 |
||
0 | 2449 |
! |
2450 |
||
562 | 2451 |
model |
754 | 2452 |
"return my scrolledViews model" |
2453 |
||
1085 | 2454 |
scrolledView isNil ifTrue:[^ nil]. |
562 | 2455 |
^ scrolledView model |
2456 |
||
1085 | 2457 |
"Modified: 1.3.1997 / 01:38:07 / cg" |
1111 | 2458 |
"Created: 6.3.1997 / 18:06:24 / cg" |
562 | 2459 |
! |
2460 |
||
2461 |
model:aModel |
|
754 | 2462 |
"forward model change to my scrolledViews" |
2463 |
||
562 | 2464 |
^ scrolledView model:aModel |
2465 |
||
754 | 2466 |
"Modified: 5.6.1996 / 17:09:50 / cg" |
1111 | 2467 |
"Created: 6.3.1997 / 18:06:24 / cg" |
562 | 2468 |
! |
2469 |
||
1827 | 2470 |
requestFocus |
2986 | 2471 |
scrolledView notNil ifTrue:[ |
2472 |
^ scrolledView requestFocus |
|
2473 |
]. |
|
2474 |
^ false. |
|
1827 | 2475 |
! |
2476 |
||
0 | 2477 |
rightButtonMenu |
38 | 2478 |
"return scrolledViews rightbuttonmenu" |
2479 |
||
2480 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 2481 |
^ scrolledView rightButtonMenu |
1111 | 2482 |
|
2483 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2484 |
! |
2485 |
||
2486 |
rightButtonMenu:aMenu |
|
2487 |
"pass on rightbuttonmenu to scrolledView" |
|
2488 |
||
2489 |
scrolledView rightButtonMenu:aMenu |
|
1111 | 2490 |
|
2491 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
38 | 2492 |
! ! |
2493 |
||
852 | 2494 |
!ScrollableView class methodsFor:'documentation'! |
0 | 2495 |
|
217 | 2496 |
version |
5407 | 2497 |
^ '$Header$' |
5022 | 2498 |
! |
2499 |
||
2500 |
version_CVS |
|
5407 | 2501 |
^ '$Header$' |
0 | 2502 |
! ! |
4827 | 2503 |