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