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