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