author | Claus Gittinger <cg@exept.de> |
Mon, 18 Aug 2003 15:14:19 +0200 | |
changeset 2551 | 84b5eef43b23 |
parent 2546 | 9a907b626499 |
child 2554 | 0df306e11170 |
permissions | -rw-r--r-- |
1431 | 1 |
" |
2 |
COPYRIGHT (c) 1999 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
1752 | 14 |
"{ Package: 'stx:libwidg2' }" |
15 |
||
1390 | 16 |
SelectionInListModelView subclass:#HierarchicalListView |
2377 | 17 |
instanceVariableNames:'imageInset imageWidth lineColor showRoot showLines |
2392 | 18 |
useDefaultIcons icons openIndicator closeIndicator alignTextRight |
19 |
alignTextRightX maxWidthOfText minLineHeight levelOfLastItem |
|
20 |
expandOnSelect autoScrollHorizontal showIndicators |
|
21 |
showLeftIndicators indicatorAction' |
|
2361 | 22 |
classVariableNames:'' |
23 |
poolDictionaries:'' |
|
24 |
category:'Views-Trees' |
|
1390 | 25 |
! |
26 |
||
27 |
!HierarchicalListView class methodsFor:'documentation'! |
|
28 |
||
1431 | 29 |
copyright |
30 |
" |
|
31 |
COPYRIGHT (c) 1999 by eXept Software AG |
|
32 |
All Rights Reserved |
|
33 |
||
34 |
This software is furnished under a license and may be used |
|
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
||
42 |
! |
|
43 |
||
1757 | 44 |
documentation |
1390 | 45 |
" |
1757 | 46 |
This class implements a hierarchical list view based on a |
47 |
hierachical list. |
|
48 |
It provides functionality similar to SelectionInTreeView, but optimizes |
|
49 |
redraws, and operates directly upon the model (in contrast to |
|
50 |
SelectionInTreeView, which generates a list internally). |
|
1390 | 51 |
|
1757 | 52 |
[Instance variables:] |
53 |
textStartLeft <Integer> inset between icon and text |
|
54 |
imageInset <Integer> inset between left side and icon |
|
55 |
imageWidth <Integer> width of widest icon |
|
2312 | 56 |
minLineHeight <Integer> minimum required line height |
57 |
including open/close indication ... |
|
1757 | 58 |
lineMask <Form> line mask |
59 |
lineColor <Color> line color |
|
60 |
showRoot <Boolean> root element is shown or hidden |
|
61 |
derives from the hierachical list. |
|
62 |
showLines <Boolean> show or hide lines |
|
2392 | 63 |
showIndicators <Boolean> show or hide indicators |
1757 | 64 |
useDefaultIcons <Boolean> use the default icons if no icon |
65 |
for an item is specified |
|
66 |
icons <IdentityDictionary> list of registered icons; |
|
67 |
identifier := <key> value := <icon> |
|
68 |
showLeftIndicators <Boolean> show or hide indicator for most left items |
|
2417
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
69 |
indicatorAction <Block> action evaluated if indicator is pressed (0/1/2 arguments) |
1757 | 70 |
openIndicator <Icon, Image or Form> expanded indicator |
71 |
closeIndicator <Icon, Image or Form> collapsed indicator |
|
1390 | 72 |
|
1757 | 73 |
alignTextRight <Boolean> enable disable of align the text right |
74 |
icon text |
|
75 |
icon text of child |
|
76 |
should be set after creation of the widget!! |
|
77 |
alignTextRightX <Integer> left x position of aligned right text |
|
78 |
maxWidthOfText <Integer> keeps the maximum width of a text label |
|
79 |
||
2210 | 80 |
levelOfLastItem <Integer> keeps the level of the last item; |
81 |
in case of a delete last items from list |
|
82 |
we know were to redraw lines from |
|
2229 | 83 |
|
84 |
autoScrollHorizontal <Boolean> true, than automatically scroll horizontal upto |
|
85 |
the text label of the current selected line. |
|
86 |
||
87 |
expandOnSelect <Boolean> true, than the item selected by a buttonPress |
|
88 |
event will be immediately expanded. |
|
89 |
||
1757 | 90 |
[author:] |
91 |
Claus Atzkern |
|
92 |
||
93 |
[see also:] |
|
94 |
ListModelView |
|
95 |
SelectionInListModelView |
|
1390 | 96 |
HierarchicalList |
97 |
HierarchicalItem |
|
98 |
" |
|
1757 | 99 |
! |
100 |
||
101 |
examples |
|
102 |
" |
|
1916 | 103 |
show a hierarchical list |
1757 | 104 |
[exBegin] |
105 |
|top sel list item| |
|
106 |
||
107 |
list := HierarchicalList new. |
|
108 |
item := HierarchicalItem::Example labeled:'Root Item'. |
|
109 |
||
110 |
item expand. |
|
111 |
list showRoot:false. |
|
112 |
list root:item. |
|
113 |
||
114 |
top := StandardSystemView new; extent:300@300. |
|
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
115 |
sel := ScrollableView for:HierarchicalListView miniScrollerH:true |
1757 | 116 |
origin:0.0@0.0 corner:1.0@1.0 in:top. |
117 |
||
118 |
sel list:list. |
|
119 |
sel multipleSelectOk:true. |
|
120 |
||
121 |
sel doubleClickAction:[:i| (list at:i) toggleExpand ]. |
|
122 |
sel indicatorAction:[:i| (list at:i) toggleExpand ]. |
|
123 |
||
124 |
top open. |
|
125 |
[exEnd] |
|
126 |
||
127 |
||
1916 | 128 |
show a hierarchical list; open an editor on reselect a |
129 |
line with label is a string. |
|
130 |
||
131 |
[exBegin] |
|
132 |
|top sel list item| |
|
133 |
||
134 |
list := HierarchicalList new. |
|
135 |
item := HierarchicalItem::Example labeled:'Root Item'. |
|
136 |
||
137 |
item expand. |
|
138 |
list showRoot:false. |
|
139 |
list root:item. |
|
140 |
||
141 |
top := StandardSystemView new; extent:300@300. |
|
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
142 |
sel := ScrollableView for:HierarchicalListView miniScrollerH:true |
1916 | 143 |
origin:0.0@0.0 corner:1.0@1.0 in:top. |
144 |
||
145 |
sel list:list. |
|
146 |
||
147 |
sel openEditorAction:[:ln :aGC| |field item| |
|
148 |
item := list at:ln. |
|
149 |
||
150 |
item label isString ifFalse:[ |
|
151 |
field := nil |
|
152 |
] ifTrue:[ |
|
153 |
field := EditField new. |
|
154 |
field level:0. |
|
155 |
field acceptOnLostFocus:true. |
|
156 |
field acceptAction:[:x| item label:(field contents) ]. |
|
157 |
field font:(aGC font). |
|
158 |
field contents:(item label). |
|
159 |
]. |
|
160 |
field |
|
161 |
]. |
|
162 |
||
163 |
sel multipleSelectOk:true. |
|
164 |
||
165 |
sel doubleClickAction:[:i| (list at:i) toggleExpand ]. |
|
166 |
sel indicatorAction:[:i| (list at:i) toggleExpand ]. |
|
167 |
||
168 |
top open. |
|
169 |
[exEnd] |
|
170 |
||
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
171 |
[exBegin] |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
172 |
|top sel list item| |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
173 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
174 |
list := HierarchicalList new. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
175 |
item := HierarchicalItem::Example labeled:'Root Item'. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
176 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
177 |
item expand. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
178 |
list showRoot:false. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
179 |
list root:item. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
180 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
181 |
top := StandardSystemView new; extent:300@300. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
182 |
sel := ScrollableView for:HierarchicalListView miniScrollerH:true |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
183 |
origin:0.0@0.0 corner:1.0@1.0 in:top. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
184 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
185 |
sel list:list. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
186 |
sel multipleSelectOk:true. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
187 |
sel alignTextRight:true. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
188 |
sel doubleClickAction:[:i| (list at:i) toggleExpand ]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
189 |
sel indicatorAction:[:i| (list at:i) toggleExpand ]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
190 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
191 |
top open. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
192 |
[exBegin] |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
193 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
194 |
|
1757 | 195 |
" |
2383 | 196 |
! |
197 |
||
198 |
test |
|
199 |
|top sel list item| |
|
200 |
||
201 |
list := HierarchicalList new. |
|
202 |
item := HierarchicalItem::Example labeled:'Root Item'. |
|
203 |
||
204 |
item expand. |
|
205 |
list showRoot:false. |
|
206 |
list root:item. |
|
207 |
||
208 |
top := StandardSystemView new; extent:300@300. |
|
209 |
sel := ScrollableView for:HierarchicalListView miniScrollerH:true |
|
210 |
origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
211 |
||
212 |
sel useDefaultIcons:false. |
|
213 |
sel list:list. |
|
214 |
sel multipleSelectOk:true. |
|
215 |
sel showLines:false. |
|
216 |
||
217 |
sel doubleClickAction:[:i| (list at:i) toggleExpand ]. |
|
218 |
sel indicatorAction:[:i| (list at:i) toggleExpand ]. |
|
219 |
||
220 |
top open. |
|
1390 | 221 |
! ! |
222 |
||
223 |
!HierarchicalListView class methodsFor:'resources'! |
|
224 |
||
225 |
closeIndicator |
|
2335 | 226 |
"This resource specification was automatically generated |
227 |
by the ImageEditor of ST/X." |
|
228 |
||
229 |
"Do not manually edit this!! If it is corrupted, |
|
230 |
the ImageEditor may not be able to read the specification." |
|
1390 | 231 |
|
2335 | 232 |
" |
233 |
self closeIndicator inspect |
|
234 |
ImageEditor openOnClass:self andSelector:#closeIndicator |
|
235 |
Icon flushCachedIcons |
|
236 |
" |
|
1390 | 237 |
|
2335 | 238 |
<resource: #image> |
239 |
||
240 |
^Icon |
|
241 |
constantNamed:#'HierarchicalListView class closeIndicator' |
|
242 |
ifAbsentPut:[(Depth2Image new) width: 9; height: 9; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUU@Z*)@Z")@Z")@X@I-Z")@Z")KZ*)@UUU;') ; colorMapFromArray:#[0 0 0 128 128 128 255 255 255]; yourself] |
|
1390 | 243 |
! |
244 |
||
1757 | 245 |
collapsedIcon |
2335 | 246 |
"This resource specification was automatically generated |
247 |
by the ImageEditor of ST/X." |
|
248 |
||
249 |
"Do not manually edit this!! If it is corrupted, |
|
250 |
the ImageEditor may not be able to read the specification." |
|
251 |
||
1757 | 252 |
" |
2335 | 253 |
self collapsedIcon inspect |
254 |
ImageEditor openOnClass:self andSelector:#collapsedIcon |
|
255 |
Icon flushCachedIcons |
|
256 |
" |
|
1390 | 257 |
|
2335 | 258 |
<resource: #image> |
259 |
||
260 |
^Icon |
|
261 |
constantNamed:#'HierarchicalListView class collapsedIcon' |
|
262 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@UP@@@@@@@@EUUUPAUUUT@UUUU@EUUUPAUUUT@UUUU@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 0]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@O@A>@O?<??3??O?<??3??O?<??0@@@@@@@@b') ; yourself); yourself] |
|
1390 | 263 |
! |
264 |
||
265 |
emptyIcon |
|
2335 | 266 |
"This resource specification was automatically generated |
267 |
by the ImageEditor of ST/X." |
|
268 |
||
269 |
"Do not manually edit this!! If it is corrupted, |
|
270 |
the ImageEditor may not be able to read the specification." |
|
271 |
||
1390 | 272 |
" |
2335 | 273 |
self emptyIcon inspect |
274 |
ImageEditor openOnClass:self andSelector:#emptyIcon |
|
275 |
Icon flushCachedIcons |
|
276 |
" |
|
1390 | 277 |
|
2335 | 278 |
<resource: #image> |
279 |
||
280 |
^Icon |
|
281 |
constantNamed:#'HierarchicalListView class emptyIcon' |
|
2336 | 282 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@EUTP@AUUE@@UUP@@EUUU@AUUUP@UUUT@EUUU@AUUUP@UUUT@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 255 255 255]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@O?@?>C?<O?8??#?>O?8??#?>O?8?? @@@@@@@@b') ; yourself); yourself] |
1390 | 283 |
! |
284 |
||
285 |
expandedIcon |
|
2335 | 286 |
"This resource specification was automatically generated |
287 |
by the ImageEditor of ST/X." |
|
288 |
||
289 |
"Do not manually edit this!! If it is corrupted, |
|
290 |
the ImageEditor may not be able to read the specification." |
|
291 |
||
1390 | 292 |
" |
2335 | 293 |
self expandedIcon inspect |
294 |
ImageEditor openOnClass:self andSelector:#expandedIcon |
|
295 |
Icon flushCachedIcons |
|
296 |
" |
|
1390 | 297 |
|
2335 | 298 |
<resource: #image> |
299 |
||
300 |
^Icon |
|
301 |
constantNamed:#'HierarchicalListView class expandedIcon' |
|
302 |
ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@UP@@@UU@@@EUUUPA@@@@@R*** B***(@***(@****@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 179 179 179 255 255 0]; mask:((ImageMask new) width: 16; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@O@A>@O?<??3???????;??/?<??0@@@@@@@@b') ; yourself); yourself] |
|
1390 | 303 |
! |
304 |
||
1757 | 305 |
openIndicator |
2335 | 306 |
"This resource specification was automatically generated |
307 |
by the ImageEditor of ST/X." |
|
308 |
||
309 |
"Do not manually edit this!! If it is corrupted, |
|
310 |
the ImageEditor may not be able to read the specification." |
|
1757 | 311 |
|
2335 | 312 |
" |
313 |
self openIndicator inspect |
|
314 |
ImageEditor openOnClass:self andSelector:#openIndicator |
|
315 |
Icon flushCachedIcons |
|
316 |
" |
|
1757 | 317 |
|
2335 | 318 |
<resource: #image> |
319 |
||
320 |
^Icon |
|
321 |
constantNamed:#'HierarchicalListView class openIndicator' |
|
322 |
ifAbsentPut:[(Depth2Image new) width: 9; height: 9; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUU@Z*)@Z*)(Z*)HX@I@Z*)@Z*)@Z*)@UUU.') ; colorMapFromArray:#[0 0 0 128 128 128 255 255 255]; yourself] |
|
1390 | 323 |
! ! |
324 |
||
325 |
!HierarchicalListView methodsFor:'accessing'! |
|
326 |
||
1843 | 327 |
font:aFont |
2307 | 328 |
"set a new font; if the font changed, all my items |
329 |
has to clear their cashed width and height |
|
1843 | 330 |
" |
331 |
|root| |
|
332 |
||
333 |
(aFont isNil or:[aFont = font]) ifFalse:[ |
|
2408 | 334 |
root := self root. |
335 |
root notNil ifTrue:[ root fontChanged ]. |
|
1843 | 336 |
super font:aFont |
337 |
]. |
|
338 |
! |
|
339 |
||
1390 | 340 |
list:aList |
2421 | 341 |
"test whether the list is not a hierarchical item and |
342 |
retrieve the showRoot attribute from the list |
|
343 |
" |
|
344 |
|newList| |
|
345 |
||
346 |
newList := aList. |
|
347 |
||
1390 | 348 |
aList notNil ifTrue:[ |
2421 | 349 |
aList isHierarchicalItem ifTrue:[ |
350 |
list notNil ifTrue:[ |
|
351 |
list root:aList. |
|
352 |
^ self |
|
353 |
]. |
|
354 |
newList := HierarchicalList new. |
|
355 |
newList showRoot:showRoot. |
|
356 |
newList root:aList. |
|
357 |
aList expand. |
|
358 |
]. |
|
359 |
showRoot := newList showRoot. |
|
1390 | 360 |
]. |
2421 | 361 |
super list:newList |
2408 | 362 |
! |
363 |
||
364 |
root |
|
365 |
"returns the anchor of the list or nil |
|
366 |
" |
|
367 |
list notNil ifTrue:[ ^ list root ]. |
|
368 |
^ nil |
|
1390 | 369 |
! ! |
370 |
||
2224 | 371 |
!HierarchicalListView methodsFor:'accessing-behavior'! |
372 |
||
373 |
autoScrollHorizontal |
|
374 |
"true, than automatically scroll horizontal upto the text label |
|
375 |
of the current selected line. |
|
376 |
" |
|
377 |
^ autoScrollHorizontal ? false |
|
378 |
! |
|
379 |
||
380 |
autoScrollHorizontal:aBoolean |
|
381 |
"true, than automatically scroll horizontal upto the text label |
|
382 |
of the current selected line. |
|
383 |
" |
|
384 |
autoScrollHorizontal := aBoolean. |
|
385 |
! |
|
386 |
||
387 |
expandOnSelect |
|
388 |
"true, than the item selected by a buttonPress event will |
|
389 |
be immediately expanded. |
|
390 |
" |
|
391 |
^ expandOnSelect |
|
392 |
! |
|
393 |
||
394 |
expandOnSelect:aBoolean |
|
395 |
"true, than the item selected by a buttonPress event will |
|
396 |
be immediately expanded. |
|
397 |
" |
|
398 |
expandOnSelect := aBoolean. |
|
399 |
! ! |
|
400 |
||
1818 | 401 |
!HierarchicalListView methodsFor:'accessing-colors'! |
1390 | 402 |
|
403 |
lineColor |
|
2307 | 404 |
"get the color of the horizontal and vertical lines |
1390 | 405 |
" |
406 |
^ lineColor |
|
407 |
! |
|
408 |
||
409 |
lineColor:aColor |
|
2307 | 410 |
"set the color of the horizontal and vertical lines |
1390 | 411 |
" |
412 |
(aColor notNil and:[aColor ~= lineColor]) ifTrue:[ |
|
413 |
lineColor := aColor. |
|
414 |
||
415 |
shown ifTrue:[ |
|
2099 | 416 |
lineColor := lineColor onDevice:device. |
2307 | 417 |
showLines ifTrue:[ self invalidate ] |
1390 | 418 |
] |
2307 | 419 |
]. |
1390 | 420 |
! ! |
421 |
||
1818 | 422 |
!HierarchicalListView methodsFor:'accessing-look'! |
1390 | 423 |
|
1568 | 424 |
alignTextRight |
425 |
"align the text right |
|
426 |
" |
|
427 |
^ alignTextRight |
|
428 |
! |
|
429 |
||
1757 | 430 |
alignTextRight:aBool |
431 |
"align the text right |
|
432 |
" |
|
433 |
alignTextRight := aBool ? false. |
|
434 |
! |
|
1568 | 435 |
|
1904 | 436 |
alignTextRightX |
437 |
"returns the minimum used text inset, if text is aligned right. |
|
438 |
" |
|
439 |
^ alignTextRightX |
|
440 |
! |
|
441 |
||
442 |
alignTextRightX:aNumber |
|
443 |
"set the minimum used text inset, if text is aligned right. |
|
444 |
" |
|
2383 | 445 |
aNumber > 0 ifTrue:[ |
1904 | 446 |
alignTextRightX := aNumber. |
447 |
||
448 |
(alignTextRight and:[widthOfContents notNil]) ifTrue:[ |
|
449 |
widthOfContents := alignTextRightX + maxWidthOfText. |
|
450 |
||
451 |
shown ifTrue:[ |
|
452 |
self invalidate. |
|
453 |
self contentsChanged. |
|
454 |
] |
|
455 |
] |
|
456 |
]. |
|
457 |
! |
|
458 |
||
2094 | 459 |
iconAt:aKey ifAbsentPut:aBlock |
460 |
"return the icon stored under a key; if not present,the |
|
461 |
result of the block if not nil is stored under the key |
|
462 |
and returned. |
|
463 |
" |
|
464 |
|icon| |
|
465 |
||
466 |
icon := icons at:aKey ifAbsent:nil. |
|
2307 | 467 |
icon notNil ifTrue:[^ icon]. |
2094 | 468 |
|
469 |
icon := aBlock value. |
|
2307 | 470 |
icon isNil ifTrue:[^ nil]. |
2094 | 471 |
|
472 |
realized ifTrue:[ |
|
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
473 |
icon := self imageOnMyDevice:icon |
2094 | 474 |
]. |
475 |
icons at:aKey put:icon. |
|
476 |
^ icon |
|
477 |
! |
|
478 |
||
1390 | 479 |
registerKeysAndIcons:aDictionary |
480 |
"register icons by key and value derived from a directory |
|
481 |
" |
|
482 |
|image| |
|
483 |
||
484 |
(aDictionary isNil or:[aDictionary isEmpty]) ifTrue:[ |
|
485 |
^ self |
|
486 |
]. |
|
487 |
||
488 |
aDictionary keysAndValuesDo:[:aKey :anImage| |
|
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
489 |
(image := self imageOnMyDevice:anImage) notNil ifTrue:[ |
1390 | 490 |
icons at:aKey put:image |
1746 | 491 |
] ifFalse:[ |
492 |
icons removeKey:aKey ifAbsent:nil |
|
1390 | 493 |
] |
494 |
] |
|
495 |
! |
|
496 |
||
2392 | 497 |
showIndicators |
498 |
"returns true if indicators are shown |
|
499 |
" |
|
500 |
^ showIndicators |
|
501 |
! |
|
502 |
||
503 |
showIndicators:aBoolean |
|
504 |
"true if indicators are shown |
|
505 |
" |
|
506 |
showIndicators ~~ aBoolean ifTrue:[ |
|
507 |
showIndicators := aBoolean. |
|
508 |
shown ifTrue:[ self invalidate ]. |
|
509 |
]. |
|
510 |
! |
|
511 |
||
1390 | 512 |
showLeftIndicators |
513 |
"show or hide the indicators for the most left items |
|
514 |
" |
|
515 |
^ showLeftIndicators |
|
516 |
||
517 |
! |
|
518 |
||
2307 | 519 |
showLeftIndicators:aBoolean |
1390 | 520 |
"show or hide the indicators for the most left items |
521 |
" |
|
2392 | 522 |
|oldInset newInset| |
523 |
||
524 |
aBoolean == showLeftIndicators ifTrue:[ ^ self ]. |
|
525 |
||
2408 | 526 |
(widthOfContents isNil or:[self size == 0]) ifTrue:[ |
2307 | 527 |
showLeftIndicators := aBoolean. |
2392 | 528 |
^ self |
529 |
]. |
|
2383 | 530 |
|
2392 | 531 |
oldInset := self xVisibleOfIconAtLevel:3. |
532 |
showLeftIndicators := aBoolean. |
|
533 |
newInset := self xVisibleOfIconAtLevel:3. |
|
534 |
||
535 |
newInset ~~ oldInset ifTrue:[ |
|
536 |
widthOfContents := widthOfContents + (newInset - oldInset). |
|
537 |
]. |
|
538 |
||
539 |
shown ifTrue:[ |
|
540 |
self invalidate |
|
541 |
]. |
|
542 |
||
543 |
newInset ~~ oldInset ifTrue:[ |
|
544 |
self contentsChanged |
|
1390 | 545 |
]. |
546 |
! |
|
547 |
||
548 |
showLines |
|
549 |
"returns true if lines are shown |
|
550 |
" |
|
2307 | 551 |
^ showLines |
1390 | 552 |
! |
553 |
||
2307 | 554 |
showLines:aBoolean |
1390 | 555 |
"show or hide lines |
556 |
" |
|
2307 | 557 |
aBoolean ~~ showLines ifTrue:[ |
558 |
showLines := aBoolean. |
|
559 |
shown ifTrue:[ self invalidate ]. |
|
1390 | 560 |
]. |
561 |
! |
|
562 |
||
2421 | 563 |
showRoot |
564 |
"true if the root is shown |
|
565 |
" |
|
566 |
^ showRoot |
|
567 |
! |
|
568 |
||
569 |
showRoot:aBoolean |
|
570 |
"true if the root is shown |
|
571 |
" |
|
572 |
showRoot ~~ aBoolean ifTrue:[ |
|
573 |
showRoot := aBoolean. |
|
574 |
||
575 |
list notNil ifTrue:[ |
|
576 |
list showRoot:aBoolean. |
|
577 |
]. |
|
578 |
shown ifTrue:[ self invalidate ] |
|
579 |
]. |
|
580 |
! |
|
581 |
||
1390 | 582 |
useDefaultIcons |
583 |
"use the default icons if no icon for an item is specified; |
|
584 |
** default: true |
|
585 |
" |
|
586 |
^ useDefaultIcons |
|
587 |
! |
|
588 |
||
2307 | 589 |
useDefaultIcons:aBoolean |
1390 | 590 |
"use the default icons if no icon for an item is specified; |
591 |
** default: true |
|
592 |
" |
|
2307 | 593 |
useDefaultIcons ~~ aBoolean ifTrue:[ |
594 |
useDefaultIcons := aBoolean. |
|
595 |
shown ifTrue:[ self invalidate ]. |
|
1390 | 596 |
] |
597 |
! ! |
|
598 |
||
599 |
!HierarchicalListView methodsFor:'actions'! |
|
600 |
||
601 |
indicatorAction |
|
2392 | 602 |
"the action evaluated if an indicator is pressed; otherwise |
603 |
if indicators are shown a default action is performed (toggle expand item). |
|
2417
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
604 |
|
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
605 |
The arguments to the block are: |
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
606 |
- no argument |
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
607 |
- 1 argument index |
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
608 |
- 2 argument index, self |
1390 | 609 |
" |
610 |
^ indicatorAction |
|
611 |
! |
|
612 |
||
613 |
indicatorAction:anAction |
|
2392 | 614 |
"the action evaluated if an indicator is pressed; otherwise |
615 |
if indicators are shown a default action is performed (toggle expand item). |
|
2417
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
616 |
|
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
617 |
The arguments to the block are: |
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
618 |
- no argument |
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
619 |
- 1 argument index |
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
620 |
- 2 argument index, self |
1390 | 621 |
" |
622 |
indicatorAction := anAction. |
|
623 |
! ! |
|
624 |
||
625 |
!HierarchicalListView methodsFor:'change & update'! |
|
626 |
||
1782 | 627 |
indicatorPressedAt:aLnNr |
2224 | 628 |
"handle indicator pressed action; |
629 |
if the item changed expanded, we try to show all |
|
630 |
new visible children |
|
631 |
" |
|
632 |
|item expanded availY usedY vwOrgX vwOrgY idx| |
|
633 |
||
2392 | 634 |
showIndicators ifFalse:[^ self]. |
2224 | 635 |
|
2408 | 636 |
item := self at:aLnNr ifAbsent:nil. |
2307 | 637 |
item isNil ifTrue:[^ self]. |
2224 | 638 |
|
639 |
item hasIndicator ifFalse:[^ self]. |
|
640 |
||
641 |
expanded := item isExpanded. |
|
2392 | 642 |
|
643 |
indicatorAction notNil ifTrue:[ |
|
2417
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
644 |
indicatorAction valueWithOptionalArgument:aLnNr and:self. |
2546
9a907b626499
Do recursive toggelExpand if an indicator is pressed with shift or control
Stefan Vogel <sv@exept.de>
parents:
2518
diff
changeset
|
645 |
] ifFalse:[ |sensor| |
9a907b626499
Do recursive toggelExpand if an indicator is pressed with shift or control
Stefan Vogel <sv@exept.de>
parents:
2518
diff
changeset
|
646 |
sensor := self sensor. |
9a907b626499
Do recursive toggelExpand if an indicator is pressed with shift or control
Stefan Vogel <sv@exept.de>
parents:
2518
diff
changeset
|
647 |
(sensor ctrlDown or:[sensor shiftDown]) ifTrue:[ |
9a907b626499
Do recursive toggelExpand if an indicator is pressed with shift or control
Stefan Vogel <sv@exept.de>
parents:
2518
diff
changeset
|
648 |
item recursiveToggleExpand |
9a907b626499
Do recursive toggelExpand if an indicator is pressed with shift or control
Stefan Vogel <sv@exept.de>
parents:
2518
diff
changeset
|
649 |
] ifFalse:[ |
9a907b626499
Do recursive toggelExpand if an indicator is pressed with shift or control
Stefan Vogel <sv@exept.de>
parents:
2518
diff
changeset
|
650 |
item toggleExpand |
9a907b626499
Do recursive toggelExpand if an indicator is pressed with shift or control
Stefan Vogel <sv@exept.de>
parents:
2518
diff
changeset
|
651 |
]. |
2392 | 652 |
]. |
653 |
||
2224 | 654 |
(expanded or:[item isExpanded not]) ifTrue:[^ self]. |
1783
ffe767ea66ea
check whether children exists before calling indicatorPressed action
ca
parents:
1782
diff
changeset
|
655 |
|
2224 | 656 |
"/ compute the index of last child assigned to item |
657 |
||
658 |
idx := item numberOfVisibleChildren. "/ no visible children |
|
659 |
idx == 0 ifTrue:[^ self]. |
|
660 |
||
661 |
idx := aLnNr + idx. |
|
662 |
vwOrgY := viewOrigin y. |
|
2414 | 663 |
availY := (self yVisibleOfLine:aLnNr) - (self yVisibleOfLine:1). |
2224 | 664 |
|
665 |
availY > margin ifTrue:[ |
|
666 |
usedY := (self yVisibleOfLine:(idx + 1)) - (height - margin - margin). |
|
667 |
||
668 |
usedY > 1 ifTrue:[ |
|
669 |
vwOrgY := vwOrgY + (usedY min:availY). |
|
670 |
]. |
|
671 |
]. |
|
672 |
vwOrgX := self computeViewOriginXat:aLnNr. |
|
673 |
||
674 |
self scrollTo:(vwOrgX @ vwOrgY). |
|
1782 | 675 |
! |
676 |
||
1390 | 677 |
lineChangedAt:aLnNr with:arg |
678 |
"line changed at position; check whether line height changed |
|
679 |
" |
|
680 |
|item |
|
2317 | 681 |
level "{ Class:SmallInteger }" |
1390 | 682 |
x0 "{ Class:SmallInteger }" |
683 |
x1 "{ Class:SmallInteger }" |
|
684 |
y0 "{ Class:SmallInteger }" |
|
685 |
y1 "{ Class:SmallInteger }" |
|
2303 | 686 |
yB "{ Class:SmallInteger }" |
1390 | 687 |
| |
688 |
||
2408 | 689 |
item := self at:aLnNr ifAbsent:nil. |
2317 | 690 |
item isNil ifTrue:[^ self]. |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
691 |
|
1399 | 692 |
(arg == #icon or:[arg == #hierarchy]) ifFalse:[ |
2224 | 693 |
super lineChangedAt:aLnNr with:arg. |
694 |
||
695 |
(arg ~~ #redraw and:[widthOfContents notNil]) ifTrue:[ |
|
2327 | 696 |
x0 := (self xVisibleOfTextAtLevel:(item level)) |
2353 | 697 |
+ (renderer widthFor:item) |
2229 | 698 |
+ (viewOrigin x). |
2224 | 699 |
|
700 |
x0 > widthOfContents ifTrue:[ |
|
701 |
widthOfContents := x0. |
|
702 |
self contentsChanged. |
|
703 |
] |
|
704 |
]. |
|
705 |
^ self |
|
1390 | 706 |
]. |
2317 | 707 |
level := item level. |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
708 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
709 |
(alignTextRight and:[arg == #hierarchy]) ifTrue:[ |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
710 |
"/ must test whether alignTextRightX is enough |
2317 | 711 |
(item isExpanded and:[item hasChildren]) ifTrue:[ |
2327 | 712 |
x0 := self xVisibleOfIconAtLevel:(level + 2). |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
713 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
714 |
alignTextRightX < x0 ifTrue:[ |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
715 |
alignTextRightX := x0. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
716 |
shown ifTrue:[ self invalidate ]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
717 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
718 |
widthOfContents notNil ifTrue:[ |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
719 |
widthOfContents := alignTextRightX + maxWidthOfText. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
720 |
self contentsChanged. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
721 |
]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
722 |
^ self. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
723 |
] |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
724 |
] |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
725 |
]. |
1568 | 726 |
shown ifFalse:[^ self]. |
727 |
||
2303 | 728 |
yB := height - margin. |
729 |
y0 := (self yVisibleOfLine:aLnNr) max:margin. |
|
730 |
y0 < yB ifFalse:[ ^ self ]. |
|
1390 | 731 |
|
2303 | 732 |
y1 := (self yVisibleOfLine:(aLnNr + 1)) min:yB. |
733 |
y1 > y0 ifFalse:[^ self]. |
|
1399 | 734 |
|
2327 | 735 |
x1 := (self xVisibleOfTextAtLevel:level) - 1. |
2317 | 736 |
x1 > margin ifFalse:[^ self]. |
1390 | 737 |
|
2383 | 738 |
x0 := (self xVisibleOfIndicatorAtLevel:level) max:margin. |
2317 | 739 |
x1 := x1 min:(width - margin). |
2303 | 740 |
|
2317 | 741 |
x0 < x1 ifTrue:[ |
742 |
self invalidate:(Rectangle left:x0 top:y0 width:(x1 - x0) height:(y1 - y0)) |
|
743 |
repairNow:false. |
|
2303 | 744 |
]. |
1976
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
745 |
! |
1390 | 746 |
|
1976
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
747 |
listChangedInsert:firstAddedIndex nItems:nLines |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
748 |
"must draw vertical lines above the added items |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
749 |
" |
2210 | 750 |
|item level yTop yBot xLft start maxY| |
1390 | 751 |
|
1976
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
752 |
super listChangedInsert:firstAddedIndex nItems:nLines. |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
753 |
|
2408 | 754 |
item := self last. |
2210 | 755 |
levelOfLastItem := item level. |
756 |
||
1976
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
757 |
( shown |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
758 |
and:[showLines |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
759 |
and:[firstAddedIndex > 1 |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
760 |
and:[nLines ~~ 0 |
2408 | 761 |
and:[(item := self at:firstAddedIndex ifAbsent:nil) notNil |
1976
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
762 |
and:[(level := item level) > 1]]]]] |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
763 |
) ifFalse:[ |
2383 | 764 |
^ self. |
1976
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
765 |
]. |
2383 | 766 |
xLft := self xVisibleOfVerticalLineAt:level. |
1390 | 767 |
|
1976
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
768 |
(xLft > margin and:[xLft < (width - margin)]) ifFalse:[ |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
769 |
^ self |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
770 |
]. |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
771 |
start := firstAddedIndex - 1. |
1390 | 772 |
|
1976
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
773 |
start to:1 by:-1 do:[:i| |el| |
2408 | 774 |
el := self at:i. |
1399 | 775 |
|
1976
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
776 |
el level <= level ifTrue:[ |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
777 |
i == start ifTrue:[^ self]. |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
778 |
|
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
779 |
yTop := (self yVisibleOfLine:i + 1) max:margin. |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
780 |
maxY := height - margin. |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
781 |
|
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
782 |
yTop < maxY ifTrue:[ |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
783 |
yBot := (self yVisibleOfLine:firstAddedIndex) - 1 min:maxY. |
2383 | 784 |
self invalidate:(Rectangle left:xLft top:yTop width:2 height:(yBot - yTop)) |
1976
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
785 |
]. |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
786 |
^ self |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
787 |
] |
1788b0045176
bug fix when adding new elements; must draw vertical lines above
ca
parents:
1916
diff
changeset
|
788 |
]. |
1390 | 789 |
! |
790 |
||
2208 | 791 |
listChangedRemove:aStart toIndex:aStop |
792 |
"test whether last items are deleted; |
|
793 |
than we have to redraw lines because of different levels |
|
794 |
" |
|
2210 | 795 |
|listSize index y0 searchLevel| |
2208 | 796 |
|
2408 | 797 |
listSize := self size. |
2210 | 798 |
searchLevel := levelOfLastItem. |
2208 | 799 |
|
2307 | 800 |
listSize == 0 ifTrue:[ levelOfLastItem := 1 ] |
2408 | 801 |
ifFalse:[ levelOfLastItem := self last level ]. |
2208 | 802 |
|
2307 | 803 |
(shown and:[showLines and:[listSize ~~ 0 and:[aStart > listSize]]]) ifTrue:[ |
2408 | 804 |
index := self findLast:[:el| el level <= searchLevel ]. |
2208 | 805 |
|
806 |
(index ~~ 0 and:[index < listSize]) ifTrue:[ |
|
807 |
y0 := (self yVisibleOfLine:index) max:margin. |
|
808 |
self invalidateX:0 y:y0 width:width height:(height - margin - y0). |
|
809 |
] |
|
810 |
]. |
|
811 |
^ super listChangedRemove:aStart toIndex:aStop |
|
812 |
! |
|
813 |
||
1390 | 814 |
update:what with:aPara from:chgObj |
815 |
"get the status of <showRoot> from the list |
|
816 |
" |
|
817 |
chgObj == list ifTrue:[ |
|
2408 | 818 |
showRoot ~~ chgObj showRoot ifTrue:[ |
819 |
showRoot := chgObj showRoot. |
|
1390 | 820 |
self invalidate. |
821 |
] |
|
822 |
]. |
|
823 |
super update:what with:aPara from:chgObj |
|
824 |
! ! |
|
825 |
||
826 |
!HierarchicalListView methodsFor:'drawing basics'! |
|
827 |
||
1568 | 828 |
drawElementsFrom:start to:stop x:xLeft y:yT w:w |
1390 | 829 |
"draw the items between start to stop without clearing the background |
830 |
" |
|
2383 | 831 |
|item prevParent icon showIndc showIcon showText |
1568 | 832 |
yTop "{ Class:SmallInteger }" |
833 |
yCtr "{ Class:SmallInteger }" |
|
834 |
yBot "{ Class:SmallInteger }" |
|
2383 | 835 |
level "{ Class:SmallInteger }" |
1390 | 836 |
|
1568 | 837 |
xIndc "{ Class:SmallInteger }" |
838 |
xIcon "{ Class:SmallInteger }" |
|
839 |
xText "{ Class:SmallInteger }" |
|
840 |
xL "{ Class:SmallInteger }" |
|
841 |
xR "{ Class:SmallInteger }" |
|
842 |
height "{ Class:SmallInteger }" |
|
1390 | 843 |
|
1568 | 844 |
offIndcY "{ Class:SmallInteger }" |
1390 | 845 |
| |
2383 | 846 |
xL := xLeft. |
847 |
xR := xL + w. |
|
1390 | 848 |
|
2392 | 849 |
showIndicators ifTrue:[ |
2383 | 850 |
offIndcY := openIndicator width // 2. |
1390 | 851 |
]. |
852 |
||
853 |
showLines ifTrue:[ |
|
1399 | 854 |
self drawLinesFrom:start to:stop x:xL y:yT toX:xR |
1390 | 855 |
]. |
2383 | 856 |
prevParent := #NIL. "/ to force a recompute |
857 |
yBot := yT. |
|
858 |
showIndc := false. |
|
1390 | 859 |
|
860 |
start to:stop do:[:anIndex| |
|
2408 | 861 |
(item := self at:anIndex ifAbsent:nil) isNil ifTrue:[ |
1390 | 862 |
^ self "/ list changed |
863 |
]. |
|
2383 | 864 |
yTop := yBot. |
865 |
yBot := self yVisibleOfLine:(anIndex + 1). |
|
1532
56e0fafc4349
change display protocol for item
Claus Gittinger <cg@exept.de>
parents:
1509
diff
changeset
|
866 |
height := yBot - yTop. |
2383 | 867 |
yCtr := yTop + (height // 2). |
1390 | 868 |
|
2383 | 869 |
item parent ~~ prevParent ifTrue:[ |
870 |
prevParent := item parent. |
|
871 |
level := item level. |
|
872 |
xIcon := self xVisibleOfIconAtLevel:level. |
|
873 |
xText := self xVisibleOfTextAtLevel:level. |
|
874 |
showText := (xText < xR). |
|
875 |
showIcon := (xIcon < xR and:[xText > xL]). |
|
1390 | 876 |
|
2392 | 877 |
showIndicators ifTrue:[ |
2383 | 878 |
xIndc := self xVisibleOfIndicatorAtLevel:level. |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
879 |
showIndc := (xIcon > xL and:[xIndc < xR]). |
1390 | 880 |
|
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
881 |
showIndc ifTrue:[ |
2383 | 882 |
showIndc := prevParent notNil or:[showLeftIndicators] |
1756 | 883 |
] |
1390 | 884 |
] |
885 |
]. |
|
886 |
||
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
887 |
(showIcon and:[(icon := self validateDrawableIconFor:item) notNil]) ifTrue:[ |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
888 |
(xIcon + icon width) > xL ifTrue:[ |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
889 |
icon displayOn:self x:xIcon y:(yCtr - (icon height // 2)) |
1568 | 890 |
] |
1390 | 891 |
]. |
892 |
||
893 |
showText ifTrue:[ |
|
1532
56e0fafc4349
change display protocol for item
Claus Gittinger <cg@exept.de>
parents:
1509
diff
changeset
|
894 |
self drawLabelAt:anIndex x:xText y:yTop h:height |
1390 | 895 |
]. |
2201
aa74fa6137a5
make indicator dependent on hasIndicator and not hasChildren
ca
parents:
2181
diff
changeset
|
896 |
(showIndc and:[item hasIndicator]) ifTrue:[ |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
897 |
item isExpanded ifTrue:[icon := openIndicator ] |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
898 |
ifFalse:[icon := closeIndicator]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
899 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
900 |
icon displayOn:self x:xIndc y:(yCtr - offIndcY) |
1390 | 901 |
]. |
2383 | 902 |
]. |
1390 | 903 |
! |
904 |
||
1399 | 905 |
drawLinesFrom:start to:stop x:xL y:yT toX:xR |
1390 | 906 |
"draw the lines between start to stop without clearing the background |
907 |
" |
|
2383 | 908 |
|item prevItem parent p1 p2 showVLines showHLine lv buildInArray showLeftIdc |
1390 | 909 |
|
910 |
x "{ Class:SmallInteger }" |
|
1570 | 911 |
xText "{ Class:SmallInteger }" |
912 |
||
1390 | 913 |
y "{ Class:SmallInteger }" |
914 |
yTop "{ Class:SmallInteger }" |
|
915 |
yBot "{ Class:SmallInteger }" |
|
916 |
yCtr "{ Class:SmallInteger }" |
|
917 |
||
918 |
begHLnY "{ Class:SmallInteger }" |
|
919 |
runHLnY "{ Class:SmallInteger }" |
|
2383 | 920 |
lftVrtX "{ Class:SmallInteger }" |
921 |
rgtVrtX "{ Class:SmallInteger }" |
|
922 |
level "{ Class:SmallInteger }" |
|
1390 | 923 |
|
2383 | 924 |
minVertLevel "{ Class:SmallInteger }" |
925 |
minHorzLevel "{ Class:SmallInteger }" |
|
926 |
smallestLevel "{ Class:SmallInteger }" |
|
1390 | 927 |
| |
2383 | 928 |
parent := prevItem := 4711. "/ to force a recompute |
1390 | 929 |
|
930 |
self setMaskOrigin:(self viewOrigin + (0 @ 1) \\ (lineMask extent)). |
|
931 |
self paint:lineColor on:bgColor. |
|
932 |
self mask:lineMask. |
|
2383 | 933 |
|
934 |
smallestLevel := self smallestLevelBetween:start and:stop. |
|
2392 | 935 |
minVertLevel := 2. |
936 |
||
937 |
showLeftIndicators ifTrue:[ |
|
938 |
showLeftIdc := showIndicators. |
|
939 |
showRoot ifFalse:[ minVertLevel := 3 ] |
|
940 |
] ifFalse:[ |
|
941 |
showLeftIdc := false. |
|
942 |
]. |
|
2383 | 943 |
|
944 |
showRoot ifFalse:[ minHorzLevel := 2 ] |
|
945 |
ifTrue:[ minHorzLevel := 1 ]. |
|
1390 | 946 |
|
2392 | 947 |
showLeftIdc ifFalse:[ |
948 |
minHorzLevel := minHorzLevel + 1. |
|
1897
5609f92e6d4a
do not draw the first vertical line if the rootItem is not visible
ca
parents:
1843
diff
changeset
|
949 |
]. |
5609f92e6d4a
do not draw the first vertical line if the rootItem is not visible
ca
parents:
1843
diff
changeset
|
950 |
|
2383 | 951 |
yBot := begHLnY := runHLnY := yT. |
952 |
level := 1. |
|
1570 | 953 |
|
1390 | 954 |
start to:stop do:[:anIndex| |
2408 | 955 |
(item := self at:anIndex ifAbsent:nil) isNil ifTrue:[ |
1390 | 956 |
^ self mask:nil "/ list changed |
957 |
]. |
|
958 |
yTop := yBot. |
|
959 |
yBot := self yVisibleOfLine:(anIndex + 1). |
|
960 |
yCtr := yTop + (yBot - yTop // 2). |
|
961 |
||
2383 | 962 |
item parent ~~ parent ifTrue:[ |
963 |
anIndex == 1 ifTrue:[ begHLnY := runHLnY := yCtr ]. |
|
964 |
parent := item parent. |
|
1390 | 965 |
|
966 |
prevItem == parent ifTrue:[ |
|
1567 | 967 |
level := level + 1. |
2383 | 968 |
lftVrtX := rgtVrtX. |
1390 | 969 |
] ifFalse:[ |
970 |
level := item level. |
|
2383 | 971 |
lftVrtX := self xVisibleOfVerticalLineAt:level. |
1390 | 972 |
]. |
2383 | 973 |
showVLines := (level >= minVertLevel and:[lftVrtX >= xL]). |
974 |
rgtVrtX := self xVisibleOfVerticalLineAt:level + 1. |
|
1570 | 975 |
|
2383 | 976 |
level >= minHorzLevel ifTrue:[ |
977 |
xText := (self xVisibleOfTextAtLevel:level) - textStartLeft. |
|
978 |
showHLine := (xL < xText and:[xR > lftVrtX]). |
|
979 |
] ifFalse:[ |
|
980 |
showHLine := false |
|
1570 | 981 |
]. |
1390 | 982 |
]. |
983 |
||
984 |
showHLine ifTrue:[ |
|
2383 | 985 |
( level ~~ 2 |
986 |
or:[showRoot or:[(showLeftIdc and:[item hasIndicator])]] |
|
987 |
) ifTrue:[ |
|
988 |
item drawHorizontalLineUpToText ifTrue:[ x := xText ] |
|
989 |
ifFalse:[ x := rgtVrtX ]. |
|
990 |
||
991 |
self displayLineFromX:lftVrtX y:yCtr toX:x y:yCtr. |
|
1570 | 992 |
]. |
2383 | 993 |
]. |
994 |
||
995 |
anIndex == start ifTrue:[ |
|
996 |
(item isExpanded and:[item hasChildren]) ifTrue:[ |
|
997 |
self displayLineFromX:rgtVrtX y:yCtr toX:rgtVrtX y:yBot. |
|
1570 | 998 |
] |
1390 | 999 |
]. |
1000 |
||
1001 |
showVLines ifTrue:[ |
|
2383 | 1002 |
parent last == item ifTrue:[ y := yCtr ] |
1003 |
ifFalse:[ y := yBot ]. |
|
1004 |
x := lftVrtX. |
|
1390 | 1005 |
p2 := parent. |
1006 |
lv := level - 1. |
|
1897
5609f92e6d4a
do not draw the first vertical line if the rootItem is not visible
ca
parents:
1843
diff
changeset
|
1007 |
|
2383 | 1008 |
level >= smallestLevel ifTrue:[ |
1897
5609f92e6d4a
do not draw the first vertical line if the rootItem is not visible
ca
parents:
1843
diff
changeset
|
1009 |
self displayLineFromX:x y:runHLnY toX:x y:y. |
5609f92e6d4a
do not draw the first vertical line if the rootItem is not visible
ca
parents:
1843
diff
changeset
|
1010 |
]. |
1390 | 1011 |
|
2383 | 1012 |
[ (p2 notNil and:[lv >= minVertLevel]) ] whileTrue:[ |
1013 |
p1 := p2 parent. |
|
1014 |
||
1015 |
p1 notNil ifTrue:[ |
|
1016 |
x := self xVisibleOfVerticalLineAt:lv. |
|
1017 |
||
1018 |
x < xL ifTrue:[ |
|
1019 |
p1 := nil. |
|
1390 | 1020 |
] ifFalse:[ |
2383 | 1021 |
p1 last ~~ p2 ifTrue:[ |
1022 |
lv >= smallestLevel ifTrue:[ |
|
1023 |
self displayLineFromX:x y:(yTop - 1) toX:x y:yBot |
|
1024 |
] ifFalse:[ |
|
1025 |
buildInArray isNil ifTrue:[buildInArray := Array new:smallestLevel]. |
|
1026 |
buildInArray at:lv put:yBot |
|
1027 |
] |
|
1028 |
]. |
|
1390 | 1029 |
]. |
1030 |
]. |
|
2383 | 1031 |
p2 := p1. |
1390 | 1032 |
lv := lv - 1. |
2383 | 1033 |
]. |
1390 | 1034 |
]. |
1035 |
prevItem := item. |
|
1036 |
runHLnY := yCtr. |
|
1037 |
]. |
|
1038 |
||
1567 | 1039 |
buildInArray notNil ifTrue:[ |
1040 |
y := begHLnY. |
|
1390 | 1041 |
|
2383 | 1042 |
2 to:smallestLevel do:[:i| |u yB| |
1043 |
(yB := buildInArray at:i) notNil ifTrue:[ |
|
1044 |
x := self xVisibleOfVerticalLineAt:i. |
|
1596 | 1045 |
|
2383 | 1046 |
x >= xL ifTrue:[ |
1897
5609f92e6d4a
do not draw the first vertical line if the rootItem is not visible
ca
parents:
1843
diff
changeset
|
1047 |
self displayLineFromX:x y:y toX:x y:yB |
5609f92e6d4a
do not draw the first vertical line if the rootItem is not visible
ca
parents:
1843
diff
changeset
|
1048 |
] |
1567 | 1049 |
]. |
1390 | 1050 |
] |
1051 |
]. |
|
1052 |
self mask:nil. |
|
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1053 |
! |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1054 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1055 |
validateDrawableIconFor:anItem |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1056 |
"returns the icon to be drawn for an item or nil |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1057 |
test the extent of the icopn; on error an exception is raised |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1058 |
" |
2383 | 1059 |
|width needMore icon maxLevel startOfText oldX newX| |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1060 |
|
2327 | 1061 |
icon := self iconFor:anItem. |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1062 |
icon isNil ifTrue:[^ nil]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1063 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1064 |
width := icon width. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1065 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1066 |
(constantHeight notNil and:[icon height > constantHeight]) ifTrue:[ |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1067 |
constantHeight := icon height + lineSpacing. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1068 |
self recomputeHeightOfContents. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1069 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1070 |
width <= imageWidth ifTrue:[ |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1071 |
self contentsChanged. |
2551 | 1072 |
StopRedrawSignal raiseRequest |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1073 |
]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1074 |
] ifFalse:[ |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1075 |
width <= imageWidth ifTrue:[ ^ icon ]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1076 |
]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1077 |
|
2383 | 1078 |
maxLevel := 1. |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1079 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1080 |
list criticalDo:[ |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1081 |
list do:[:el| maxLevel := maxLevel max:(el level) ]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1082 |
]. |
2383 | 1083 |
|
1084 |
needMore := (width - imageWidth) max:2. |
|
1085 |
oldX := self xVisibleOfIconAtLevel:(maxLevel + 1). |
|
1086 |
imageWidth := imageWidth + needMore. |
|
1087 |
newX := self xVisibleOfIconAtLevel:(maxLevel + 1). |
|
1088 |
alignTextRightX := alignTextRightX max:newX. |
|
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1089 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1090 |
widthOfContents notNil ifTrue:[ |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1091 |
alignTextRight ifTrue:[ |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1092 |
widthOfContents := alignTextRightX + maxWidthOfText |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1093 |
] ifFalse:[ |
2383 | 1094 |
widthOfContents := widthOfContents + (newX - oldX) |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1095 |
]. |
2353 | 1096 |
width := renderer widthFor:anItem. |
2327 | 1097 |
startOfText := self xVisibleOfTextAtLevel:(anItem level). |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1098 |
widthOfContents := widthOfContents max:(startOfText + width). |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1099 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1100 |
width > maxWidthOfText ifTrue:[ |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1101 |
maxWidthOfText := width |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1102 |
]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1103 |
]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1104 |
self contentsChanged. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1105 |
StopRedrawSignal raise. |
2353 | 1106 |
^ icon |
1390 | 1107 |
! ! |
1108 |
||
1109 |
!HierarchicalListView methodsFor:'event handling'! |
|
1110 |
||
1757 | 1111 |
buttonPress:button x:x y:y |
1112 |
"handle a button press event |
|
1113 |
" |
|
2313 | 1114 |
|line item x0 y0| |
2224 | 1115 |
|
1116 |
enabled ifFalse:[^ self]. |
|
2361 | 1117 |
self closeEditor. |
2224 | 1118 |
|
2313 | 1119 |
line := self yVisibleToLineNr:y. |
1120 |
line notNil ifTrue:[ |
|
2408 | 1121 |
item := self at:line ifAbsent:nil. |
2313 | 1122 |
item notNil ifTrue:[ |
2518 | 1123 |
x0 := self xVisibleOfIconAtLevel:(item level). |
2313 | 1124 |
x >= x0 ifTrue:[ |
2518 | 1125 |
x0 := self xVisibleOfTextAtLevel:(item level). |
2313 | 1126 |
y0 := self yVisibleOfLine:line. |
2224 | 1127 |
|
2518 | 1128 |
x >= x0 ifTrue:[ |
1129 |
(item processButtonPress:button x:(x - x0) y:(y - y0) on:self) == true ifTrue:[ |
|
1130 |
^ self |
|
1131 |
] |
|
1132 |
] ifFalse:[ |
|
1133 |
(item processButtonPressOnIcon:button on:self) == true ifTrue:[ |
|
1134 |
^ self |
|
1135 |
] |
|
1136 |
] |
|
2313 | 1137 |
]. |
1138 |
] |
|
1139 |
] ifFalse:[ |
|
1140 |
item := nil |
|
1141 |
]. |
|
1142 |
||
2392 | 1143 |
showIndicators ifTrue:[ |
1144 |
(button == 1 or:[button == #select]) ifTrue:[ |
|
1145 |
(item notNil and:[item hasIndicator]) ifTrue:[ |
|
1146 |
x0 := self xVisibleOfIndicatorAtLevel:(item level). |
|
2313 | 1147 |
|
2392 | 1148 |
(x between:x0 and:(x0 + openIndicator width)) ifTrue:[ |
1149 |
self indicatorPressedAt:line. |
|
1150 |
^ self |
|
1151 |
]. |
|
2313 | 1152 |
]. |
2224 | 1153 |
]. |
1154 |
]. |
|
2313 | 1155 |
|
2224 | 1156 |
super buttonPress:button x:x y:y. |
1157 |
! |
|
1390 | 1158 |
|
2224 | 1159 |
buttonPressOrReleaseAtLine:aLnNr x:x y:y |
1160 |
"handle a button press or release at a line |
|
1161 |
" |
|
1162 |
|oldIdx newIdx newItem| |
|
1163 |
||
1164 |
oldIdx := self selectedIndex. |
|
1165 |
super buttonPressOrReleaseAtLine:aLnNr x:x y:y. |
|
1166 |
newIdx := self selectedIndex. |
|
1167 |
||
1168 |
(newIdx ~~ oldIdx and:[newIdx ~~ 0]) ifTrue:[ |
|
1169 |
expandOnSelect ifTrue:[ |
|
2408 | 1170 |
newItem := self at:newIdx ifAbsent:nil. |
2307 | 1171 |
newItem isNil ifTrue:[^ self]. |
2224 | 1172 |
newItem expand |
1390 | 1173 |
]. |
2224 | 1174 |
self makeLineVisible:newIdx. |
1175 |
]. |
|
1757 | 1176 |
! |
1177 |
||
1178 |
keyPress:aKey x:x y:y |
|
1179 |
"a key was pressed - handle page-keys here |
|
1180 |
" |
|
1784 | 1181 |
<resource: #keyboard( #CursorLeft #CursorRight )> |
1757 | 1182 |
|
2377 | 1183 |
|item lineNr isCursorLeft| |
1757 | 1184 |
|
1782 | 1185 |
enabled ifFalse:[^ self]. |
2377 | 1186 |
|
1187 |
( aKey == Character space |
|
1188 |
or:[aKey == #CursorRight |
|
1189 |
or:[aKey == #CursorLeft]] |
|
1190 |
) ifFalse:[ |
|
1191 |
super keyPress:aKey x:x y:y. |
|
1192 |
^ self |
|
1193 |
]. |
|
1194 |
||
1195 |
lineNr := self cursorLine. |
|
1196 |
||
1197 |
lineNr ~~ 0 ifTrue:[ |
|
1198 |
item := cursorItem |
|
1199 |
] ifFalse:[ |
|
1200 |
lineNr := self selectedIndex. |
|
1201 |
lineNr == 0 ifTrue:[^ self]. |
|
1202 |
||
2408 | 1203 |
item := self at:lineNr ifAbsent:nil. |
2377 | 1204 |
item isNil ifTrue:[^ self]. |
1205 |
]. |
|
1782 | 1206 |
|
1207 |
aKey == Character space ifTrue:[ |
|
2378 | 1208 |
item toggleExpand. |
2377 | 1209 |
^ self |
1210 |
]. |
|
1211 |
isCursorLeft := aKey == #CursorLeft. |
|
1212 |
||
1213 |
item isExpanded == isCursorLeft ifTrue:[ |
|
2378 | 1214 |
item toggleExpand. |
2377 | 1215 |
^ self |
1782 | 1216 |
]. |
2377 | 1217 |
isCursorLeft ifTrue:[ |
1218 |
(item := item parent) isNil ifTrue:[^ self]. |
|
2408 | 1219 |
lineNr := self identityIndexOf:item. |
2377 | 1220 |
] ifFalse:[ |
1221 |
item hasChildren ifFalse:[^ self]. |
|
1222 |
lineNr := lineNr + 1. |
|
2179 | 1223 |
]. |
2377 | 1224 |
|
2408 | 1225 |
item := self at:lineNr ifAbsent:nil. |
2377 | 1226 |
item isNil ifTrue:[^ self]. |
1227 |
||
1228 |
(self canSelectIndex:lineNr forAdd:false) ifTrue:[ |
|
1229 |
self selection:lineNr |
|
1230 |
]. |
|
1390 | 1231 |
! ! |
1232 |
||
1757 | 1233 |
!HierarchicalListView methodsFor:'fetch resources'! |
1234 |
||
1235 |
fetchResources |
|
1236 |
"fetch device colors and ..., to avoid reallocation at redraw time; |
|
1237 |
*** called after a create or snapin to fetch all device resources |
|
1238 |
" |
|
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1239 |
|image defaultWidth| |
1757 | 1240 |
|
1241 |
super fetchResources. |
|
1242 |
||
1243 |
lineColor := lineColor onDevice:device. |
|
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1244 |
openIndicator := self imageOnMyDevice:openIndicator. |
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1245 |
closeIndicator := self imageOnMyDevice:closeIndicator. |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1246 |
defaultWidth := imageWidth. |
1757 | 1247 |
|
1248 |
icons keysAndValuesDo:[:aKey :anImage| |
|
1249 |
anImage isNil ifTrue:[ |
|
1250 |
('HierachicalListView [warning]: missing image: ' , aKey) errorPrintCR. |
|
1251 |
] ifFalse:[ |
|
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1252 |
image := self imageOnMyDevice:anImage. |
1757 | 1253 |
icons at:aKey put:image. |
1254 |
imageWidth := image width max:imageWidth. |
|
1255 |
] |
|
1256 |
]. |
|
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1257 |
imageWidth := (imageWidth + 1 // 2 * 2) max:defaultWidth. |
1904 | 1258 |
alignTextRightX := imageWidth + 20 max:alignTextRightX. |
1757 | 1259 |
! ! |
1260 |
||
2500 | 1261 |
!HierarchicalListView methodsFor:'initialization & release'! |
1390 | 1262 |
|
1263 |
initStyle |
|
1264 |
"setup viewStyle specifics |
|
1265 |
" |
|
1266 |
|cls| |
|
1267 |
||
1268 |
super initStyle. |
|
1269 |
||
2377 | 1270 |
cls := self class. |
1271 |
icons := Dictionary new. |
|
1390 | 1272 |
|
1273 |
openIndicator := self class openIndicator. |
|
1274 |
closeIndicator := self class closeIndicator. |
|
2312 | 1275 |
minLineHeight := (openIndicator height) max:(closeIndicator height). |
1276 |
||
1390 | 1277 |
lineColor := fgColor. |
1278 |
highlightMode := #label. |
|
1279 |
showRoot := true. |
|
1280 |
showLeftIndicators := true. |
|
1281 |
useDefaultIcons := true. |
|
1282 |
showLines := true. |
|
1283 |
imageInset := 4. |
|
2383 | 1284 |
imageWidth := 0. |
1568 | 1285 |
alignTextRight := false. |
1286 |
alignTextRightX := 8. |
|
1287 |
maxWidthOfText := 0. |
|
2224 | 1288 |
|
2325 | 1289 |
|
2328 | 1290 |
highlightEnterItem := styleSheet at:#'selection.highlightEnterItem' default:false. |
2310 | 1291 |
expandOnSelect := styleSheet at:#'selection.expandOnSelect' default:false. |
2224 | 1292 |
autoScrollHorizontal := true. |
2210 | 1293 |
! |
1294 |
||
1295 |
initialize |
|
1296 |
super initialize. |
|
1297 |
levelOfLastItem := 1. |
|
2392 | 1298 |
|
1299 |
self showIndicators:true. |
|
1390 | 1300 |
! ! |
1301 |
||
1302 |
!HierarchicalListView methodsFor:'private'! |
|
1303 |
||
2327 | 1304 |
iconFor:anItem |
1305 |
"returns an icon or image for the item or nil if the item |
|
1306 |
provides no image and #useDefaultIcons is switched off. |
|
1390 | 1307 |
" |
2307 | 1308 |
|iconOrKey image| |
1390 | 1309 |
|
2307 | 1310 |
"/ get the icon or access key from the item |
1311 |
iconOrKey := anItem icon. |
|
1390 | 1312 |
|
2307 | 1313 |
iconOrKey notNil ifTrue:[ |
1314 |
iconOrKey isImageOrForm ifTrue:[ |
|
1315 |
"/ got an image; have to register the image on my device |
|
1390 | 1316 |
|
2307 | 1317 |
iconOrKey device == device ifTrue:[ |
1318 |
^ iconOrKey |
|
1319 |
]. |
|
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1320 |
^ icons at:iconOrKey ifAbsentPut:[ self imageOnMyDevice:iconOrKey ]. |
1390 | 1321 |
]. |
1322 |
||
2307 | 1323 |
image := icons at:iconOrKey ifAbsent:nil. |
1324 |
image notNil ifTrue:[ ^ image ]. |
|
1325 |
]. |
|
1326 |
||
1327 |
"/ test whether a default image should be returned |
|
1328 |
useDefaultIcons ifFalse:[ |
|
1329 |
^ nil |
|
1390 | 1330 |
]. |
1331 |
||
2307 | 1332 |
anItem hasChildren ifFalse:[ |
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1333 |
^ icons at:#empty ifAbsentPut:[ self imageOnMyDevice:(self class emptyIcon) ] |
1390 | 1334 |
]. |
1898 | 1335 |
|
2307 | 1336 |
anItem isExpanded ifTrue:[ |
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1337 |
^ icons at:#expanded ifAbsentPut:[ self imageOnMyDevice:(self class expandedIcon) ]. |
1898 | 1338 |
]. |
2488
74c81c1e30d7
imageOnDevice -> imageOnMyDevice
Claus Gittinger <cg@exept.de>
parents:
2421
diff
changeset
|
1339 |
^ icons at:#collapsed ifAbsentPut:[ self imageOnMyDevice:(self class collapsedIcon) ]. |
1390 | 1340 |
! |
1341 |
||
2353 | 1342 |
lineHeightFor:anItem |
1343 |
"returns the computed line height for an item |
|
1344 |
" |
|
1345 |
|image height| |
|
1346 |
||
1347 |
height := renderer heightFor:anItem. |
|
1348 |
image := self iconFor:anItem. |
|
1349 |
||
1350 |
image notNil ifTrue:[ |
|
1351 |
height := image height max:height. |
|
1352 |
]. |
|
1353 |
||
1354 |
hasConstantHeight ifTrue:[ |
|
1355 |
icons size ~~ 0 ifTrue:[ |
|
1356 |
icons do:[:anIcon| height := anIcon height max:height ] |
|
1357 |
] ifFalse:[ |
|
1358 |
image isNil ifTrue:[ height := height max:16 ] |
|
1359 |
] |
|
1360 |
]. |
|
1361 |
height := height + lineSpacing. |
|
1362 |
^ height max:minLineHeight |
|
1363 |
! |
|
1364 |
||
1390 | 1365 |
smallestLevelBetween:start and:stop |
2327 | 1366 |
"returns the smallest level of all items in a range |
1390 | 1367 |
" |
1368 |
|prevItem currParent nextParent item |
|
1369 |
||
1370 |
lvl "{ Class:SmallInteger }" |
|
1371 |
min "{ Class:SmallInteger }" |
|
1372 |
beg "{ Class:SmallInteger }" |
|
1373 |
| |
|
1374 |
||
2408 | 1375 |
prevItem := self at:start ifAbsent:nil. |
1390 | 1376 |
|
1508
9c54f2e53da1
check whether #at:ifAbsent returns nil.
Claus Gittinger <cg@exept.de>
parents:
1431
diff
changeset
|
1377 |
(prevItem isNil or:[(currParent := prevItem parent) isNil]) ifTrue:[ |
1390 | 1378 |
^ 1 |
1379 |
]. |
|
1380 |
||
1381 |
(min := prevItem level) == 2 ifTrue:[ |
|
1382 |
^ min |
|
1383 |
]. |
|
1384 |
beg := start + 1. |
|
1385 |
||
1386 |
beg to:stop do:[:i| |
|
2408 | 1387 |
item := self at:i ifAbsent:nil. |
1508
9c54f2e53da1
check whether #at:ifAbsent returns nil.
Claus Gittinger <cg@exept.de>
parents:
1431
diff
changeset
|
1388 |
item isNil ifTrue:[^ min]. |
1390 | 1389 |
|
1390 |
(nextParent := item parent) == currParent ifFalse:[ |
|
1391 |
(currParent := nextParent) == prevItem ifFalse:[ |
|
1392 |
(lvl := item level) == 2 ifTrue:[ |
|
1393 |
^ 2 |
|
1394 |
]. |
|
1395 |
min := min min:lvl |
|
1396 |
] |
|
1397 |
]. |
|
1398 |
prevItem := item |
|
1399 |
]. |
|
1400 |
^ min |
|
1401 |
! |
|
1402 |
||
1403 |
widthOfWidestLineBetween:firstLine and:lastLine |
|
2327 | 1404 |
"returns the width of the longest line in pixels in a range |
1390 | 1405 |
" |
2383 | 1406 |
|parent item |
1407 |
textX "{ Class: SmallInteger }" |
|
1408 |
level "{ Class: SmallInteger }" |
|
1409 |
width "{ Class: SmallInteger }" |
|
1410 |
widthOfLabel "{ Class: SmallInteger }" |
|
1390 | 1411 |
| |
2383 | 1412 |
width := 20. |
1568 | 1413 |
|
1414 |
alignTextRight ifTrue:[ |
|
2383 | 1415 |
parent := nil. |
1416 |
level := 1. |
|
1417 |
||
1568 | 1418 |
firstLine to:lastLine do:[:idx| |
2408 | 1419 |
item := self at:idx ifAbsent:nil. |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1420 |
|
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1421 |
item notNil ifTrue:[ |
2353 | 1422 |
width := (renderer widthFor:item) max:width. |
1568 | 1423 |
|
2383 | 1424 |
item parent ~~ parent ifTrue:[ |
1425 |
level := item level max:level. |
|
1426 |
parent := item parent. |
|
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1427 |
]. |
1568 | 1428 |
]. |
1429 |
]. |
|
1430 |
maxWidthOfText := maxWidthOfText max:width. |
|
2383 | 1431 |
textX := self xVisibleOfIconAtLevel:(level + 1). |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1432 |
|
2383 | 1433 |
alignTextRightX < textX ifTrue:[ |
2417
a0b7d30a4073
instead of #numArgs use: #valueWithOptionalArgument:and
ca
parents:
2414
diff
changeset
|
1434 |
alignTextRightX := textX. |
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1435 |
shown ifTrue:[ self invalidate]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1436 |
]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1437 |
^ alignTextRightX + width |
1568 | 1438 |
]. |
1390 | 1439 |
|
2383 | 1440 |
parent := 4711. "/ force a computation |
1390 | 1441 |
|
1442 |
firstLine to:lastLine do:[:idx| |
|
2408 | 1443 |
item := self at:idx ifAbsent:nil. |
1390 | 1444 |
|
2383 | 1445 |
item notNil ifTrue:[ |
1446 |
item parent ~~ parent ifTrue:[ |
|
1447 |
textX := self xVisibleOfTextAtLevel:(item level). |
|
1448 |
parent := item parent. |
|
1449 |
]. |
|
1450 |
widthOfLabel := renderer widthFor:item. |
|
1451 |
maxWidthOfText := maxWidthOfText max:widthOfLabel. |
|
1452 |
width := widthOfLabel + textX max:width |
|
1390 | 1453 |
]. |
1454 |
]. |
|
2383 | 1455 |
^ width + viewOrigin x. |
1390 | 1456 |
! |
1457 |
||
2327 | 1458 |
xVisibleOfIconAtLevel:aLevel |
1459 |
"returns the visible origin x of the icon at a level. |
|
1390 | 1460 |
" |
2383 | 1461 |
|x| |
1390 | 1462 |
|
2383 | 1463 |
x := self xVisibleOfVerticalLineAt:aLevel. |
1390 | 1464 |
|
2383 | 1465 |
(showRoot and:[aLevel == 1]) ifTrue:[ |
2392 | 1466 |
showLeftIndicators ifFalse:[ |
2383 | 1467 |
^ x - (imageWidth // 2) |
1468 |
]. |
|
1390 | 1469 |
]. |
2383 | 1470 |
^ x + (openIndicator width // 2) + imageInset |
1471 |
! |
|
1472 |
||
1473 |
xVisibleOfIndicatorAtLevel:aLevel |
|
1474 |
"returns the visible origin x of the vertical line at a level. |
|
1475 |
" |
|
1476 |
|x| |
|
1477 |
||
1478 |
x := self xVisibleOfVerticalLineAt:aLevel. |
|
1479 |
x := x - (openIndicator width // 2). |
|
1480 |
^ x |
|
1390 | 1481 |
! |
1482 |
||
2327 | 1483 |
xVisibleOfItem:anItem |
1484 |
"returns the visible origin x of the item's label. |
|
1485 |
" |
|
1486 |
^ self xVisibleOfTextAtLevel:(anItem level) |
|
1487 |
! |
|
1488 |
||
1489 |
xVisibleOfTextAtLevel:aLevel |
|
1490 |
"returns the visible origin x of the text label at a level. |
|
1757 | 1491 |
" |
1492 |
alignTextRight ifTrue:[ |
|
1493 |
^ alignTextRightX - (viewOrigin x) |
|
1494 |
]. |
|
2327 | 1495 |
^ (self xVisibleOfIconAtLevel:aLevel) + imageWidth + textStartLeft |
2383 | 1496 |
! |
1497 |
||
1498 |
xVisibleOfVerticalLineAt:aLevel |
|
1499 |
"returns the visible origin x of the vertical line assigned to a level. |
|
1500 |
" |
|
1501 |
|xOffset opWidth2 igWidth2 firstLevel| |
|
1502 |
||
1503 |
opWidth2 := openIndicator width // 2. |
|
1504 |
igWidth2 := imageWidth // 2. |
|
1505 |
xOffset := igWidth2 + opWidth2 + imageInset. |
|
1506 |
||
1507 |
showRoot ifTrue:[ firstLevel := 1 ] |
|
1508 |
ifFalse:[ firstLevel := 2 ]. |
|
1509 |
||
2392 | 1510 |
showLeftIndicators ifTrue:[ |
2383 | 1511 |
aLevel < firstLevel ifTrue:[ |
1512 |
xOffset := opWidth2 - (firstLevel * xOffset) |
|
1513 |
] ifFalse:[ |
|
1514 |
xOffset := opWidth2 + (aLevel - firstLevel * xOffset) |
|
1515 |
] |
|
1516 |
] ifFalse:[ |
|
1517 |
aLevel < 2 ifTrue:[ |
|
1518 |
xOffset := igWidth2 - (aLevel - firstLevel * xOffset) |
|
1519 |
] ifFalse:[ |
|
1520 |
xOffset := igWidth2 + (aLevel - firstLevel - 1 * xOffset) |
|
1521 |
]. |
|
1522 |
]. |
|
1523 |
"/ 2 := a left margin |
|
1524 |
^ xOffset + 2 - (viewOrigin x) |
|
1390 | 1525 |
! ! |
1526 |
||
2224 | 1527 |
!HierarchicalListView methodsFor:'scrolling'! |
1528 |
||
1529 |
computeViewOriginXat:aLnrNr |
|
2327 | 1530 |
"returns the viewOrigin x to make the item at a line visisble |
2224 | 1531 |
" |
2383 | 1532 |
|item xLft xRgt level vwOrgX useX| |
2224 | 1533 |
|
2233 | 1534 |
vwOrgX := viewOrigin x. |
2224 | 1535 |
|
2383 | 1536 |
alignTextRight ifTrue:[ ^ vwOrgX ]. |
1537 |
aLnrNr == 1 ifTrue:[ ^ 0 ]. |
|
1538 |
||
2408 | 1539 |
item := self at:aLnrNr ifAbsent:nil. |
2307 | 1540 |
item isNil ifTrue:[ ^ vwOrgX ]. |
2224 | 1541 |
|
1542 |
level := item level. |
|
2383 | 1543 |
level == 1 ifTrue:[ ^ 0 ]. "/ is root item |
1544 |
||
1545 |
level == 2 ifTrue:[ "/ parent is root |
|
1546 |
(showRoot and:[showLeftIndicators]) ifFalse:[ ^ 0 ]. |
|
1547 |
]. |
|
2224 | 1548 |
|
2327 | 1549 |
xLft := self xVisibleOfIconAtLevel:(level - 1). |
2383 | 1550 |
xLft > 0 ifFalse:[ ^ vwOrgX + xLft max:0 ]. |
2224 | 1551 |
|
2353 | 1552 |
xRgt := (self xVisibleOfTextAtLevel:level) + (renderer widthFor:item). |
2383 | 1553 |
useX := xRgt - width. |
2224 | 1554 |
|
2383 | 1555 |
useX > 0 ifFalse:[ ^ vwOrgX ]. |
1556 |
useX := useX + 16 min:xLft. |
|
1557 |
^ vwOrgX + useX. |
|
2224 | 1558 |
! |
1559 |
||
1560 |
makeLineVisible:aLnrNr |
|
2327 | 1561 |
"make the line horizontal and vertical visible |
2224 | 1562 |
" |
1563 |
|newY item y0 newX| |
|
1564 |
||
2316
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1565 |
alignTextRight ifTrue:[^ self]. |
f91a9635462e
bug fix for alignTextRight; recomputation of alignTextRightX
ca
parents:
2313
diff
changeset
|
1566 |
|
2224 | 1567 |
(shown and:[aLnrNr notNil]) ifFalse:[^ self]. |
1568 |
||
1569 |
aLnrNr <= 1 ifTrue:[ |
|
1570 |
aLnrNr == 1 ifTrue:[ self scrollTo:(0 @ 0) ]. |
|
2353 | 1571 |
^ self |
2224 | 1572 |
]. |
1573 |
||
2408 | 1574 |
item := self at:aLnrNr ifAbsent:nil. |
2307 | 1575 |
item isNil ifTrue:[^ self]. |
2224 | 1576 |
|
1577 |
y0 := self yVisibleOfLine:aLnrNr. |
|
1578 |
||
1579 |
( y0 < margin |
|
2353 | 1580 |
or:[(y0 + (renderer heightFor:item)) > (height - margin)] |
2224 | 1581 |
) ifTrue:[ |
1582 |
newY := ((self yAbsoluteOfLine:aLnrNr) - (height // 2)) max:0. |
|
1583 |
] ifFalse:[ |
|
1584 |
newY := viewOrigin y. |
|
1585 |
]. |
|
1586 |
||
1587 |
newX := viewOrigin x. |
|
1588 |
||
1589 |
(autoScrollHorizontal or:[newX ~~ 0]) ifTrue:[ |
|
1590 |
newX := self computeViewOriginXat:aLnrNr |
|
1591 |
]. |
|
1592 |
self scrollTo:(newX @ newY). |
|
1593 |
! ! |
|
1594 |
||
1390 | 1595 |
!HierarchicalListView class methodsFor:'documentation'! |
1596 |
||
1597 |
version |
|
2551 | 1598 |
^ '$Header: /cvs/stx/stx/libwidg2/HierarchicalListView.st,v 1.85 2003-08-18 13:14:19 cg Exp $' |
1390 | 1599 |
! ! |