author | Stefan Vogel <sv@exept.de> |
Wed, 16 May 2018 09:01:02 +0200 | |
changeset 6322 | d6cd7f125437 |
parent 6308 | 480237def600 |
child 6355 | b12ec55db867 |
permissions | -rw-r--r-- |
6307 | 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 |
|
1354 | 971 |
<resource: #style (#'scrolledView.level' #'scrolledView.margin' |
3012 | 972 |
#'scrolledView.borderWidth' |
973 |
#'scrollBar.spacing' #'scrollBar.level' |
|
974 |
#'scrollableView.level' #'scrollableView.backgroundColor' )> |
|
1111 | 975 |
|
976 |
|defLevel defMargin defSpacing| |
|
444
ef26eba8c854
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
300
diff
changeset
|
977 |
|
1111 | 978 |
StyleSheet is3D ifTrue:[ |
3012 | 979 |
defLevel := -1. |
980 |
defMargin := ViewSpacing // 2. |
|
981 |
defSpacing := defMargin. |
|
217 | 982 |
] ifFalse:[ |
3012 | 983 |
defLevel := 0. |
984 |
defMargin := 0. |
|
985 |
defSpacing := 0 |
|
217 | 986 |
]. |
1870 | 987 |
DefaultScrolledViewLevel := StyleSheet at:#'scrolledView.level' default:defLevel. |
988 |
DefaultScrolledViewBorderWidth := StyleSheet at:#'scrolledView.borderWidth' default:nil. |
|
989 |
DefaultScrolledViewMargin := StyleSheet at:#'scrolledView.margin' default:defMargin. |
|
990 |
DefaultScrollBarSpacing := StyleSheet at:#'scrollBar.spacing' default:defSpacing. |
|
991 |
DefaultLevel := StyleSheet at:#'scrollableView.level' default:nil. |
|
992 |
DefaultScrollBarLevel := StyleSheet at:#'scrollBar.level' default:nil. |
|
993 |
MyDefaultViewBackgroundColor := StyleSheet at:#'scrollableView.backgroundColor' default:DefaultViewBackgroundColor. |
|
0 | 994 |
|
1111 | 995 |
" |
996 |
self updateStyleCache |
|
997 |
" |
|
998 |
||
1378 | 999 |
"Modified: / 31.10.1997 / 20:57:10 / cg" |
217 | 1000 |
! ! |
1001 |
||
1140 | 1002 |
!ScrollableView methodsFor:'accessing-behavior'! |
1003 |
||
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1004 |
autoHideHorizontalScrollBar:aBoolean |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1005 |
"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
|
1006 |
be made invisible dynamically, if there is nothing to scroll |
5823 | 1007 |
(and shown if there is). |
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1008 |
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
|
1009 |
|
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1010 |
hideHScrollBar := aBoolean. |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1011 |
|
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1012 |
"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
|
1013 |
"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
|
1014 |
! |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1015 |
|
1140 | 1016 |
autoHideScrollBars:aBoolean |
1017 |
"set/clear the flag which controls if scrollBars should |
|
1018 |
be made invisible dynamically, if there is nothing to scroll |
|
5823 | 1019 |
(and shown if there is). |
1140 | 1020 |
This flags setting is normally controlled by the styleSheet." |
1021 |
||
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1022 |
hideVScrollBar := hideHScrollBar := aBoolean. |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1023 |
|
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1024 |
"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
|
1025 |
"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
|
1026 |
! |
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1027 |
|
1904 | 1028 |
autoHideVerticalScrollBar:aBoolean |
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1029 |
"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
|
1030 |
be made invisible dynamically, if there is nothing to scroll |
5823 | 1031 |
(and shown if there is). |
1556
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1032 |
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
|
1033 |
|
c4c7839aced4
allow autoHiding of scrollBars to be specified individually.
Claus Gittinger <cg@exept.de>
parents:
1549
diff
changeset
|
1034 |
hideVScrollBar := aBoolean. |
1140 | 1035 |
|
1036 |
"Modified: 19.3.1997 / 16:28:42 / cg" |
|
1037 |
"Created: 19.3.1997 / 17:24:39 / cg" |
|
4827 | 1038 |
! |
1039 |
||
1040 |
readOnly:aBoolean |
|
1041 |
scrolledView readOnly:aBoolean |
|
1140 | 1042 |
! ! |
1043 |
||
1138 | 1044 |
!ScrollableView methodsFor:'accessing-components'! |
119 | 1045 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1046 |
horizontalScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1047 |
"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
|
1048 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1049 |
"/ hScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1050 |
"/ self horizontalScrollable:true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1051 |
"/ ]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1052 |
^ hScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1053 |
|
1549
b64b2dd7d5df
create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents:
1536
diff
changeset
|
1054 |
"Created: / 6.3.1997 / 18:06:23 / cg" |
b64b2dd7d5df
create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents:
1536
diff
changeset
|
1055 |
"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
|
1056 |
! |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1057 |
|
1923
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1058 |
removeSubView:aView |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1059 |
super removeSubView:aView. |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1060 |
aView == scrolledView ifTrue:[ |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1061 |
scrolledView := nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1062 |
]. |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1063 |
aView == vScrollBar ifTrue:[ |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1064 |
vScrollBar := nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1065 |
]. |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1066 |
aView == hScrollBar ifTrue:[ |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1067 |
hScrollBar := nil |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1068 |
]. |
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1069 |
|
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1070 |
|
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1071 |
|
cc9c075f0bc5
defaults for hasHVScrollbar now defined in a class method.
tm
parents:
1904
diff
changeset
|
1072 |
|
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 |
|
217 | 1075 |
scrollBar |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1076 |
"return the vertical scrollbar (or nil, if there is none)" |
217 | 1077 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1078 |
"/ vScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1079 |
"/ self verticalScrollable:true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1080 |
"/ ]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1081 |
^ vScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1082 |
|
1549
b64b2dd7d5df
create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents:
1536
diff
changeset
|
1083 |
"Created: / 6.3.1997 / 18:06:23 / cg" |
b64b2dd7d5df
create scrollbars, when accessed
Claus Gittinger <cg@exept.de>
parents:
1536
diff
changeset
|
1084 |
"Modified: / 25.5.1998 / 12:54:06 / cg" |
119 | 1085 |
! |
1086 |
||
217 | 1087 |
scrolledView |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1088 |
"return the scrolled view (or nil, if there is none)" |
38 | 1089 |
|
217 | 1090 |
^ scrolledView |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1091 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1092 |
"Modified: 6.3.1997 / 16:48:09 / cg" |
1111 | 1093 |
"Created: 6.3.1997 / 18:06:23 / cg" |
113 | 1094 |
! |
1095 |
||
217 | 1096 |
scrolledView:aView |
1097 |
"set the view to scroll" |
|
1098 |
||
2319
83b000a1928a
ignore useless scrolledView setting.
Claus Gittinger <cg@exept.de>
parents:
2272
diff
changeset
|
1099 |
aView == scrolledView ifTrue:[^ self "already"]. |
83b000a1928a
ignore useless scrolledView setting.
Claus Gittinger <cg@exept.de>
parents:
2272
diff
changeset
|
1100 |
|
217 | 1101 |
scrolledView notNil ifTrue:[ |
2271 | 1102 |
scrolledView removeDependent:self. |
1103 |
scrolledView destroy. |
|
1104 |
scrolledView := nil. |
|
217 | 1105 |
]. |
982 | 1106 |
|
217 | 1107 |
scrolledView := aView. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1108 |
|
2320
158b10553017
scrolledView setting (nil arg)
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
1109 |
aView notNil ifTrue:[ |
158b10553017
scrolledView setting (nil arg)
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
1110 |
super addSubViewFirst:aView. |
2271 | 1111 |
self setScrollActions. |
217 | 1112 |
|
2271 | 1113 |
realized ifTrue:[ |
1114 |
self setupDimensionsConfigureScrolledView:true. |
|
1115 |
self sizeChanged:nil. |
|
2320
158b10553017
scrolledView setting (nil arg)
Claus Gittinger <cg@exept.de>
parents:
2319
diff
changeset
|
1116 |
aView realize |
2271 | 1117 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1118 |
] |
217 | 1119 |
|
1535
b769ae01e418
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
1120 |
"Modified: / 19.3.1997 / 15:32:37 / stefan" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1121 |
"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
|
1122 |
! |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1123 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1124 |
verticalScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1125 |
"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
|
1126 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1127 |
"/ vScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1128 |
"/ self verticalScrollable:true. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1129 |
"/ ]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1130 |
^ vScrollBar |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1131 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1132 |
"Modified: 6.3.1997 / 16:59:24 / cg" |
1111 | 1133 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1253 | 1134 |
! |
1135 |
||
1136 |
widget |
|
1137 |
"for ST80 compatibility (where a wrapper returns its wrapped |
|
1138 |
widget), return the scrolledView here" |
|
1139 |
||
1140 |
^ scrolledView |
|
1141 |
||
1142 |
"Created: 20.6.1997 / 14:45:16 / cg" |
|
217 | 1143 |
! ! |
1144 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1145 |
!ScrollableView methodsFor:'accessing-look'! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1146 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1147 |
horizontalMini:aBoolean |
1138 | 1148 |
"control the horizontal scrollBar to be either a miniScroller, |
1149 |
or a full scrollBar." |
|
1150 |
||
2526 | 1151 |
|newMini| |
1152 |
||
1153 |
newMini := aBoolean. |
|
1154 |
(styleSheet at:#'scrollBar.neverMini' default:false) == true ifTrue:[ |
|
1155 |
newMini := false. |
|
1156 |
]. |
|
1157 |
||
1158 |
horizontalMini ~~ newMini ifTrue:[ |
|
1159 |
horizontalMini := newMini. |
|
1160 |
self setupForChangedScrollbars. |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1161 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1162 |
|
1498 | 1163 |
"Created: / 7.3.1997 / 21:57:02 / cg" |
1502 | 1164 |
"Modified: / 22.4.1998 / 22:42:25 / ca" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1165 |
"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
|
1166 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1167 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1168 |
horizontalScrollable:aBoolean |
1138 | 1169 |
"enable/disable horizontal scrollability. |
1170 |
If disabled, the horizontal scrollBar is made invisible." |
|
1171 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1172 |
hasHorizontalScrollBar ~~ aBoolean ifTrue:[ |
1953 | 1173 |
hasHorizontalScrollBar := aBoolean. |
1174 |
hScrollBarHidden := false. |
|
2526 | 1175 |
self setupForChangedScrollbars. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1176 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1177 |
|
1498 | 1178 |
"Created: / 7.3.1997 / 21:56:28 / cg" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1179 |
"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
|
1180 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1181 |
|
2526 | 1182 |
horizontalScrollable:scrollableBoolean miniScroller:miniScrollerBoolean |
1183 |
"enable/disable horizontal scrollability. |
|
1184 |
If disabled, the horizontal scrollBar is made invisible." |
|
1185 |
||
1186 |
|newMini| |
|
1187 |
||
1188 |
newMini := miniScrollerBoolean. |
|
1189 |
(styleSheet at:#'scrollBar.neverMini' default:false) == true ifTrue:[ |
|
1190 |
newMini := false. |
|
1191 |
]. |
|
1192 |
||
1193 |
(hasHorizontalScrollBar ~~ scrollableBoolean |
|
1194 |
or:[scrollableBoolean and:[horizontalMini ~~ newMini]]) ifTrue:[ |
|
1195 |
horizontalMini := newMini. |
|
1196 |
hasHorizontalScrollBar := scrollableBoolean. |
|
1197 |
hScrollBarHidden := false. |
|
1198 |
self setupForChangedScrollbars. |
|
1199 |
]. |
|
1200 |
horizontalMini := newMini. |
|
1201 |
! |
|
1202 |
||
1203 |
setupForChangedScrollbars |
|
1204 |
self setupViews. |
|
1205 |
shown ifTrue:[ |
|
1206 |
self setupDimensionsConfigureScrolledView:false. |
|
1207 |
] |
|
1208 |
! |
|
1209 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1210 |
verticalMini:aBoolean |
1138 | 1211 |
"control the vertical scrollBar to be either a miniScroller, |
1212 |
or a full scrollBar." |
|
1213 |
||
2526 | 1214 |
|newMini| |
1215 |
||
1216 |
newMini := aBoolean. |
|
1217 |
(styleSheet at:#'scrollBar.neverMini' default:false) == true ifTrue:[ |
|
1218 |
newMini := false. |
|
1219 |
]. |
|
1220 |
||
1221 |
verticalMini ~~ newMini ifTrue:[ |
|
1222 |
verticalMini := newMini. |
|
1223 |
self setupForChangedScrollbars. |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1224 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1225 |
|
1498 | 1226 |
"Created: / 7.3.1997 / 21:56:57 / cg" |
1502 | 1227 |
"Modified: / 22.4.1998 / 22:42:32 / ca" |
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1228 |
"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
|
1229 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1230 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1231 |
verticalScrollable:aBoolean |
1138 | 1232 |
"enable/disable vertical scrollability. |
1233 |
If disabled, the vertical scrollBar is made invisible." |
|
1234 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1235 |
hasVerticalScrollBar ~~ aBoolean ifTrue:[ |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1236 |
hasVerticalScrollBar := aBoolean. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1237 |
"/ vScrollBarHidden := false. |
2526 | 1238 |
self setupForChangedScrollbars. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1239 |
] |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1240 |
|
1498 | 1241 |
"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
|
1242 |
"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
|
1243 |
! ! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1244 |
|
2227 | 1245 |
!ScrollableView methodsFor:'change & update'! |
217 | 1246 |
|
5461 | 1247 |
pointerInView |
5488
0d471ab42047
Do not acces device instavar (delegated GC)!!
Stefan Vogel <sv@exept.de>
parents:
5478
diff
changeset
|
1248 |
|pv dev| |
5823 | 1249 |
|
5463 | 1250 |
windowGroup isNil ifTrue:[^ false]. |
5461 | 1251 |
(pv := windowGroup pointerView) isNil ifTrue:[ |
5625 | 1252 |
dev := device. |
1253 |
dev isNil ifTrue:[^ false]. |
|
1254 |
pv := dev viewFromPoint:(dev pointerPosition). |
|
5461 | 1255 |
pv isNil ifTrue:[^ false]. |
1256 |
]. |
|
1257 |
(pv isSameOrComponentOf:self) ifTrue:[^ true]. |
|
5463 | 1258 |
"/ Transcript showCR:pv. |
5461 | 1259 |
^ false. |
1260 |
! |
|
1261 |
||
217 | 1262 |
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
|
1263 |
"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
|
1264 |
be updated as well" |
132 | 1265 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1266 |
|doUpdate| |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1267 |
|
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1268 |
doUpdate := false. |
5461 | 1269 |
|
1270 |
something == #pointerInView ifTrue:[ |
|
5478 | 1271 |
(hideScrollbarIfPointerOutside ? false) ifTrue:[ |
5461 | 1272 |
doUpdate := true |
1273 |
] |
|
1274 |
]. |
|
1275 |
||
217 | 1276 |
changedObject == scrolledView ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1277 |
something == #sizeOfContents ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1278 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1279 |
vScrollBar setThumbFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1280 |
doUpdate := true |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1281 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1282 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1283 |
hScrollBar 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 |
] ifFalse:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1287 |
something == #originOfContents ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1288 |
lockUpdates ifFalse:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1289 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1290 |
vScrollBar setThumbOriginFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1291 |
doUpdate := true |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1292 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1293 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1294 |
hScrollBar 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 |
]. |
5461 | 1298 |
]. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1299 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1300 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1301 |
|
5461 | 1302 |
doUpdate ifTrue:[ |
1303 |
self updateScrollBarVisibility |
|
1304 |
] |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1305 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1306 |
|
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1307 |
updateHScrollBarVisibility |
5461 | 1308 |
|hide anyChange scrollToOriginOnHide| |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1309 |
|
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1310 |
anyChange := false. |
5461 | 1311 |
scrollToOriginOnHide := true. |
1312 |
||
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1313 |
hideHScrollBar ~~ false ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1314 |
hScrollBar notNil ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1315 |
hide := hScrollBar thumbHeight >= 100. |
5461 | 1316 |
hide ifFalse:[ |
5478 | 1317 |
(hideScrollbarIfPointerOutside ? false) ifTrue:[ |
5823 | 1318 |
(self pointerInView) ifFalse:[ |
5461 | 1319 |
scrollToOriginOnHide := false. |
1320 |
hide := true. |
|
1321 |
]. |
|
1322 |
]. |
|
5823 | 1323 |
]. |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1324 |
hide ~~ hScrollBar realized not "hScrollBarHidden" ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1325 |
hScrollBarHidden := hide. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1326 |
hide ifTrue:[ |
5461 | 1327 |
scrollToOriginOnHide ifTrue:[ |
1328 |
"/ just in case: scroll to left |
|
1329 |
scrolledView scrollHorizontalToPercent:0. |
|
5823 | 1330 |
]. |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1331 |
hScrollBar beInvisible |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1332 |
] ifFalse:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1333 |
hScrollBar beVisible |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1334 |
]. |
5022 | 1335 |
"/ hScrollBar setRealized:hide not. |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1336 |
anyChange := true. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1337 |
] |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1338 |
]. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1339 |
]. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1340 |
^ anyChange |
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 |
"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
|
1343 |
"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
|
1344 |
! |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1345 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1346 |
updateScrollBarVisibility |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1347 |
"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
|
1348 |
|
5461 | 1349 |
|anyChange| |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1350 |
|
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1351 |
anyChange := self updateVScrollBarVisibility. |
5753 | 1352 |
"/ evaluating or here |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1353 |
anyChange := anyChange | self updateHScrollBarVisibility. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1354 |
|
5461 | 1355 |
"/ stupid - showing one may need the other and vice versa... |
1356 |
"/ ...therefore, check again |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1357 |
anyChange ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1358 |
self setupDimensionsConfigureScrolledView:false. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1359 |
|
5461 | 1360 |
"/ force bars to recompute... |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1361 |
scrolledView notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1362 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1363 |
vScrollBar setThumbFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1364 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1365 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1366 |
hScrollBar setThumbFor:scrolledView. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1367 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1368 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1369 |
|
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1370 |
anyChange := self updateVScrollBarVisibility. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1371 |
anyChange := anyChange | self updateHScrollBarVisibility. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1372 |
anyChange ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1373 |
self setupDimensionsConfigureScrolledView:false. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1374 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1375 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1376 |
|
1535
b769ae01e418
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1502
diff
changeset
|
1377 |
"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
|
1378 |
"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
|
1379 |
! |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1380 |
|
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1381 |
updateVScrollBarVisibility |
5461 | 1382 |
|hide anyChange scrollToOriginOnHide| |
2397
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 |
anyChange := false. |
5461 | 1385 |
scrollToOriginOnHide := true. |
1386 |
||
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1387 |
hideVScrollBar ~~ false ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1388 |
vScrollBar notNil ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1389 |
hide := vScrollBar thumbHeight >= 100. |
5478 | 1390 |
(hideScrollbarIfPointerOutside ? false) ifTrue:[ |
5823 | 1391 |
(self pointerInView) ifFalse:[ |
5461 | 1392 |
scrollToOriginOnHide := false. |
1393 |
hide := true. |
|
1394 |
]. |
|
5823 | 1395 |
]. |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1396 |
hide ~~ vScrollBar realized not" vScrollBarHidden" ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1397 |
vScrollBarHidden := hide. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1398 |
hide ifTrue:[ |
5823 | 1399 |
scrollToOriginOnHide ifTrue:[ |
5461 | 1400 |
"/ just in case: scroll to top |
5823 | 1401 |
scrolledView scrollVerticalToPercent:0. |
5461 | 1402 |
]. |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1403 |
vScrollBar beInvisible |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1404 |
] ifFalse:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1405 |
vScrollBar beVisible |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1406 |
]. |
5022 | 1407 |
"/vScrollBar setRealized:hide not. |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1408 |
anyChange := true. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1409 |
] |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1410 |
]. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1411 |
]. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1412 |
^ anyChange |
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 |
"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
|
1415 |
"Created: / 24.8.2001 / 15:07:38 / cg" |
217 | 1416 |
! ! |
38 | 1417 |
|
3395 | 1418 |
!ScrollableView methodsFor:'drag & drop'! |
3242 | 1419 |
|
1420 |
dropTarget |
|
1421 |
scrolledView isNil ifTrue:[^ nil]. |
|
1422 |
^ scrolledView dropTarget |
|
1423 |
! |
|
1424 |
||
1425 |
dropTarget:aDropTarget |
|
1426 |
scrolledView isNil ifTrue:[^ self]. |
|
1427 |
scrolledView dropTarget:aDropTarget |
|
1428 |
! ! |
|
1429 |
||
2752 | 1430 |
!ScrollableView methodsFor:'event handling'! |
217 | 1431 |
|
1432 |
keyPress:key x:x y:y |
|
1433 |
"a key was pressed - handle page-keys here" |
|
1434 |
||
1435 |
<resource: #keyboard ( #Prior #Next ) > |
|
1436 |
||
1437 |
(key == #Prior) ifTrue: [^ self pageUp]. |
|
1438 |
(key == #Next) ifTrue: [^ self pageDown]. |
|
1439 |
||
1440 |
super keyPress:key x:x y:y |
|
1111 | 1441 |
|
1442 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
38 | 1443 |
! |
1444 |
||
5461 | 1445 |
pointerEnter:state x:x y:y |
1446 |
super pointerEnter:state x:x y:y. |
|
5478 | 1447 |
(hideScrollbarIfPointerOutside ? false) ifTrue:[ |
5461 | 1448 |
self updateScrollBarVisibility |
5823 | 1449 |
] |
5461 | 1450 |
! |
1451 |
||
1452 |
pointerLeave:state |
|
1453 |
super pointerLeave:state. |
|
1454 |
||
5478 | 1455 |
(hideScrollbarIfPointerOutside ? false) ifTrue:[ |
5461 | 1456 |
self updateScrollBarVisibility |
1457 |
] |
|
1458 |
! |
|
1459 |
||
6307 | 1460 |
repairDamage |
1461 |
scrolledView repairDamage. |
|
1462 |
hScrollBar notNil ifTrue:[ hScrollBar repairDamage ]. |
|
1463 |
vScrollBar notNil ifTrue:[ vScrollBar repairDamage ]. |
|
6308 | 1464 |
super repairDamage. |
6307 | 1465 |
! |
1466 |
||
5073 | 1467 |
requestAutoAccept |
1468 |
"request to accept: this is invoked when a dialog closes via accept or cancel. |
|
1469 |
This forces my value to be accepted into my model. |
|
1470 |
Any widget may suppress the ok/cancel, by returning false." |
|
1471 |
||
1472 |
^ scrolledView requestAutoAccept |
|
1473 |
! |
|
1474 |
||
217 | 1475 |
sizeChanged:how |
1138 | 1476 |
"handle size changes - this may change any scrollBars visibility" |
1477 |
||
1986 | 1478 |
|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
|
1479 |
|
3671
15b7958e549b
dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents:
3590
diff
changeset
|
1480 |
self changed:#sizeOfView with:how. |
15b7958e549b
dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents:
3590
diff
changeset
|
1481 |
|
15b7958e549b
dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents:
3590
diff
changeset
|
1482 |
superView notNil ifTrue:[ |
15b7958e549b
dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents:
3590
diff
changeset
|
1483 |
superView subViewChangedSize |
15b7958e549b
dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents:
3590
diff
changeset
|
1484 |
]. |
15b7958e549b
dont forget to tell my container about size changes
Claus Gittinger <cg@exept.de>
parents:
3590
diff
changeset
|
1485 |
|
1111 | 1486 |
"/ resize components manually, in an order which is optimal |
1487 |
||
1488 |
how == #smaller ifTrue:[ |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1489 |
"/ first resize the horizontalScrollBar, |
1111 | 1490 |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1491 |
scrolledView notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1492 |
scrolledView containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1493 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1494 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1495 |
hScrollBar containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1496 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1497 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1498 |
vScrollBar containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1499 |
]. |
1111 | 1500 |
] ifFalse:[ |
1961
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 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1507 |
scrolledView notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1508 |
scrolledView containerChangedSize |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1509 |
]. |
1111 | 1510 |
]. |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
1511 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1512 |
scrolledView isNil ifTrue:[^ self]. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1513 |
(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
|
1514 |
^ self |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1515 |
]. |
1111 | 1516 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1517 |
vScrollBar notNil ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1518 |
vScrollBar setThumbFor:scrolledView. |
1986 | 1519 |
orgY := vScrollBar thumbOrigin. |
1520 |
thV := vScrollBar thumbHeight. |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1521 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1522 |
hScrollBar notNil ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1523 |
hScrollBar setThumbFor:scrolledView. |
1986 | 1524 |
orgX := hScrollBar thumbOrigin. |
1525 |
thH := hScrollBar thumbHeight. |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1526 |
]. |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1527 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1528 |
"/ 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
|
1529 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1530 |
hScrollBar isNil ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1531 |
"/ only care for vertical ... |
1986 | 1532 |
orgY + thV >= 100 ifTrue:[ |
1533 |
vScrollBar thumbOrigin:(100 - thV). |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1534 |
scrolledView scrollVerticalToPercent:vScrollBar thumbOrigin. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1535 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1536 |
] ifFalse:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1537 |
vScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1538 |
"/ only care for horizontal ... |
1986 | 1539 |
orgX + thH >= 100 ifTrue:[ |
1540 |
hScrollBar thumbOrigin:(100 - thH). |
|
1541 |
scrolledView scrollHorizontalToPercent:hScrollBar thumbOrigin. |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1542 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1543 |
] ifFalse:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1544 |
"/ care for both ... |
113 | 1545 |
|
1986 | 1546 |
scrollH := scrollV := false. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1547 |
|
1986 | 1548 |
orgY + thV >= 100 ifTrue:[ |
1549 |
vScrollBar thumbOrigin:(100 - thV). |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1550 |
orgY := vScrollBar thumbOrigin. |
1986 | 1551 |
scrollV := true. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1552 |
]. |
1986 | 1553 |
orgX + thH >= 100 ifTrue:[ |
1554 |
hScrollBar thumbOrigin:(100 - thH). |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1555 |
orgX := hScrollBar thumbOrigin. |
1986 | 1556 |
scrollH := true. |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1557 |
]. |
1986 | 1558 |
scrollV ifTrue:[ |
1559 |
scrollH ifTrue:[ |
|
1560 |
scrolledView scrollToPercent:(orgX@orgY). |
|
1561 |
] ifFalse:[ |
|
1562 |
scrolledView scrollVerticalToPercent:orgY. |
|
1563 |
] |
|
1564 |
] ifFalse:[ |
|
1565 |
scrollH ifTrue:[ |
|
1566 |
scrolledView scrollHorizontalToPercent:orgX. |
|
1567 |
] |
|
1568 |
] |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1569 |
] |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1570 |
]. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1571 |
self updateScrollBarVisibility. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1572 |
|
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1573 |
"/ just in case there are more views... (DSV - sigh) |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1574 |
subViews do:[:eachSubView | |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1575 |
((eachSubView ~~ scrolledView) |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1576 |
and:[(eachSubView ~~ hScrollBar) |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1577 |
and:[eachSubView ~~ vScrollBar]]) |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1578 |
ifTrue:[ |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1579 |
eachSubView containerChangedSize |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1580 |
] |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1581 |
] |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1582 |
|
1160
f3204cabcce8
must update scrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1583 |
"Modified: 28.3.1997 / 17:25:38 / cg" |
3508 | 1584 |
! |
1585 |
||
1586 |
win32NativeScroll:scrollCode position:newPosition |
|
1587 |
"this is generated by a native scrollBar widget" |
|
1588 |
||
1589 |
scrollCode == #SB_LINEDOWN ifTrue:[ |
|
1590 |
scrolledView scrollDown. |
|
1591 |
^ self. |
|
1592 |
]. |
|
1593 |
scrollCode == #SB_LINEUP ifTrue:[ |
|
1594 |
scrolledView scrollUp. |
|
1595 |
^ self. |
|
1596 |
]. |
|
1597 |
scrollCode == #SB_LINELEFT ifTrue:[ |
|
1598 |
scrolledView scrollLeft. |
|
1599 |
^ self. |
|
1600 |
]. |
|
1601 |
scrollCode == #SB_LINERIGHT ifTrue:[ |
|
1602 |
scrolledView scrollRight. |
|
1603 |
^ self. |
|
1604 |
]. |
|
1605 |
scrollCode == #SB_PAGEDOWN ifTrue:[ |
|
1606 |
self pageDown. |
|
1607 |
^ self. |
|
1608 |
]. |
|
1609 |
scrollCode == #SB_PAGEUP ifTrue:[ |
|
1610 |
self pageUp. |
|
1611 |
^ self. |
|
1612 |
]. |
|
1613 |
scrollCode == #SB_PAGELEFT ifTrue:[ |
|
1614 |
self pageLeft. |
|
1615 |
^ self. |
|
1616 |
]. |
|
1617 |
scrollCode == #SB_PAGERIGHT ifTrue:[ |
|
1618 |
self pageRight. |
|
1619 |
^ self. |
|
1620 |
]. |
|
1621 |
scrollCode == #SB_THUMBPOSITIONVERTICAL ifTrue:[ |
|
1622 |
scrolledView scrollVerticalToPercent:newPosition. |
|
1623 |
^ self. |
|
1624 |
]. |
|
1625 |
scrollCode == #SB_THUMBPOSITIONHORIZONTAL ifTrue:[ |
|
1626 |
scrolledView scrollHorizontalToPercent:newPosition. |
|
1627 |
^ self. |
|
1628 |
]. |
|
1629 |
scrollCode == #SB_THUMBTRACKVERTICAL ifTrue:[ |
|
1630 |
vScrollBar isSynchronous ifTrue:[ |
|
1631 |
scrolledView scrollVerticalToPercent:newPosition. |
|
1632 |
]. |
|
1633 |
^ self. |
|
1634 |
]. |
|
1635 |
scrollCode == #SB_THUMBTRACKHORIZONTAL ifTrue:[ |
|
1636 |
hScrollBar isSynchronous ifTrue:[ |
|
1637 |
scrolledView scrollHorizontalToPercent:newPosition. |
|
1638 |
]. |
|
1639 |
^ self. |
|
1640 |
]. |
|
1641 |
||
1642 |
scrollCode == #SB_ENDSCROLL ifTrue:[ |
|
1643 |
^ self. |
|
1644 |
]. |
|
1645 |
self halt:'unexpected scroll operation'. |
|
217 | 1646 |
! ! |
1647 |
||
1648 |
!ScrollableView methodsFor:'forced scroll'! |
|
1649 |
||
1650 |
pageDown |
|
1138 | 1651 |
"page down - but only if there is a vertical scrollbar" |
217 | 1652 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1653 |
vScrollBar notNil ifTrue:[ |
3012 | 1654 |
vScrollBar pageDown |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1655 |
] |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1656 |
|
1111 | 1657 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1138 | 1658 |
"Modified: 19.3.1997 / 16:32:34 / cg" |
1659 |
! |
|
1660 |
||
1661 |
pageLeft |
|
1662 |
"page left - but only if there is a horizontal scrollbar" |
|
1663 |
||
1664 |
hScrollBar notNil ifTrue:[ |
|
3037 | 1665 |
hScrollBar pageUp |
1138 | 1666 |
] |
1667 |
||
1668 |
"Created: 19.3.1997 / 16:32:14 / cg" |
|
1669 |
"Modified: 19.3.1997 / 16:32:44 / cg" |
|
1670 |
! |
|
1671 |
||
1672 |
pageRight |
|
1673 |
"page right - but only if there is a horizontal scrollbar" |
|
1674 |
||
1675 |
hScrollBar notNil ifTrue:[ |
|
3037 | 1676 |
hScrollBar pageDown |
1138 | 1677 |
] |
1678 |
||
1679 |
"Created: 19.3.1997 / 16:32:22 / cg" |
|
1680 |
"Modified: 19.3.1997 / 16:32:48 / cg" |
|
113 | 1681 |
! |
1682 |
||
217 | 1683 |
pageUp |
1138 | 1684 |
"page up - but only if there is a vertical scrollbar" |
0 | 1685 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1686 |
vScrollBar notNil ifTrue:[ |
3012 | 1687 |
vScrollBar pageUp |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1688 |
] |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1689 |
|
1111 | 1690 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1138 | 1691 |
"Modified: 19.3.1997 / 16:32:38 / cg" |
0 | 1692 |
! ! |
1693 |
||
1694 |
!ScrollableView methodsFor:'initialization'! |
|
1695 |
||
217 | 1696 |
initStyle |
958 | 1697 |
"initialize style specifics" |
1698 |
||
5823 | 1699 |
<resource: #style (#'scrollBar.position' |
5461 | 1700 |
#'scrollBar.hiding' |
1701 |
#'scrollBar.hideIfPointerOutside')> |
|
608 | 1702 |
|
217 | 1703 |
super initStyle. |
1704 |
||
5478 | 1705 |
DefaultLevel notNil ifTrue:[self level:DefaultLevel]. |
5823 | 1706 |
viewBackground := MyDefaultViewBackgroundColor. |
1870 | 1707 |
scrollBarPosition := styleSheet at:#'scrollBar.position' default:#left. |
5478 | 1708 |
"/ this controls hiding if there is nothing to scroll (contents fits) |
1870 | 1709 |
hideHScrollBar := hideVScrollBar := styleSheet at:#'scrollBar.hiding' default:false. |
5478 | 1710 |
"/ this controls automatic hiding if the pointer is outside |
1711 |
hideScrollbarIfPointerOutside := styleSheet at:#'scrollBar.hideIfPointerOutside' default:false. |
|
5823 | 1712 |
|
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1713 |
scrolledViewHMargin := scrolledViewVMargin := DefaultScrolledViewMargin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1714 |
scrollBarVSpacing := scrollBarHSpacing := DefaultScrollBarSpacing. |
5461 | 1715 |
|
1716 |
"/ self level:0. |
|
1717 |
"/ self border:(SimpleBorder width:1 color:Color grey). |
|
0 | 1718 |
! |
1719 |
||
1247 | 1720 |
initialize |
1721 |
"setup some default" |
|
1722 |
||
1723 |
verticalMini := horizontalMini := false. |
|
1724 |
hasVerticalScrollBar := hasHorizontalScrollBar := false. |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1725 |
vScrollBarHidden := hScrollBarHidden := true. |
5478 | 1726 |
hideScrollbarIfPointerOutside := false. |
5823 | 1727 |
|
1247 | 1728 |
super initialize. |
1729 |
! |
|
1730 |
||
0 | 1731 |
realize |
1161
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1732 |
"realize (i.e. make me visible). |
5142fbafeb92
must set dimensions in updateScrollBarVisibility
Claus Gittinger <cg@exept.de>
parents:
1160
diff
changeset
|
1733 |
Since scrolledView may have done something to its contents |
0 | 1734 |
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
|
1735 |
changes; do it now" |
1160
f3204cabcce8
must update scrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1152
diff
changeset
|
1736 |
|
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1737 |
self setupDimensionsConfigureScrolledView:true. |
1176
29d0a646cbdf
must realize before setting scroller values
Claus Gittinger <cg@exept.de>
parents:
1161
diff
changeset
|
1738 |
super realize. |
1201
e7f1cf0180ca
must updateScrollBarVisibility in realize
Claus Gittinger <cg@exept.de>
parents:
1184
diff
changeset
|
1739 |
|
38 | 1740 |
scrolledView notNil ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1741 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1742 |
vScrollBar setThumbFor:scrolledView |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1743 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1744 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1745 |
hScrollBar setThumbFor:scrolledView |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1746 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1747 |
self updateScrollBarVisibility. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1748 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1749 |
|
1536
b8ddd185281a
preserve the scrolledViews level
Claus Gittinger <cg@exept.de>
parents:
1535
diff
changeset
|
1750 |
"Modified: / 21.5.1998 / 00:52:18 / cg" |
1111 | 1751 |
! |
1752 |
||
1753 |
releaseHorizontalScrollBar |
|
1754 |
"destroy any horizontal scrollBar" |
|
1755 |
||
1756 |
hScrollBar notNil ifTrue:[ |
|
5461 | 1757 |
hScrollBar removeDependent:self. |
3012 | 1758 |
hScrollBar destroy. |
1759 |
hScrollBar := nil |
|
1111 | 1760 |
]. |
1761 |
||
1762 |
"Modified: 6.3.1997 / 17:43:20 / cg" |
|
1763 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
1764 |
! |
|
1765 |
||
1766 |
releaseVerticalScrollBar |
|
1767 |
"destroy any vertical scrollBar" |
|
1768 |
||
1769 |
vScrollBar notNil ifTrue:[ |
|
5461 | 1770 |
vScrollBar removeDependent:self. |
3012 | 1771 |
vScrollBar destroy. |
1772 |
vScrollBar := nil |
|
1111 | 1773 |
]. |
1774 |
||
1775 |
"Created: 6.3.1997 / 18:06:23 / cg" |
|
1097 | 1776 |
! |
7 | 1777 |
|
1778 |
setScrollActions |
|
1779 |
"lock prevents repositioning the scroller to the |
|
1780 |
actual (often rounded) position while scrolling, |
|
1781 |
and keeps it instead at the pointer position. |
|
1782 |
||
1783 |
(this avoids run-away scroller when scrolling |
|
1784 |
textviews, when the text is aligned line-wise). |
|
38 | 1785 |
Consider this as a kludge." |
7 | 1786 |
|
65 | 1787 |
lockUpdates := false. |
7 | 1788 |
|
5478 | 1789 |
scrolledView notNil ifTrue:[ |
5823 | 1790 |
(scrolledView heightOfContentsDependsOnWidth |
5478 | 1791 |
or:[scrolledView widthOfContentsDependsOnHeight]) ifTrue:[ |
1792 |
hideScrollbarIfPointerOutside := false. |
|
5823 | 1793 |
]. |
5478 | 1794 |
]. |
5823 | 1795 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1796 |
vScrollBar notNil ifTrue:[ |
5730 | 1797 |
vScrollBar scrollAction: |
1798 |
[:position | |
|
1799 |
"/ in case the event came after the view was already deconstructed |
|
1800 |
scrolledView notNil ifTrue:[ |
|
1801 |
lockUpdates := true. |
|
1802 |
scrolledView scrollVerticalToPercent:position. |
|
1803 |
lockUpdates := false |
|
1804 |
]. |
|
1805 |
]. |
|
1806 |
||
1807 |
vScrollBar scrollUpAction: |
|
5823 | 1808 |
[ |
5730 | 1809 |
|sensor| |
1810 |
"/ in case the event came after the view was already deconstructed |
|
1811 |
scrolledView notNil ifTrue:[ |
|
1812 |
sensor := self sensor. |
|
1813 |
(sensor shiftDown or:[sensor ctrlDown]) ifTrue:[ |
|
1814 |
scrolledView scrollToTop |
|
1815 |
] ifFalse:[ |
|
1816 |
scrolledView scrollUp |
|
1817 |
] |
|
1818 |
]. |
|
1819 |
]. |
|
1820 |
||
1821 |
vScrollBar scrollDownAction: |
|
5823 | 1822 |
[ |
5730 | 1823 |
|sensor| |
1824 |
||
1825 |
"/ in case the event came after the view was already deconstructed |
|
1826 |
scrolledView notNil ifTrue:[ |
|
1827 |
sensor := self sensor. |
|
1828 |
(sensor shiftDown or:[sensor ctrlDown]) ifTrue:[ |
|
1829 |
scrolledView scrollToBottom |
|
1830 |
] ifFalse:[ |
|
1831 |
scrolledView scrollDown |
|
1832 |
] |
|
1833 |
]. |
|
1834 |
]. |
|
7 | 1835 |
]. |
5730 | 1836 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1837 |
hScrollBar notNil ifTrue:[ |
5730 | 1838 |
hScrollBar scrollAction: |
1839 |
[:position | |
|
1840 |
"/ in case the event came after the view was already deconstructed |
|
1841 |
scrolledView notNil ifTrue:[ |
|
1842 |
lockUpdates := true. |
|
1843 |
scrolledView scrollHorizontalToPercent:position. |
|
1844 |
lockUpdates := false |
|
1845 |
]. |
|
1846 |
]. |
|
1847 |
||
1848 |
hScrollBar scrollUpAction: |
|
5823 | 1849 |
[ |
5730 | 1850 |
|sensor| |
1851 |
||
1852 |
"/ in case the event came after the view was already deconstructed |
|
1853 |
scrolledView notNil ifTrue:[ |
|
1854 |
sensor := self sensor. |
|
1855 |
(sensor shiftDown or:[sensor ctrlDown]) ifTrue:[ |
|
1856 |
scrolledView scrollToLeft |
|
1857 |
] ifFalse:[ |
|
1858 |
scrolledView scrollLeft |
|
1859 |
] |
|
1860 |
]. |
|
1861 |
]. |
|
1862 |
||
1863 |
hScrollBar scrollDownAction: |
|
1864 |
[ |
|
1865 |
|sensor| |
|
1866 |
||
1867 |
"/ in case the event came after the view was already deconstructed |
|
1868 |
scrolledView notNil ifTrue:[ |
|
1869 |
sensor := self sensor. |
|
1870 |
(sensor shiftDown or:[sensor ctrlDown]) ifTrue:[ |
|
1871 |
scrolledView scrollToRight |
|
1872 |
] ifFalse:[ |
|
1873 |
scrolledView scrollRight |
|
1874 |
] |
|
1875 |
]. |
|
1876 |
]. |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1877 |
]. |
7 | 1878 |
|
65 | 1879 |
scrolledView addDependent:self. |
814 | 1880 |
|
1881 |
" |
|
5823 | 1882 |
pass my keyboard input (and other subviews input) |
814 | 1883 |
to the scrolled view ... |
1884 |
" |
|
1885 |
self delegate:(KeyboardForwarder toView:scrolledView). |
|
1886 |
||
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
1887 |
"Modified: 6.3.1997 / 17:03:43 / cg" |
1111 | 1888 |
"Created: 6.3.1997 / 18:06:23 / cg" |
1889 |
! |
|
1890 |
||
2526 | 1891 |
setVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH |
1892 |
"set scrollbar-flags as specified in the arguments" |
|
1111 | 1893 |
|
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1894 |
|noMiniScrollers| |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1895 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1896 |
vScrollBarHidden := hScrollBarHidden := false. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1897 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1898 |
hasVerticalScrollBar := isVertical. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1899 |
hasHorizontalScrollBar := isHorizontal. |
1111 | 1900 |
|
2526 | 1901 |
noMiniScrollers := StyleSheet at:#'scrollBar.neverMini' default:false. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1902 |
verticalMini := miniV. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1903 |
horizontalMini := miniH. |
1753
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1904 |
|
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1905 |
noMiniScrollers == true ifTrue:[ |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1906 |
verticalMini := false. |
d0b1ba76acdb
honor the neverMini styleSheet setting.
Claus Gittinger <cg@exept.de>
parents:
1719
diff
changeset
|
1907 |
horizontalMini := false. |
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1908 |
]. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1909 |
|
2526 | 1910 |
! |
1911 |
||
1912 |
setupVertical:isVertical mini:miniV horizontal:isHorizontal mini:miniH |
|
1913 |
"setup scrollbars as specified in the arguments" |
|
1914 |
||
1915 |
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
|
1916 |
self setupViews. |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1917 |
! |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1918 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1919 |
setupViews |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1920 |
"setup scrollbars as specified in the arguments" |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1921 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1922 |
|cls| |
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1923 |
|
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1924 |
hasVerticalScrollBar ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1925 |
cls := ScrollBar. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1926 |
verticalMini ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1927 |
cls := MiniScroller |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1928 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1929 |
(vScrollBar notNil |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1930 |
and:[vScrollBar class ~~ cls]) ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1931 |
self releaseVerticalScrollBar |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1932 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1933 |
vScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1934 |
vScrollBar := cls in:self. |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1935 |
"/ realized ifTrue:[ |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1936 |
vScrollBar beVisible. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1937 |
"/ vScrollBar realize. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1938 |
vScrollBarHidden := false. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1939 |
"/ ] |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1940 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1941 |
vScrollBar thumbOrigin:0 thumbHeight:100. |
5461 | 1942 |
vScrollBar addDependent:self. |
1111 | 1943 |
] ifFalse:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1944 |
vScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1945 |
self releaseVerticalScrollBar |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1946 |
] |
1111 | 1947 |
]. |
1948 |
||
1126
2c698745c81f
added support for automatic scrollBar hiding.
Claus Gittinger <cg@exept.de>
parents:
1125
diff
changeset
|
1949 |
hasHorizontalScrollBar ifTrue:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1950 |
cls := HorizontalScrollBar. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1951 |
horizontalMini ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1952 |
cls := HorizontalMiniScroller |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1953 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1954 |
(hScrollBar notNil |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1955 |
and:[hScrollBar class ~~ cls]) ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1956 |
self releaseHorizontalScrollBar |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1957 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1958 |
hScrollBar isNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1959 |
hScrollBar := cls in:self. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1960 |
realized ifTrue:[ |
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1961 |
hScrollBar beVisible. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1962 |
"/ hScrollBar realize. |
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1963 |
hScrollBarHidden := false. |
1961
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 |
]. |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1966 |
hScrollBar thumbOrigin:0 thumbHeight:100. |
5461 | 1967 |
hScrollBar addDependent:self. |
1111 | 1968 |
] ifFalse:[ |
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1969 |
hScrollBar notNil ifTrue:[ |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1970 |
self releaseHorizontalScrollBar |
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1971 |
] |
1111 | 1972 |
]. |
1973 |
||
1974 |
scrolledView notNil ifTrue:[ |
|
1961
302546d09001
oops - the combination of static vartical and autoHide horiz
Claus Gittinger <cg@exept.de>
parents:
1953
diff
changeset
|
1975 |
self setScrollActions. |
1111 | 1976 |
] |
1977 |
||
2397
e643a7e77af5
fix for windows bug (vScrollBar kept invisible)
Claus Gittinger <cg@exept.de>
parents:
2358
diff
changeset
|
1978 |
"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
|
1979 |
"Modified: / 24.8.2001 / 14:58:26 / cg" |
7 | 1980 |
! ! |
1981 |
||
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1982 |
!ScrollableView methodsFor:'layout'! |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1983 |
|
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1984 |
horizontalScrollBarLayout:aLayout |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1985 |
hScrollBar layout:aLayout |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1986 |
! |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1987 |
|
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1988 |
scrolledViewLayout:aLayout |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1989 |
scrolledView layout:aLayout |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1990 |
! |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
1991 |
|
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1992 |
setupDimensionsConfigureScrolledView:configureScrolledView |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1993 |
"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
|
1994 |
the scrollability and hidden settings. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1995 |
This may heavily move around the parts ... |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1996 |
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
|
1997 |
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
|
1998 |
(to avoid thick borders in-between components). |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
1999 |
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
|
2000 |
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
|
2001 |
" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2002 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2003 |
|usedScrolledViewHMargin usedScrolledViewVMargin |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2004 |
usedScrollBarHSpacing usedScrollBarVSpacing hasV hasH |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2005 |
vBd "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2006 |
hBd "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2007 |
sBd "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2008 |
wVScroll "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2009 |
hHScroll "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2010 |
hLeftOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2011 |
hRightOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2012 |
hTopOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2013 |
hBottomOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2014 |
sLeftOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2015 |
sRightOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2016 |
sTopOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2017 |
sBottomOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2018 |
vLeftOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2019 |
vRightOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2020 |
vTopOffs "{ Class: SmallInteger }" |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2021 |
vBottomOffs "{ Class: SmallInteger }" |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2022 |
addMargin "{ Class: SmallInteger }" |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2023 |
scrolledViewLevel |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2024 |
| |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2025 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2026 |
sBd := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2027 |
DefaultScrolledViewBorderWidth notNil ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2028 |
sBd := DefaultScrolledViewBorderWidth. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2029 |
scrolledView notNil ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2030 |
scrolledView borderWidth:DefaultScrolledViewBorderWidth. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2031 |
] |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2032 |
] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2033 |
scrolledView notNil ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2034 |
sBd := scrolledView borderWidth |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2035 |
] |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2036 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2037 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2038 |
(hasV := (vScrollBar notNil and:[vScrollBarHidden not])) ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2039 |
vBd := vScrollBar borderWidth. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2040 |
wVScroll := vScrollBar widthIncludingBorder. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2041 |
] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2042 |
vBd := wVScroll := 0. |
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 |
(hasH := (hScrollBar notNil and:[hScrollBarHidden not])) ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2046 |
hBd := hScrollBar borderWidth. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2047 |
hHScroll := hScrollBar heightIncludingBorder. |
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 |
hBd := hHScroll := 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 |
"/ the raw layout ... |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2053 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2054 |
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
|
2055 |
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
|
2056 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2057 |
"/ 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
|
2058 |
"/ 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
|
2059 |
"/ (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
|
2060 |
"/ 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
|
2061 |
"/ 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
|
2062 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2063 |
"/ DefaultScrolledViewMargin := 10. "/ margin around |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2064 |
"/ DefaultScrollBarSpacing := 2. "/ space between scrolledView and scrollBar. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2065 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2066 |
usedScrolledViewHMargin := self usedScrolledViewHMarginWhenHasV:hasV andHasH:hasH. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2067 |
usedScrolledViewVMargin := self usedScrolledViewVMarginWhenHasV:hasV andHasH:hasH. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2068 |
usedScrollBarVSpacing := self usedScrollBarVSpacingWhenHasV:hasV andHasH:hasH. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2069 |
usedScrollBarHSpacing := self usedScrollBarHSpacingWhenHasV:hasV andHasH:hasH. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2070 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2071 |
vTopOffs := 0 - vBd + usedScrolledViewVMargin + margin. |
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 |
usedScrolledViewVMargin == 0 ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2074 |
vBottomOffs := vBd - sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2075 |
] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2076 |
vBottomOffs := vBd - usedScrolledViewVMargin + sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2077 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2078 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2079 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2080 |
hLeftOffs := 0 - hBd + usedScrolledViewHMargin + margin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2081 |
hRightOffs := hBd - usedScrolledViewHMargin - sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2082 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2083 |
sLeftOffs := 0 - hBd + usedScrolledViewHMargin + margin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2084 |
sRightOffs := hBd - usedScrolledViewHMargin - sBd - sBd - sBd. |
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 |
usedScrolledViewVMargin == 0 ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2087 |
sTopOffs := 0 - sBd + margin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2088 |
sBottomOffs := sBd - sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2089 |
] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2090 |
sTopOffs := 0 + usedScrolledViewVMargin + margin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2091 |
sBottomOffs := sBd - usedScrolledViewVMargin - 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 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2094 |
"/ kludge - for now |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2095 |
(styleSheet at:#'scrolledView.zeroOffsets') == true ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2096 |
vTopOffs := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2097 |
hLeftOffs := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2098 |
sLeftOffs := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2099 |
sTopOffs := 0. |
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 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2102 |
addMargin := 0. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2103 |
"/ DefaultScrollBarLevel == DefaultScrolledViewLevel |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2104 |
"/ addMargin := 1. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2105 |
"/ ]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2106 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2107 |
hasV ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2108 |
scrollBarPosition == #right ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2109 |
"/ right/bottom |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2110 |
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
|
2111 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2112 |
vRightOffs := 0 - usedScrolledViewHMargin + margin "???". |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2113 |
vLeftOffs := vRightOffs - wVScroll. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2114 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2115 |
sRightOffs := sRightOffs - usedScrollBarHSpacing - wVScroll + sBd. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2116 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2117 |
hRightOffs := hRightOffs - wVScroll - usedScrollBarHSpacing - sBd. |
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 |
sRightOffs := sRightOffs - addMargin |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2120 |
] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2121 |
"/ left/top |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2122 |
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
|
2123 |
vLeftOffs := 0 - vBd + usedScrolledViewHMargin + margin. |
2643 | 2124 |
vRightOffs := vLeftOffs + wVScroll "+ margin". |
2125 |
||
2126 |
sLeftOffs := vRightOffs + usedScrollBarHSpacing. |
|
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2127 |
sRightOffs := 0 - usedScrolledViewHMargin - margin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2128 |
hLeftOffs := hLeftOffs + wVScroll + vBd + usedScrollBarHSpacing. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2129 |
|
2643 | 2130 |
sLeftOffs := sLeftOffs + addMargin. |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2131 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2132 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2133 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2134 |
hasH ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2135 |
hBottomOffs := 0 - usedScrolledViewVMargin - hBd + margin "???". |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2136 |
hTopOffs := hBottomOffs - hHScroll. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2137 |
usedScrolledViewVMargin == 0 ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2138 |
hTopOffs := hTopOffs + sBd + sBd |
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 |
sBottomOffs := sBottomOffs - usedScrollBarVSpacing - hHScroll. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2141 |
(vScrollBar notNil and:[vScrollBarHidden not]) ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2142 |
vBottomOffs := vBottomOffs - usedScrollBarVSpacing - hHScroll. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2143 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2144 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2145 |
sBottomOffs := sBottomOffs - addMargin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2146 |
hRightOffs := hRightOffs - addMargin. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2147 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2148 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2149 |
(hScrollBar notNil |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2150 |
and:[ hScrollBar borderWidth == 0 |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2151 |
and:[sBd ~~ 0 |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2152 |
and:[scrollBarPosition == #right]]]) ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2153 |
hRightOffs := hRightOffs + sBd + sBd. |
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 |
scrolledView notNil ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2157 |
scrolledViewLayout |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2158 |
leftOffset:sLeftOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2159 |
rightOffset:sRightOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2160 |
topOffset:sTopOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2161 |
bottomOffset:sBottomOffs. |
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 |
configureScrolledView ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2164 |
((hideVScrollBar or:[hideHScrollBar]) not |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2165 |
and:[(hScrollBar isNil or:[hScrollBarHidden]) |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2166 |
and:[(vScrollBar isNil or:[vScrollBarHidden])]]) ifTrue:[ |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2167 |
scrolledViewLevel := 0 |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2168 |
] ifFalse:[ |
2337
66d637032be7
level fix (when there is no scrollBar)
Claus Gittinger <cg@exept.de>
parents:
2320
diff
changeset
|
2169 |
(hScrollBar isNil and:[vScrollBar isNil]) ifTrue:[ |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2170 |
scrolledViewLevel := 0 |
2337
66d637032be7
level fix (when there is no scrollBar)
Claus Gittinger <cg@exept.de>
parents:
2320
diff
changeset
|
2171 |
] ifFalse:[ |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2172 |
scrolledViewLevel := DefaultScrolledViewLevel. |
2337
66d637032be7
level fix (when there is no scrollBar)
Claus Gittinger <cg@exept.de>
parents:
2320
diff
changeset
|
2173 |
] |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2174 |
]. |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2175 |
scrolledView level:scrolledViewLevel |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2176 |
]. |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2177 |
self scrolledViewLayout:scrolledViewLayout. |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2178 |
]. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2179 |
hasH ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2180 |
hScrollBarLayout |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2181 |
leftOffset:hLeftOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2182 |
rightOffset:hRightOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2183 |
topOffset:hTopOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2184 |
bottomOffset:hBottomOffs. |
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 |
hScrollBar level:DefaultScrollBarLevel. |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2187 |
self horizontalScrollBarLayout:hScrollBarLayout. |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2188 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2189 |
"/ scrollBarPosition == #right ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2190 |
"/ "/ right/bottom |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2191 |
"/ hScrollBar viewGravity:#SouthWest. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2192 |
"/ ] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2193 |
"/ hScrollBar viewGravity:#NorthWest. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2194 |
"/ ] |
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 |
(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
|
2197 |
vScrollBarLayout |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2198 |
leftOffset:vLeftOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2199 |
rightOffset:vRightOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2200 |
topOffset:vTopOffs |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2201 |
bottomOffset:vBottomOffs. |
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 |
vScrollBar level:DefaultScrollBarLevel. |
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2204 |
self verticalScrollBarLayout:vScrollBarLayout. |
2155
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2205 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2206 |
"/ scrollBarPosition == #right ifTrue:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2207 |
"/ "/ right/bottom |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2208 |
"/ vScrollBar viewGravity:#NorthEast. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2209 |
"/ ] ifFalse:[ |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2210 |
"/ vScrollBar viewGravity:#NorthWest. |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2211 |
"/ ] |
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 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2214 |
"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
|
2215 |
"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
|
2216 |
! |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2217 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2218 |
usedScrollBarHSpacingWhenHasV:hasV andHasH:hasH |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2219 |
"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
|
2220 |
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
|
2221 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2222 |
^ hasV ifTrue:[scrollBarHSpacing] ifFalse:[0] |
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 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2226 |
usedScrollBarVSpacingWhenHasV:hasV andHasH:hasH |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2227 |
"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
|
2228 |
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
|
2229 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2230 |
^ hasH ifTrue:[scrollBarVSpacing] ifFalse:[0] |
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 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2234 |
usedScrolledViewHMarginWhenHasV:hasV andHasH:hasH |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2235 |
"return the horizontal margin around (outer margin). |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2236 |
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
|
2237 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2238 |
^ scrolledViewHMargin |
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 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2242 |
usedScrolledViewVMarginWhenHasV:hasV andHasH:hasH |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2243 |
"return the vertical margin around (outer margin). |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2244 |
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
|
2245 |
|
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2246 |
^ scrolledViewVMargin |
65e1bf19fd7f
allow subclasses to redefine margin and scrollBarSpacing
Claus Gittinger <cg@exept.de>
parents:
2154
diff
changeset
|
2247 |
|
2587
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2248 |
! |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2249 |
|
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2250 |
verticalScrollBarLayout:aLayout |
6c5d17d2a1d7
some refactorings for easier subclassing (DataSetView)
penk
parents:
2526
diff
changeset
|
2251 |
vScrollBar layout:aLayout |
2155
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 |
|
217 | 2254 |
!ScrollableView methodsFor:'queries'! |
38 | 2255 |
|
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
2256 |
isHorizontalScrollable |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2257 |
"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
|
2258 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2259 |
^ hScrollBar notNil |
819
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
2260 |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2261 |
"Modified: 6.3.1997 / 17:03:49 / cg" |
1111 | 2262 |
"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
|
2263 |
! |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2264 |
|
1593
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2265 |
isScrollWrapper |
3568
976b80ebcda7
Clean up documentation & variable names
Stefan Vogel <sv@exept.de>
parents:
3509
diff
changeset
|
2266 |
"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
|
2267 |
|
1593
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2268 |
^ true |
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2269 |
|
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2270 |
"Created: / 20.6.1998 / 14:15:42 / cg" |
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2271 |
! |
a77a10ecde65
added #isScrollWrapper query.
Claus Gittinger <cg@exept.de>
parents:
1556
diff
changeset
|
2272 |
|
2358 | 2273 |
isScrolling |
2274 |
"true, if scrollbars thumb is being moved (by user)" |
|
2275 |
||
2276 |
^ (vScrollBar notNil and:[vScrollBar isScrolling]) |
|
2277 |
or:[ |
|
2278 |
(hScrollBar notNil and:[hScrollBar isScrolling]) |
|
2279 |
] |
|
2280 |
! |
|
2281 |
||
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2282 |
isVerticalScrollable |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2283 |
"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
|
2284 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2285 |
^ vScrollBar notNil |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2286 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2287 |
"Modified: 6.3.1997 / 17:03:52 / cg" |
1111 | 2288 |
"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
|
2289 |
! |
32ac89843fa8
Send only one scroll message for horizontal and vertical scroll
Stefan Vogel <sv@exept.de>
parents:
814
diff
changeset
|
2290 |
|
217 | 2291 |
preferredExtent |
572 | 2292 |
"return my preferredExtent from the scrolledViews prefExtent |
2293 |
plus the size of the scrollBar" |
|
2294 |
||
1855 | 2295 |
|slavesPref prefX prefY margin| |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2296 |
|
3767
30ede36bb2ee
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3685
diff
changeset
|
2297 |
"/ If I have an explicit preferredExtent.. |
30ede36bb2ee
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3685
diff
changeset
|
2298 |
explicitExtent notNil ifTrue:[ |
30ede36bb2ee
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3685
diff
changeset
|
2299 |
^ explicitExtent |
30ede36bb2ee
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3685
diff
changeset
|
2300 |
]. |
30ede36bb2ee
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3685
diff
changeset
|
2301 |
|
30ede36bb2ee
changed #preferredExtent - use explicitExtent instvar
Stefan Vogel <sv@exept.de>
parents:
3685
diff
changeset
|
2302 |
"/ If I have a cached preferredExtent value.. |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
2303 |
preferredExtent notNil ifTrue:[ |
1855 | 2304 |
^ preferredExtent |
713
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
2305 |
]. |
0c38ad51016d
care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents:
703
diff
changeset
|
2306 |
|
217 | 2307 |
scrolledView notNil ifTrue:[ |
1855 | 2308 |
slavesPref := scrolledView preferredExtent. |
2309 |
prefX := slavesPref x. |
|
2310 |
prefY := slavesPref y. |
|
2311 |
margin := (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
|
2312 |
vScrollBar notNil ifTrue:[ |
|
2313 |
prefX := prefX + vScrollBar width + margin. |
|
2314 |
]. |
|
2315 |
hScrollBar notNil ifTrue:[ |
|
2316 |
prefY := prefY + hScrollBar height + margin. |
|
2317 |
]. |
|
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2318 |
|
1855 | 2319 |
^ prefX @ prefY. |
0 | 2320 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2321 |
|
217 | 2322 |
^ super preferredExtent. |
572 | 2323 |
|
1111 | 2324 |
"Created: 6.3.1997 / 18:06:24 / cg" |
2325 |
"Modified: 6.3.1997 / 22:34:09 / cg" |
|
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2326 |
! |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2327 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2328 |
preferredExtentForLines:numLines cols:numCols |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2329 |
"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
|
2330 |
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
|
2331 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2332 |
|slavesPref prefX prefY| |
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2333 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2334 |
"/ 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
|
2335 |
|
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2336 |
preferredExtent notNil ifTrue:[ |
3012 | 2337 |
^ preferredExtent |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2338 |
]. |
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2339 |
|
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2340 |
scrolledView notNil ifTrue:[ |
3012 | 2341 |
slavesPref := scrolledView preferredExtentForLines:numLines cols:numCols. |
2342 |
prefX := slavesPref x. |
|
2343 |
prefY := slavesPref y. |
|
2344 |
vScrollBar notNil ifTrue:[ |
|
2345 |
prefX := prefX + vScrollBar width + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
|
2346 |
]. |
|
2347 |
hScrollBar notNil ifTrue:[ |
|
2348 |
prefY := prefY + hScrollBar height + (DefaultScrolledViewMargin * 2) + DefaultScrollBarSpacing. |
|
2349 |
]. |
|
2350 |
||
2351 |
^ prefX @ prefY. |
|
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2352 |
]. |
1104
88b80680773e
about to merge V & HV scrollableView into a single
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
2353 |
|
678
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2354 |
^ super preferredExtent. |
c1967a46b2c1
added query for lines/cols - prefExt
Claus Gittinger <cg@exept.de>
parents:
608
diff
changeset
|
2355 |
|
1111 | 2356 |
"Created: 6.3.1997 / 18:06:24 / cg" |
2357 |
"Modified: 6.3.1997 / 22:34:30 / cg" |
|
1231 | 2358 |
! |
2359 |
||
5963 | 2360 |
respondsTo:aSelector |
2361 |
scrolledView notNil ifTrue:[ |
|
2362 |
(scrolledView respondsTo:aSelector) ifTrue:[^ true]. |
|
2363 |
]. |
|
2364 |
^ super respondsTo:aSelector. |
|
2365 |
||
2366 |
" |
|
2367 |
self new respondsTo:#isScrolling |
|
2368 |
" |
|
2369 |
! |
|
2370 |
||
1231 | 2371 |
specClass |
1378 | 2372 |
"redefined, since my subclasses also want ScrollableViewSpecs" |
2373 |
||
1231 | 2374 |
^ ScrollableViewSpec |
2375 |
||
1378 | 2376 |
"Modified: / 31.10.1997 / 19:48:48 / cg" |
0 | 2377 |
! ! |
2378 |
||
2379 |
!ScrollableView methodsFor:'slave-view messages'! |
|
2380 |
||
1024 | 2381 |
clear |
1138 | 2382 |
"convenient method: forward this to the scrolledView" |
2383 |
||
1073 | 2384 |
scrolledView notNil ifTrue:[scrolledView clear] |
1024 | 2385 |
|
1111 | 2386 |
"Created: 6.3.1997 / 18:06:24 / cg" |
1138 | 2387 |
"Modified: 19.3.1997 / 16:34:19 / cg" |
1024 | 2388 |
! |
2389 |
||
2927 | 2390 |
clearView |
2391 |
"convenient method: forward this to the scrolledView" |
|
2392 |
||
2393 |
scrolledView notNil ifTrue:[scrolledView clearView] |
|
2394 |
! |
|
2395 |
||
217 | 2396 |
doesNotUnderstand:aMessage |
2397 |
"this is funny: all message we do not understand, are passed |
|
2398 |
on to the scrolledView - so we do not have to care for all |
|
2399 |
possible messages ...(thanks to the Message class)" |
|
2400 |
||
3006 | 2401 |
scrolledView notNil ifTrue:[ |
2402 |
^ aMessage sendTo:scrolledView. |
|
1111 | 2403 |
]. |
2404 |
^ super doesNotUnderstand:aMessage |
|
2405 |
||
2406 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
2407 |
"Modified: 6.3.1997 / 18:38:54 / cg" |
|
217 | 2408 |
! |
2409 |
||
2195
2117849dec53
forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
2410 |
flash |
2117849dec53
forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
2411 |
"convenient method: forward this to the scrolledView" |
2117849dec53
forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
2412 |
|
6218 | 2413 |
scrolledView notNil ifTrue:[ |
2414 |
scrolledView flash |
|
2415 |
] |
|
2416 |
||
2417 |
"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
|
2418 |
! |
2117849dec53
forward flash to scrolled view
Claus Gittinger <cg@exept.de>
parents:
2155
diff
changeset
|
2419 |
|
6218 | 2420 |
flash:messageOrNil withColor:flashColor |
5407 | 2421 |
"convenient method: forward this to the scrolledView" |
2422 |
||
2423 |
scrolledView notNil ifTrue:[ |
|
6218 | 2424 |
scrolledView flash:messageOrNil withColor:flashColor |
5407 | 2425 |
] |
6218 | 2426 |
|
2427 |
"Modified (format): / 21-10-2017 / 23:13:31 / cg" |
|
5407 | 2428 |
! |
2429 |
||
2271 | 2430 |
font:aFont |
2431 |
super font:aFont. |
|
2934
ede340a08539
forward font changes to the scrolledView
Claus Gittinger <cg@exept.de>
parents:
2927
diff
changeset
|
2432 |
scrolledView notNil ifTrue:[ |
ede340a08539
forward font changes to the scrolledView
Claus Gittinger <cg@exept.de>
parents:
2927
diff
changeset
|
2433 |
scrolledView font:aFont |
ede340a08539
forward font changes to the scrolledView
Claus Gittinger <cg@exept.de>
parents:
2927
diff
changeset
|
2434 |
] |
2271 | 2435 |
! |
2436 |
||
0 | 2437 |
leftButtonMenu |
38 | 2438 |
"return scrolledViews leftbuttonmenu" |
2439 |
||
2440 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 2441 |
^ scrolledView leftButtonMenu |
1111 | 2442 |
|
2443 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2444 |
! |
2445 |
||
2446 |
leftButtonMenu:aMenu |
|
2447 |
"pass on leftbuttonmenu to scrolledView" |
|
2448 |
||
2449 |
scrolledView leftButtonMenu:aMenu |
|
1111 | 2450 |
|
2451 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2452 |
! |
2453 |
||
2454 |
middleButtonMenu |
|
38 | 2455 |
"return scrolledViews middlebuttonmenu" |
2456 |
||
2457 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 2458 |
^ scrolledView middleButtonMenu |
1111 | 2459 |
|
2460 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2461 |
! |
2462 |
||
2463 |
middleButtonMenu:aMenu |
|
2464 |
"pass on middlebuttonmenu to scrolledView" |
|
2465 |
||
3685 | 2466 |
scrolledView notNil ifTrue:[ |
2467 |
scrolledView middleButtonMenu:aMenu |
|
2468 |
]. |
|
1111 | 2469 |
|
2470 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
3685 | 2471 |
|
2472 |
||
2473 |
||
2474 |
||
0 | 2475 |
! |
2476 |
||
562 | 2477 |
model |
754 | 2478 |
"return my scrolledViews model" |
2479 |
||
1085 | 2480 |
scrolledView isNil ifTrue:[^ nil]. |
562 | 2481 |
^ scrolledView model |
2482 |
||
1085 | 2483 |
"Modified: 1.3.1997 / 01:38:07 / cg" |
1111 | 2484 |
"Created: 6.3.1997 / 18:06:24 / cg" |
562 | 2485 |
! |
2486 |
||
2487 |
model:aModel |
|
754 | 2488 |
"forward model change to my scrolledViews" |
2489 |
||
562 | 2490 |
^ scrolledView model:aModel |
2491 |
||
754 | 2492 |
"Modified: 5.6.1996 / 17:09:50 / cg" |
1111 | 2493 |
"Created: 6.3.1997 / 18:06:24 / cg" |
562 | 2494 |
! |
2495 |
||
1827 | 2496 |
requestFocus |
2986 | 2497 |
scrolledView notNil ifTrue:[ |
2498 |
^ scrolledView requestFocus |
|
2499 |
]. |
|
2500 |
^ false. |
|
1827 | 2501 |
! |
2502 |
||
0 | 2503 |
rightButtonMenu |
38 | 2504 |
"return scrolledViews rightbuttonmenu" |
2505 |
||
2506 |
scrolledView isNil ifTrue:[^ nil]. |
|
0 | 2507 |
^ scrolledView rightButtonMenu |
1111 | 2508 |
|
2509 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
0 | 2510 |
! |
2511 |
||
2512 |
rightButtonMenu:aMenu |
|
2513 |
"pass on rightbuttonmenu to scrolledView" |
|
2514 |
||
2515 |
scrolledView rightButtonMenu:aMenu |
|
1111 | 2516 |
|
2517 |
"Created: 6.3.1997 / 18:06:24 / cg" |
|
38 | 2518 |
! ! |
2519 |
||
852 | 2520 |
!ScrollableView class methodsFor:'documentation'! |
0 | 2521 |
|
217 | 2522 |
version |
5407 | 2523 |
^ '$Header$' |
5022 | 2524 |
! |
2525 |
||
2526 |
version_CVS |
|
5407 | 2527 |
^ '$Header$' |
0 | 2528 |
! ! |
4827 | 2529 |