author | Claus Gittinger <cg@exept.de> |
Fri, 23 Apr 1999 14:47:39 +0200 | |
changeset 1328 | 95a7d89cf335 |
parent 1309 | d87d431dad62 |
child 1415 | 3727e58ab63b |
permissions | -rw-r--r-- |
444 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
|
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 |
||
14 |
SelectionInListView subclass:#SelectionInTreeView |
|
847 | 15 |
instanceVariableNames:'validateDoubleClickBlock selectionHolder rootHolder imageWidth |
16 |
showLines listOfNodes imageInset textInset labelOffsetY lineMask |
|
1171 | 17 |
itemClass lineColor computeResources showRoot |
18 |
showDirectoryIndicator closeIndicator openIndicator |
|
19 |
showDirectoryIndicatorForRoot imageOpened imageClosed imageItem |
|
20 |
discardMotionEvents registeredImages supportsExpandAll |
|
21 |
buildInArray drawVLinesFromLevel highlightMode editorWidget |
|
1202
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
22 |
editorIndex editValueFgColor validateExpandabilityBlock' |
1171 | 23 |
classVariableNames:'DefaultHilightMode SelectionInset' |
847 | 24 |
poolDictionaries:'' |
1233 | 25 |
category:'Views-Trees' |
444 | 26 |
! |
27 |
||
28 |
!SelectionInTreeView class methodsFor:'documentation'! |
|
29 |
||
30 |
copyright |
|
31 |
" |
|
32 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
|
33 |
All Rights Reserved |
|
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 |
||
45 |
documentation |
|
46 |
" |
|
47 |
somewhat like a SelectionInListView; but specialized for hierarchical (i.e. tree-like) |
|
48 |
lists and adds the functions to show/hide subtrees. |
|
456 | 49 |
Requires SelectionInTree as model and TreeItem (or compatible) list entries. |
444 | 50 |
|
456 | 51 |
This class obsoletes SelectionInTreeView, which is no longer |
446 | 52 |
maintained but kept for backward compatibility. |
53 |
||
1190 | 54 |
Notice: this class replaces the more-or-less obsolete SelectionInHierarchyView |
55 |
class. |
|
446 | 56 |
|
444 | 57 |
[see also:] |
456 | 58 |
SelectionInTree |
59 |
TreeItem |
|
444 | 60 |
SelectionInListView |
494 | 61 |
FileSelectionTree |
444 | 62 |
|
63 |
[author:] |
|
64 |
Claus Atzkern |
|
65 |
" |
|
66 |
||
67 |
! |
|
68 |
||
69 |
examples |
|
70 |
" |
|
71 |
shows the tree of smalltalk classes: |
|
72 |
[exBegin] |
|
514 | 73 |
|top sel| |
456 | 74 |
|
514 | 75 |
top := StandardSystemView new; extent:300@300. |
456 | 76 |
sel := SelectionInTreeView new. |
514 | 77 |
sel root:(TreeItem newAsTreeFromSmalltalkClass:Object). |
456 | 78 |
sel action:[:nr | Transcript show:'selected:'; showCR:nr]. |
79 |
top add:(ScrollableView forView:sel) in:((0.0 @ 0.0 ) corner:( 1.0 @ 1.0)). |
|
80 |
top open. |
|
81 |
[exEnd] |
|
82 |
||
83 |
||
485 | 84 |
|
456 | 85 |
same, including nil-subclasses (i.e. really all classes): |
86 |
[exBegin] |
|
514 | 87 |
|top sel| |
444 | 88 |
|
514 | 89 |
top := StandardSystemView new; extent:300@300. |
456 | 90 |
sel := SelectionInTreeView new. |
514 | 91 |
sel root:(TreeItem newAsTreeFromSmalltalkClass:nil). |
456 | 92 |
sel action:[:nr | Transcript show:'selected:'; showCR:nr]. |
685 | 93 |
sel lineColor:(Color red). |
456 | 94 |
top add:(ScrollableView forView:sel) in:((0.0 @ 0.0 ) corner:( 1.0 @ 1.0)). |
95 |
top open. |
|
96 |
[exEnd] |
|
97 |
||
485 | 98 |
|
483 | 99 |
|
485 | 100 |
shows the tree of smalltalk classes; show directory indication and no |
101 |
lines. |
|
102 |
[exBegin] |
|
514 | 103 |
|top sel| |
483 | 104 |
|
514 | 105 |
top := StandardSystemView new; extent:300@300. |
483 | 106 |
sel := SelectionInTreeView new. |
485 | 107 |
sel showLines:false. |
108 |
sel showDirectoryIndicator:true. |
|
514 | 109 |
sel root:(TreeItem newAsTreeFromSmalltalkClass:Object). |
485 | 110 |
sel action:[:nr | Transcript show:'selected:'; showCR:nr]. |
483 | 111 |
top add:(ScrollableView forView:sel) in:((0.0 @ 0.0 ) corner:( 1.0 @ 1.0)). |
112 |
top open. |
|
485 | 113 |
[exEnd] |
114 |
" |
|
115 |
||
514 | 116 |
|
444 | 117 |
! ! |
118 |
||
119 |
!SelectionInTreeView class methodsFor:'constants'! |
|
120 |
||
494 | 121 |
minImageInset |
122 |
"returns minimum inset from directory indication to image |
|
471 | 123 |
" |
494 | 124 |
^ 6 |
490 | 125 |
|
126 |
||
127 |
! ! |
|
128 |
||
900 | 129 |
!SelectionInTreeView class methodsFor:'defaults'! |
130 |
||
1171 | 131 |
defaultModelClass |
132 |
"returns the default model |
|
133 |
" |
|
134 |
^ SelectionInTree |
|
135 |
! |
|
136 |
||
900 | 137 |
updateStyleCache |
138 |
"extract values from the styleSheet and cache them in class variables" |
|
139 |
||
140 |
<resource: #style (#'selection.highlightMode')> |
|
141 |
||
1171 | 142 |
SelectionInset := 4. |
900 | 143 |
DefaultHilightMode := StyleSheet at:'selection.highlightMode' default:#line. |
144 |
" |
|
145 |
self updateStyleCache |
|
146 |
" |
|
147 |
||
148 |
||
149 |
! ! |
|
150 |
||
811 | 151 |
!SelectionInTreeView class methodsFor:'resources'! |
490 | 152 |
|
153 |
closeIndicator |
|
1278 | 154 |
"returns a little [+] bitmap" |
155 |
||
589 | 156 |
<resource: #fileImage> |
157 |
||
811 | 158 |
^ Icon |
159 |
constantNamed:#plus |
|
160 |
ifAbsentPut:[Image fromFile:('xpmBitmaps/plus.xpm')] |
|
161 |
||
589 | 162 |
|
811 | 163 |
|
164 |
||
165 |
||
166 |
||
471 | 167 |
! |
168 |
||
444 | 169 |
imageClosed |
1278 | 170 |
"returns a closed file-directory bitmap" |
171 |
||
589 | 172 |
<resource: #fileImage> |
173 |
||
811 | 174 |
^ Icon |
175 |
constantNamed:#directory |
|
176 |
ifAbsentPut:[Image fromFile:('xpmBitmaps/document_images/tiny_yellow_dir.xpm')] |
|
444 | 177 |
|
178 |
! |
|
179 |
||
180 |
imageItem |
|
1278 | 181 |
"returns a regular file bitmap" |
182 |
||
589 | 183 |
<resource: #fileImage> |
184 |
||
811 | 185 |
^ Icon |
186 |
constantNamed:#plainFile |
|
187 |
ifAbsentPut:[Image fromFile:('xpmBitmaps/document_images/tiny_file_plain.xpm')] |
|
444 | 188 |
|
811 | 189 |
|
444 | 190 |
|
811 | 191 |
|
192 |
||
444 | 193 |
! |
194 |
||
195 |
imageOpened |
|
1278 | 196 |
"returns an opened file-directory bitmap" |
197 |
||
589 | 198 |
<resource: #fileImage> |
199 |
||
811 | 200 |
^ Icon |
201 |
constantNamed:#directoryOpened |
|
202 |
ifAbsentPut:[Image fromFile:('xpmBitmaps/document_images/tiny_yellow_dir_open.xpm')] |
|
444 | 203 |
|
490 | 204 |
! |
205 |
||
206 |
openIndicator |
|
1278 | 207 |
"returns a little [-] bitmap" |
208 |
||
589 | 209 |
<resource: #fileImage> |
210 |
||
811 | 211 |
^ Icon |
212 |
constantNamed:#minus |
|
213 |
ifAbsentPut:[Image fromFile:('xpmBitmaps/minus.xpm')] |
|
490 | 214 |
|
811 | 215 |
|
444 | 216 |
! ! |
217 |
||
218 |
!SelectionInTreeView methodsFor:'accessing'! |
|
219 |
||
900 | 220 |
highlightMode |
221 |
"get the mode how to draw a selected line: |
|
222 |
#line draw whole line selected |
|
223 |
#label draw label selected |
|
224 |
" |
|
225 |
^ highlightMode |
|
226 |
! |
|
227 |
||
228 |
highlightMode:aMode |
|
229 |
"set the mode how to draw a selected line: |
|
230 |
#line draw whole line selected |
|
231 |
#label draw label selected |
|
232 |
" |
|
233 |
|mode| |
|
234 |
||
235 |
(mode := aMode) == #label ifFalse:[ |
|
236 |
mode := #line |
|
237 |
]. |
|
238 |
||
239 |
mode ~~ highlightMode ifTrue:[ |
|
240 |
highlightMode := mode. |
|
241 |
||
242 |
shown ifTrue:[ |
|
243 |
self invalidate |
|
244 |
] |
|
245 |
] |
|
246 |
! |
|
247 |
||
1171 | 248 |
itemClass |
249 |
"returns current itemClass used |
|
250 |
" |
|
251 |
^ itemClass |
|
252 |
||
253 |
||
254 |
! |
|
255 |
||
256 |
itemClass:anItemClass |
|
257 |
"set itemClass to be used |
|
258 |
" |
|
259 |
||
260 |
(anItemClass notNil and:[anItemClass ~~ itemClass]) ifTrue:[ |
|
261 |
itemClass := anItemClass. |
|
262 |
computeResources := true. |
|
263 |
self refetchDeviceResources. |
|
264 |
]. |
|
265 |
||
266 |
! |
|
267 |
||
685 | 268 |
lineColor |
269 |
"returns user configured line color or nil |
|
270 |
" |
|
271 |
^ lineColor |
|
272 |
||
273 |
! |
|
274 |
||
275 |
lineColor:aColor |
|
276 |
"returns user configured line color or nil |
|
277 |
" |
|
278 |
|col| |
|
279 |
||
280 |
col := aColor = fgColor ifTrue:[nil] ifFalse:[aColor]. |
|
281 |
||
282 |
col = lineColor ifFalse:[ |
|
283 |
lineColor := col. |
|
284 |
||
285 |
shown ifTrue:[ |
|
286 |
lineColor notNil ifTrue:[lineColor := lineColor on:device]. |
|
287 |
self invalidate |
|
288 |
] |
|
289 |
] |
|
290 |
! |
|
291 |
||
490 | 292 |
nodeAtIndex:anIndex |
293 |
"returns node at an index or nil |
|
294 |
" |
|
785 | 295 |
(anIndex notNil and:[anIndex between:1 and:listOfNodes size]) ifTrue:[ |
490 | 296 |
^ listOfNodes at:anIndex |
297 |
]. |
|
298 |
^ nil |
|
299 |
! |
|
300 |
||
507 | 301 |
root |
302 |
"gets the root of the model; the first item into list. |
|
303 |
" |
|
304 |
^ self nodeAtIndex:1 |
|
305 |
! |
|
306 |
||
307 |
root:aRoot |
|
308 |
"sets the root of the model; the first item into list. |
|
309 |
" |
|
514 | 310 |
aRoot notNil ifTrue:[aRoot expand]. |
507 | 311 |
model root:aRoot |
312 |
! |
|
313 |
||
490 | 314 |
textInset |
315 |
"get the left inset of the text label |
|
316 |
" |
|
317 |
^ textInset |
|
318 |
! |
|
319 |
||
320 |
textInset:anInset |
|
321 |
"set the left inset of the text label |
|
322 |
" |
|
323 |
anInset ~~ textInset ifTrue:[ |
|
324 |
anInset >= 0 ifTrue:[ |
|
325 |
textInset := anInset. |
|
326 |
self invalidate |
|
327 |
] ifFalse:[ |
|
328 |
self error |
|
329 |
] |
|
330 |
]. |
|
331 |
! ! |
|
332 |
||
333 |
!SelectionInTreeView methodsFor:'accessing-behavior'! |
|
334 |
||
855 | 335 |
drawVLinesFromLevel |
336 |
"returns the level vertical lines are drawn from; |
|
337 |
starting at 1 up to n |
|
338 |
" |
|
339 |
^ drawVLinesFromLevel |
|
340 |
! |
|
341 |
||
342 |
drawVLinesFromLevel:aLevel |
|
343 |
"set the level vertical lines are drawn from; |
|
344 |
starting at 1 up to n |
|
345 |
" |
|
346 |
|lv| |
|
347 |
||
348 |
lv := (aLevel ? 1) max:1. |
|
349 |
||
350 |
lv ~~ drawVLinesFromLevel ifTrue:[ |
|
351 |
drawVLinesFromLevel := lv. |
|
352 |
self invalidate |
|
353 |
] |
|
354 |
! |
|
355 |
||
835 | 356 |
supportsExpandAll |
357 |
^ supportsExpandAll |
|
358 |
! |
|
359 |
||
360 |
supportsExpandAll:aBool |
|
361 |
||
362 |
supportsExpandAll := aBool |
|
363 |
! |
|
364 |
||
517 | 365 |
validateDoubleClickBlock |
1202
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
366 |
"return the conditionBlock; this block is evaluated before a doubleClick action |
517 | 367 |
on a node will be performed. In case of returning false, the doubleClick will |
368 |
not be handled. |
|
369 |
" |
|
370 |
^ validateDoubleClickBlock |
|
371 |
||
372 |
||
373 |
! |
|
374 |
||
375 |
validateDoubleClickBlock:aOneArgBlock |
|
376 |
"set the conditionBlock; this block is evaluated before a doubleClick action |
|
377 |
on a node will be performed. In case of returning false, the doubleClick will |
|
378 |
not be handled. |
|
379 |
" |
|
380 |
validateDoubleClickBlock := aOneArgBlock |
|
381 |
||
382 |
||
1202
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
383 |
! |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
384 |
|
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
385 |
validateExpandabilityBlock |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
386 |
"return the expand conditionBlock; this block is evaluated before an expand due to |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
387 |
a doubleClick on a node will be performed. In case of returning false, |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
388 |
the node will not be expanded. |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
389 |
" |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
390 |
^ validateExpandabilityBlock |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
391 |
|
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
392 |
|
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
393 |
! |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
394 |
|
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
395 |
validateExpandabilityBlock:aOneArgBlock |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
396 |
"set the expand conditionBlock; this block is evaluated before an expand due to |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
397 |
a doubleClick on a node will be performed. In case of returning false, |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
398 |
the node will not be expanded. |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
399 |
" |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
400 |
validateExpandabilityBlock := aOneArgBlock |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
401 |
|
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
402 |
|
514 | 403 |
! ! |
404 |
||
405 |
!SelectionInTreeView methodsFor:'accessing-channels'! |
|
406 |
||
407 |
rootHolder |
|
408 |
"get the holder which keeps the hierarchical list entry or nil |
|
409 |
" |
|
410 |
^ rootHolder |
|
411 |
! |
|
412 |
||
413 |
rootHolder:aValueHolder |
|
414 |
"set the holder which keeps the hierarchical list entry or nil |
|
415 |
" |
|
416 |
rootHolder notNil ifTrue:[ |
|
417 |
rootHolder removeDependent:self |
|
418 |
]. |
|
855 | 419 |
|
514 | 420 |
(rootHolder := aValueHolder) notNil ifTrue:[ |
421 |
rootHolder addDependent:self. |
|
422 |
self rootFromModel. |
|
494 | 423 |
]. |
514 | 424 |
! |
425 |
||
426 |
selectionHolder |
|
427 |
"get the holder which keeps a list of selected items or nil |
|
428 |
" |
|
429 |
^ selectionHolder |
|
430 |
||
431 |
! |
|
432 |
||
433 |
selectionHolder:aHolder |
|
434 |
"set the holder which keeps a list of selected items or nil |
|
435 |
" |
|
436 |
selectionHolder notNil ifTrue:[ |
|
437 |
selectionHolder removeDependent:self |
|
438 |
]. |
|
439 |
||
440 |
(selectionHolder := aHolder) notNil ifTrue:[ |
|
441 |
selectionHolder addDependent:self. |
|
442 |
self selectionFromModel |
|
443 |
]. |
|
444 |
||
490 | 445 |
! ! |
446 |
||
447 |
!SelectionInTreeView methodsFor:'accessing-images'! |
|
448 |
||
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
449 |
imageClosed |
1278 | 450 |
"return the value of the instance variable 'imageClosed'. |
451 |
Thats the (default) bitmap image shown for closed folders |
|
452 |
(initialized to a file-directory bitmap)" |
|
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
453 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
454 |
^ imageClosed |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
455 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
456 |
"Created: 3.7.1997 / 12:34:31 / cg" |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
457 |
! |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
458 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
459 |
imageItem |
1278 | 460 |
"return the value of the instance variable 'imageItem'. |
461 |
Thats the (default) bitmap image shown for regular items |
|
462 |
(initialized to a plain-file bitmap)" |
|
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
463 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
464 |
^ imageItem |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
465 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
466 |
"Created: 3.7.1997 / 12:34:34 / cg" |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
467 |
! |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
468 |
|
569 | 469 |
imageOnDevice:anImage |
846 | 470 |
"associate image to device and clear pixel mask (in case of realized); |
569 | 471 |
returns the new image. |
472 |
" |
|
473 |
|img| |
|
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
474 |
|
846 | 475 |
img := anImage. |
1070
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
476 |
img notNil ifTrue:[ |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
477 |
img device ~~ device ifTrue:[ |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
478 |
img := img copy. |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
479 |
]. |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
480 |
img := img on:device. |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
481 |
img := img clearMaskedPixels. |
569 | 482 |
]. |
1070
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
483 |
^ img |
846 | 484 |
|
1070
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
485 |
"Modified: / 12.8.1998 / 12:46:38 / cg" |
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
486 |
! |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
487 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
488 |
imageOpened |
1278 | 489 |
"return the value of the instance variable 'imageOpened'. |
490 |
Thats the (default) bitmap image shown for opened folders |
|
491 |
(initialized to an open file-directory bitmap)" |
|
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
492 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
493 |
^ imageOpened |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
494 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
495 |
"Created: 3.7.1997 / 12:34:28 / cg" |
471 | 496 |
! ! |
497 |
||
1275 | 498 |
!SelectionInTreeView methodsFor:'accessing-look'! |
499 |
||
500 |
showDirectoryIndicator |
|
501 |
"returns true if directories has an open/closed indicator |
|
502 |
" |
|
503 |
^ showDirectoryIndicator |
|
504 |
! |
|
505 |
||
506 |
showDirectoryIndicator:aState |
|
507 |
"set or clear open/closed indicator for directories |
|
508 |
" |
|
509 |
"show or hide lines |
|
510 |
" |
|
511 |
aState ~~ showDirectoryIndicator ifTrue:[ |
|
512 |
showDirectoryIndicator := aState. |
|
513 |
self recomputeDirectoryIndicator. |
|
514 |
self invalidate |
|
515 |
]. |
|
516 |
! |
|
517 |
||
518 |
showDirectoryIndicatorForRoot |
|
519 |
"returns true if root directory has an open/closed indicator if |
|
520 |
the common showDirectoryIndicator is enabled |
|
521 |
" |
|
522 |
^ showDirectoryIndicatorForRoot |
|
523 |
! |
|
524 |
||
525 |
showDirectoryIndicatorForRoot:aState |
|
526 |
"true if root directory has an open/closed indicator if |
|
527 |
the common showDirectoryIndicator is enabled |
|
528 |
" |
|
529 |
aState ~~ showDirectoryIndicatorForRoot ifTrue:[ |
|
530 |
showDirectoryIndicatorForRoot := aState. |
|
531 |
self recomputeDirectoryIndicator. |
|
532 |
self invalidate |
|
533 |
]. |
|
534 |
! |
|
535 |
||
536 |
showLines |
|
537 |
"returns true if lines are shown |
|
538 |
" |
|
539 |
^ showLines |
|
540 |
! |
|
541 |
||
542 |
showLines:aState |
|
543 |
"show or hide lines |
|
544 |
" |
|
545 |
aState ~~ showLines ifTrue:[ |
|
546 |
showLines := aState. |
|
547 |
self invalidate |
|
548 |
]. |
|
549 |
! |
|
550 |
||
551 |
showRoot |
|
552 |
"list with or without root |
|
553 |
" |
|
554 |
^ showRoot |
|
555 |
! |
|
556 |
||
557 |
showRoot:aState |
|
558 |
"list with or without root |
|
559 |
" |
|
560 |
showRoot ~~ aState ifTrue:[ |
|
561 |
model showRoot:(showRoot := aState). |
|
562 |
]. |
|
563 |
! ! |
|
564 |
||
514 | 565 |
!SelectionInTreeView methodsFor:'change & update'! |
566 |
||
855 | 567 |
modelChanged:what with:aPara |
568 |
"hierarchical list changed |
|
569 |
" |
|
570 |
|start size visLn h y0 y1 cY parent pvLv ndLv| |
|
571 |
||
572 |
aPara isNil ifTrue:[ |
|
573 |
what == #list ifTrue:[ self getListFromModel ] |
|
574 |
ifFalse:[ super update:what with:aPara from:model ]. |
|
575 |
^ self |
|
576 |
]. |
|
577 |
||
578 |
(what == #insertCollection: or:[what == #removeFrom:]) ifFalse:[ |
|
579 |
what == #at: ifTrue:[ ^ self redrawLine:aPara ]. |
|
580 |
what == #replace ifTrue:[ ^ self invalidateRepairNow:true ]. |
|
581 |
||
582 |
^ super update:what with:aPara from:model. |
|
583 |
]. |
|
584 |
list := self listFromModel. |
|
585 |
||
586 |
shown ifFalse:[ |
|
587 |
^ self contentsChanged |
|
588 |
]. |
|
589 |
(self sensor notNil and: [self sensor hasExposeEventFor:self]) ifTrue:[ "/ outstanding expose events |
|
590 |
self invalidateRepairNow:true. |
|
591 |
^ self contentsChanged |
|
592 |
]. |
|
593 |
||
594 |
start := aPara at:1. |
|
595 |
size := aPara at:2. |
|
596 |
parent := aPara at:3. |
|
597 |
||
860 | 598 |
what == #removeFrom: ifTrue:[ |
599 |
size := size - start + 1 |
|
600 |
]. |
|
601 |
||
855 | 602 |
start > 1 ifTrue:[ |
603 |
pvLv := (list at:start - 1) level. |
|
604 |
ndLv := parent level + 1. |
|
605 |
||
606 |
ndLv < pvLv ifTrue:[ |
|
607 |
what == #insertCollection: ifTrue:[ |
|
608 |
visLn := start + size. |
|
609 |
] ifFalse:[ |
|
610 |
visLn := start. |
|
611 |
]. |
|
612 |
||
613 |
(visLn > list size or:[(list at:visLn) level ~~ ndLv]) ifTrue:[ |
|
614 |
[(start := start - 1) ~~ 1] whileTrue:[ |
|
615 |
(list at:start) level <= ndLv ifTrue:[ |
|
616 |
self redrawFromLine:start. |
|
617 |
^ self contentsChanged. |
|
618 |
] |
|
619 |
]. |
|
620 |
self invalidateRepairNow:true. |
|
621 |
^ self contentsChanged |
|
622 |
] |
|
623 |
]. |
|
624 |
self redrawIconAndIndicatorAt:(start - 1) |
|
625 |
]. |
|
626 |
(visLn := self listLineToVisibleLine:start) isNil ifTrue:[ |
|
627 |
^ self contentsChanged |
|
628 |
]. |
|
629 |
||
630 |
h := size * fontHeight. |
|
631 |
y0 := self yOfVisibleLine:visLn. |
|
632 |
y1 := y0 + h. |
|
633 |
cY := height - y1 - 1. |
|
634 |
||
635 |
cY < 40 ifTrue:[ |
|
636 |
self redrawFromLine:start. |
|
637 |
] ifFalse:[ |
|
638 |
self catchExpose. |
|
639 |
||
640 |
what == #insertCollection: ifTrue:[ |
|
641 |
self copyFrom:self x:0 y:y0 toX:0 y:y1 width:width height:cY async:true. |
|
642 |
] ifFalse:[ |
|
643 |
self copyFrom:self x:0 y:y1 toX:0 y:y0 width:width height:cY async:true. |
|
644 |
y0 := y0 + cY. |
|
645 |
h := height - y0. |
|
646 |
]. |
|
647 |
self redrawX:0 y:y0 width:width height:h. |
|
648 |
self waitForExpose. |
|
649 |
]. |
|
650 |
device flush. |
|
651 |
self contentsChanged. |
|
652 |
! |
|
653 |
||
514 | 654 |
update:something with:aParameter from:aModel |
655 |
"one of my models changed its value |
|
785 | 656 |
" |
657 |
|idx| |
|
658 |
||
514 | 659 |
aModel == rootHolder ifTrue:[ |
660 |
^ self rootFromModel |
|
661 |
]. |
|
855 | 662 |
|
514 | 663 |
aModel == selectionHolder ifTrue:[ |
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
664 |
^ self selectionFromModel |
514 | 665 |
]. |
666 |
||
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
667 |
aModel == model ifTrue:[ |
855 | 668 |
^ self modelChanged:something with:aParameter |
669 |
]. |
|
670 |
||
671 |
(aModel isKindOf:TreeItem) ifTrue:[ |
|
672 |
(something == #size or:[something == #children]) ifTrue:[ |
|
673 |
model recomputeList. |
|
674 |
^ self |
|
675 |
]. |
|
676 |
||
677 |
(idx := self indexOfNode:aModel) ~~ 0 ifTrue:[ |
|
678 |
something == #value ifTrue:[ |
|
679 |
^ self redrawLine:idx. |
|
785 | 680 |
]. |
811 | 681 |
|
855 | 682 |
something == #indication ifTrue:[ |
683 |
^ self redrawIndicatorLine:idx. |
|
811 | 684 |
]. |
1308 | 685 |
"/ assume that the nodes string has changed |
686 |
^ self redrawLine:idx. |
|
855 | 687 |
]. |
688 |
^ self |
|
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
689 |
]. |
855 | 690 |
super update:something with:aParameter from:aModel. |
811 | 691 |
|
514 | 692 |
! ! |
693 |
||
444 | 694 |
!SelectionInTreeView methodsFor:'drawing'! |
695 |
||
481 | 696 |
drawLine:line atX:atX inVisible:visLineNr with:fg and:bg |
697 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fg and:bg |
|
444 | 698 |
|
699 |
! |
|
700 |
||
701 |
drawLine:line fromX:x inVisible:visLineNr with:fg and:bg |
|
481 | 702 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fg and:bg |
444 | 703 |
|
704 |
! |
|
705 |
||
706 |
drawLine:line inVisible:visLineNr with:fg and:bg |
|
481 | 707 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fg and:bg |
444 | 708 |
|
709 |
! |
|
710 |
||
711 |
drawVisibleLine:visLineNr col:col with:fg and:bg |
|
481 | 712 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fg and:bg |
444 | 713 |
|
714 |
! |
|
715 |
||
716 |
drawVisibleLine:visLineNr from:startCol to:endCol with:fg and:bg |
|
481 | 717 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fg and:bg |
718 |
||
444 | 719 |
! |
720 |
||
721 |
drawVisibleLine:visLineNr from:startCol with:fg and:bg |
|
481 | 722 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fg and:bg |
444 | 723 |
|
846 | 724 |
! |
725 |
||
726 |
redrawFromVisibleLine:startVisLineNr to:endVisLineNr |
|
727 |
self redrawX:0 |
|
728 |
y:(self yOfVisibleLine:startVisLineNr) |
|
729 |
width:width |
|
730 |
height:(endVisLineNr - startVisLineNr + 1 * fontHeight) |
|
731 |
||
732 |
||
848 | 733 |
! |
444 | 734 |
|
848 | 735 |
redrawIconAndIndicatorAt:aLnNr |
736 |
|visLineNr x0 x1 lv| |
|
481 | 737 |
|
769 | 738 |
shown ifTrue:[ |
848 | 739 |
visLineNr := self listLineToVisibleLine:aLnNr. |
740 |
visLineNr notNil ifTrue:[ |
|
741 |
lv := (listOfNodes at:aLnNr) level. |
|
742 |
x1 := (imageWidth + (self xOfFigureLevel:lv)) min:width. |
|
743 |
x0 := (self xOfFigureLevel:(lv - 1)) max:0. |
|
769 | 744 |
|
848 | 745 |
(x0 > width or:[x1 < 0]) ifFalse:[ |
746 |
self redrawX:x0 |
|
747 |
y:(self yOfVisibleLine:visLineNr) |
|
748 |
width:(x1 - x0) |
|
749 |
height:fontHeight |
|
750 |
] |
|
769 | 751 |
] |
848 | 752 |
]. |
769 | 753 |
! |
754 |
||
811 | 755 |
redrawIndicatorLine:aLineNr |
756 |
"redraw the directory indicator for a line |
|
757 |
" |
|
758 |
|node ext img visLn |
|
759 |
x "{ Class:SmallInteger }" |
|
760 |
y "{ Class:SmallInteger }" |
|
761 |
dX "{ Class:SmallInteger }" |
|
762 |
| |
|
763 |
||
764 |
( shown |
|
765 |
and:[showDirectoryIndicator |
|
766 |
and:[(visLn := self listLineToVisibleLine:aLineNr) notNil]] |
|
767 |
) ifFalse:[ |
|
768 |
^ self |
|
769 |
]. |
|
770 |
||
771 |
node := listOfNodes at:aLineNr. |
|
772 |
||
846 | 773 |
(node parent notNil or:[showDirectoryIndicatorForRoot]) ifFalse:[ |
811 | 774 |
^ self |
775 |
]. |
|
776 |
||
846 | 777 |
x := imageWidth // 2. |
778 |
x := x + (self xOfFigureLevel:(node level - 1)). |
|
811 | 779 |
|
780 |
"/ draw directory indicator |
|
781 |
||
782 |
img := node isCollapsable ifTrue:[openIndicator] ifFalse:[closeIndicator]. |
|
783 |
ext := img extent // 2. |
|
784 |
dX := ext x. |
|
785 |
||
786 |
(x + dX > 0 and:[(x := x - dX) < (width - margin)]) ifTrue:[ |
|
787 |
(self isInSelection:aLineNr) ifTrue:[ self paint:hilightFgColor on:hilightBgColor ] |
|
788 |
ifFalse:[ self paint:fgColor on:bgColor ]. |
|
789 |
||
790 |
y := (self yOfVisibleLine:visLn) + (fontHeight // 2) - 1. |
|
791 |
self displayForm:img x:x y:(y - ext y) |
|
792 |
]. |
|
793 |
||
794 |
||
795 |
||
900 | 796 |
! |
797 |
||
798 |
redrawVisibleLine:visLineNr |
|
799 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fgColor and:bgColor |
|
800 |
! |
|
801 |
||
802 |
redrawVisibleLine:visLineNr from:startCol to:endCol |
|
803 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fgColor and:bgColor |
|
848 | 804 |
! ! |
805 |
||
806 |
!SelectionInTreeView methodsFor:'drawing basics'! |
|
807 |
||
900 | 808 |
drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg |
809 |
"redraw a visible line range with clearing the background |
|
848 | 810 |
" |
900 | 811 |
|y h| |
848 | 812 |
|
900 | 813 |
y := self yOfVisibleLine:startVisLineNr. |
814 |
h := endVisLineNr - startVisLineNr + 1 * fontHeight. |
|
815 |
||
816 |
y + h > height ifTrue:[ |
|
817 |
h := height - y |
|
818 |
]. |
|
819 |
self redrawX:0 y:y width:width height:h. |
|
848 | 820 |
! |
821 |
||
822 |
drawVHLinesX:x0 y:y0 toX:x1 start:start stop:stop |
|
823 |
"redraw from line to line without clearing the background |
|
824 |
" |
|
825 |
|node prevNode parent p1 p2 showVLines showHLine lv nxtPrnt |
|
1305
c8f2fe1fac85
fix drawing horizontal lines for the root element(s)
Claus Gittinger <cg@exept.de>
parents:
1278
diff
changeset
|
826 |
showRootNot isFirst |
848 | 827 |
|
828 |
x "{ Class:SmallInteger }" |
|
829 |
y "{ Class:SmallInteger }" |
|
830 |
||
831 |
yTop "{ Class:SmallInteger }" |
|
832 |
yBot "{ Class:SmallInteger }" |
|
833 |
yCtr "{ Class:SmallInteger }" |
|
834 |
||
835 |
begHLnY "{ Class:SmallInteger }" |
|
836 |
begHLnX "{ Class:SmallInteger }" |
|
837 |
endHLnX "{ Class:SmallInteger }" |
|
838 |
||
839 |
widthLvl "{ Class:SmallInteger }" |
|
840 |
offsHLnX "{ Class:SmallInteger }" |
|
841 |
||
842 |
level "{ Class:SmallInteger }" |
|
855 | 843 |
startLvI "{ Class:SmallInteger }" |
844 |
startLvX "{ Class:SmallInteger }" |
|
845 |
limitLvI "{ Class:SmallInteger }" |
|
846 |
limitLvX "{ Class:SmallInteger }" |
|
848 | 847 |
| |
1305
c8f2fe1fac85
fix drawing horizontal lines for the root element(s)
Claus Gittinger <cg@exept.de>
parents:
1278
diff
changeset
|
848 |
|
848 | 849 |
yBot := y0. |
850 |
yCtr := yBot - (fontHeight // 2). |
|
851 |
widthLvl := imageInset + imageWidth. |
|
852 |
offsHLnX := imageWidth // 2 + (self xOfFigureLevel:-1). |
|
853 |
||
854 |
parent := 4711. "/ to force a recompute |
|
855 |
prevNode := 4711. "/ to force a recomputation of the level |
|
856 |
||
857 |
self setMaskOrigin:(self viewOrigin + (0 @ 1) \\ (lineMask extent)). |
|
858 |
self paint:lineColor on:bgColor. |
|
859 |
self mask:lineMask. |
|
860 |
begHLnY := y0. |
|
855 | 861 |
startLvI := self smallestLevelOfNodesBetween:start and:stop. |
862 |
startLvX := self xOfFigureLevel:startLvI. |
|
863 |
limitLvI := drawVLinesFromLevel + 1. |
|
864 |
limitLvX := limitLvI * widthLvl + offsHLnX. |
|
848 | 865 |
|
866 |
buildInArray atAllPut:0. |
|
867 |
||
868 |
start == 1 ifTrue:[ |
|
869 |
begHLnY := yCtr + fontHeight. |
|
870 |
]. |
|
1305
c8f2fe1fac85
fix drawing horizontal lines for the root element(s)
Claus Gittinger <cg@exept.de>
parents:
1278
diff
changeset
|
871 |
showRootNot := showRoot not. |
848 | 872 |
|
873 |
start to:stop do:[:anIndex| |
|
874 |
node := listOfNodes at:anIndex. |
|
875 |
yTop := yBot - 1. |
|
876 |
yBot := yBot + fontHeight. |
|
877 |
yCtr := yCtr + fontHeight. |
|
878 |
||
879 |
(nxtPrnt := node parent) ~~ parent ifTrue:[ |
|
880 |
parent := nxtPrnt. |
|
881 |
||
882 |
prevNode == parent ifTrue:[ |
|
883 |
level := level + 1. |
|
884 |
begHLnX := endHLnX. |
|
885 |
] ifFalse:[ |
|
886 |
level := node level. |
|
1309 | 887 |
begHLnX := level * widthLvl + offsHLnX. |
848 | 888 |
]. |
889 |
||
1305
c8f2fe1fac85
fix drawing horizontal lines for the root element(s)
Claus Gittinger <cg@exept.de>
parents:
1278
diff
changeset
|
890 |
isFirst := parent isNil or:[(showRootNot and:[level == 2])]. |
c8f2fe1fac85
fix drawing horizontal lines for the root element(s)
Claus Gittinger <cg@exept.de>
parents:
1278
diff
changeset
|
891 |
endHLnX := begHLnX + widthLvl. |
855 | 892 |
showVLines := begHLnX >= x0 and:[level > drawVLinesFromLevel]. |
1305
c8f2fe1fac85
fix drawing horizontal lines for the root element(s)
Claus Gittinger <cg@exept.de>
parents:
1278
diff
changeset
|
893 |
showHLine := x0 < endHLnX and:[x1 > begHLnX]. |
c8f2fe1fac85
fix drawing horizontal lines for the root element(s)
Claus Gittinger <cg@exept.de>
parents:
1278
diff
changeset
|
894 |
|
c8f2fe1fac85
fix drawing horizontal lines for the root element(s)
Claus Gittinger <cg@exept.de>
parents:
1278
diff
changeset
|
895 |
(showHLine and:[isFirst]) ifTrue:[ |
c8f2fe1fac85
fix drawing horizontal lines for the root element(s)
Claus Gittinger <cg@exept.de>
parents:
1278
diff
changeset
|
896 |
showHLine := showDirectoryIndicatorForRoot and:[showDirectoryIndicator] |
c8f2fe1fac85
fix drawing horizontal lines for the root element(s)
Claus Gittinger <cg@exept.de>
parents:
1278
diff
changeset
|
897 |
] |
848 | 898 |
]. |
899 |
||
900 |
showHLine ifTrue:[ |
|
901 |
self displayLineFromX:begHLnX y:yCtr toX:endHLnX y:yCtr |
|
902 |
]. |
|
903 |
||
904 |
showVLines ifTrue:[ |
|
905 |
y := (parent basicLastChild == node) ifTrue:[yCtr] ifFalse:[yBot]. |
|
906 |
x := begHLnX. |
|
907 |
p2 := parent. |
|
908 |
lv := level - 1. |
|
909 |
self displayLineFromX:x y:begHLnY toX:x y:y. |
|
910 |
||
855 | 911 |
[((p1 := p2 parent) notNil and:[(x := x - widthLvl) >= limitLvX])] whileTrue:[ |
848 | 912 |
(p1 basicLastChild ~~ p2 and:[x <= x1]) ifTrue:[ |
855 | 913 |
x >= startLvX ifTrue:[ |
848 | 914 |
self displayLineFromX:x y:yTop toX:x y:yBot |
915 |
] ifFalse:[ |
|
916 |
buildInArray at:lv put:yBot |
|
917 |
]. |
|
918 |
]. |
|
919 |
lv := lv - 1. |
|
920 |
p2 := p1 |
|
921 |
] |
|
922 |
]. |
|
923 |
prevNode := node. |
|
924 |
begHLnY := yCtr. |
|
925 |
]. |
|
926 |
||
855 | 927 |
"/ |
928 |
"/ draw outstanding verical lines to left |
|
929 |
"/ |
|
930 |
x := limitLvX. |
|
931 |
y := (start ~~ 1) ifTrue:[y0] ifFalse:[y0 + (fontHeight // 2)]. |
|
848 | 932 |
|
855 | 933 |
limitLvI to:startLvI do:[:i| |
934 |
(yBot := buildInArray at:i) ~~ 0 ifTrue:[ |
|
935 |
self displayLineFromX:x y:y toX:x y:yBot |
|
936 |
]. |
|
937 |
x := x + widthLvl. |
|
848 | 938 |
]. |
939 |
self mask:nil. |
|
940 |
||
811 | 941 |
! |
942 |
||
900 | 943 |
drawVisibleLineSelected:visLineNr with:fg and:bg |
944 |
"redraw a single line as selected." |
|
945 |
||
946 |
(self visibleLineToListLine:visLineNr) isNil ifTrue:[ |
|
947 |
^ super drawVisibleLine:visLineNr with:fg and:bg |
|
948 |
]. |
|
949 |
self redrawX:0 |
|
950 |
y:(self yOfVisibleLine:visLineNr) |
|
951 |
width:width |
|
952 |
height:fontHeight |
|
953 |
! |
|
954 |
||
902 | 955 |
redrawElement:anIndex |
956 |
||
957 |
|vln x0 xT y| |
|
958 |
||
959 |
shown ifTrue:[ |
|
960 |
( highlightMode ~~ #label |
|
908 | 961 |
or:[(vln := self listLineToVisibleLine:anIndex) isNil |
962 |
or:[anIndex > listOfNodes size]] |
|
902 | 963 |
) ifTrue:[ |
964 |
super redrawElement:anIndex |
|
965 |
] ifFalse:[ |
|
966 |
y := self yOfVisibleLine:vln. |
|
967 |
xT := self xOfStringLevel:((listOfNodes at:anIndex) level). |
|
968 |
x0 := xT - textInset. |
|
969 |
self paint:bgColor. |
|
970 |
self fillRectangleX:x0 y:y width:(width - x0) height:fontHeight. |
|
971 |
self redrawLabelAt:xT y:y index:anIndex |
|
972 |
] |
|
973 |
] |
|
974 |
||
975 |
! |
|
976 |
||
900 | 977 |
redrawLabelAt:x y:yTop index:anIndex |
1171 | 978 |
|isSel y0 x0 w label node value xV wV| |
979 |
||
980 |
node := listOfNodes at:anIndex. |
|
981 |
label := node name. |
|
982 |
isSel := self isInSelection:anIndex. |
|
983 |
xV := 0. |
|
984 |
wV := 0. |
|
985 |
y0 := yTop + (fontHeight // 2) + labelOffsetY. |
|
986 |
||
987 |
(value := node printableEditValue) notNil ifTrue:[ |
|
988 |
xV := (self xOfValueNode:node) - SelectionInset |
|
989 |
]. |
|
900 | 990 |
|
991 |
highlightMode == #label ifTrue:[ |
|
992 |
x0 := x + 4. |
|
993 |
||
1171 | 994 |
isSel ifTrue:[ |
900 | 995 |
w := (label notNil ifTrue:[label widthOn:self] ifFalse:[60]) + 8. |
996 |
self paint:hilightBgColor. |
|
997 |
self fillRectangleX:x y:yTop width:w height:fontHeight. |
|
1171 | 998 |
|
999 |
(value notNil and:[(editorWidget isNil or:[editorIndex ~~ anIndex])]) ifTrue:[ |
|
1000 |
wV := SelectionInset + SelectionInset + (value widthOn:self). |
|
1001 |
self fillRectangleX:xV y:yTop width:wV height:fontHeight. |
|
1002 |
] |
|
900 | 1003 |
] |
1004 |
] ifFalse:[ |
|
1005 |
x0 := x |
|
1006 |
]. |
|
1007 |
||
1008 |
label notNil ifTrue:[ |
|
1171 | 1009 |
isSel ifTrue:[self paint:hilightFgColor on:hilightBgColor] |
1010 |
ifFalse:[self paint:fgColor on:bgColor]. |
|
1011 |
||
1012 |
self displayOpaqueString:label x:x0 y:y0. |
|
1013 |
||
1014 |
value notNil ifTrue:[ |
|
1175 | 1015 |
isSel ifFalse:[ |
1016 |
self paint:editValueFgColor on:bgColor |
|
1017 |
]. |
|
1171 | 1018 |
self displayOpaqueString:value x:(xV + SelectionInset) y:y0 |
1019 |
]. |
|
1020 |
||
900 | 1021 |
]. |
1022 |
||
1171 | 1023 |
(isSel and:[highlightMode == #label]) ifTrue:[ |
1024 |
self redrawSelFrameAtX:x y:yTop toX:(x + w). |
|
1025 |
||
1026 |
wV ~~ 0 ifTrue:[ |
|
1027 |
self redrawSelFrameAtX:xV y:yTop toX:(xV + wV) |
|
1028 |
] |
|
900 | 1029 |
]. |
1030 |
||
1171 | 1031 |
|
900 | 1032 |
! |
1033 |
||
769 | 1034 |
redrawLinesX:x0 y:y0 toX:x1 start:start stop:stop |
1035 |
"redraw from line to line without clearing the background |
|
1036 |
" |
|
848 | 1037 |
|node prevNode parent icon showIndc showIcon showText nxtPrnt |
846 | 1038 |
|
1039 |
end "{ Class:SmallInteger }" |
|
1040 |
||
1041 |
yBot "{ Class:SmallInteger }" |
|
1042 |
yCtr "{ Class:SmallInteger }" |
|
1043 |
||
848 | 1044 |
xIndc "{ Class:SmallInteger }" |
846 | 1045 |
xIcon "{ Class:SmallInteger }" |
1046 |
xText "{ Class:SmallInteger }" |
|
1047 |
||
1048 |
widthLvl "{ Class:SmallInteger }" |
|
1049 |
insetTxt "{ Class:SmallInteger }" |
|
848 | 1050 |
|
1051 |
offIndcX "{ Class:SmallInteger }" |
|
1052 |
offIndcY "{ Class:SmallInteger }" |
|
1053 |
offIconX "{ Class:SmallInteger }" |
|
769 | 1054 |
| |
848 | 1055 |
(end := stop min:(listOfNodes size)) < start ifTrue:[ |
1056 |
^ self |
|
1057 |
]. |
|
846 | 1058 |
yBot := y0. |
1059 |
yCtr := yBot - (fontHeight // 2). |
|
1060 |
widthLvl := imageInset + imageWidth. |
|
1061 |
insetTxt := imageWidth + textInset. |
|
848 | 1062 |
offIconX := self xOfFigureLevel:0. |
1063 |
showIndc := false. |
|
846 | 1064 |
|
1065 |
showDirectoryIndicator ifTrue:[ |
|
1072
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1066 |
offIndcX := imageWidth // 2 - widthLvl. |
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1067 |
offIndcY := 0. |
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1068 |
openIndicator notNil ifTrue:[ |
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1069 |
icon := openIndicator extent // 2. |
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1070 |
offIndcX := offIndcX - icon x. |
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1071 |
offIndcY := icon y. |
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1072 |
] |
846 | 1073 |
]. |
785 | 1074 |
|
1075 |
showLines ifTrue:[ |
|
848 | 1076 |
self drawVHLinesX:x0 y:y0 toX:x1 start:start stop:end |
785 | 1077 |
]. |
485 | 1078 |
|
846 | 1079 |
parent := 4711. "/ to force a recompute |
1080 |
prevNode := 4711. "/ to force a recomputation of the level |
|
1081 |
||
1082 |
start to:end do:[:anIndex| |
|
1083 |
node := listOfNodes at:anIndex. |
|
1084 |
yBot := yBot + fontHeight. |
|
494 | 1085 |
yCtr := yCtr + fontHeight. |
485 | 1086 |
|
848 | 1087 |
(nxtPrnt := node parent) ~~ parent ifTrue:[ |
1088 |
parent := nxtPrnt. |
|
1089 |
xIcon := prevNode == parent ifTrue:[xIcon + widthLvl] |
|
1090 |
ifFalse:[node level * widthLvl + offIconX]. |
|
481 | 1091 |
|
848 | 1092 |
xText := xIcon + insetTxt. |
1093 |
showIcon := xIcon < x1 and:[xText > x0]. |
|
1094 |
showText := xText < x1. |
|
769 | 1095 |
|
848 | 1096 |
showDirectoryIndicator ifTrue:[ |
1097 |
xIndc := xIcon + offIndcX. |
|
481 | 1098 |
|
848 | 1099 |
showIndc := ( (parent notNil or:[showDirectoryIndicatorForRoot]) |
1100 |
and:[(xIcon > x0 and:[xIndc < x1])] |
|
1101 |
) |
|
1102 |
] |
|
785 | 1103 |
]. |
481 | 1104 |
|
846 | 1105 |
(showIcon and:[(icon := self figureFor:node) notNil]) ifTrue:[ |
1106 |
self displayForm:icon x:xIcon y:(yCtr - (icon height // 2)) |
|
770 | 1107 |
]. |
848 | 1108 |
|
846 | 1109 |
showText ifTrue:[ |
900 | 1110 |
self redrawLabelAt:xText y:(yBot - fontHeight) index:anIndex |
485 | 1111 |
]. |
848 | 1112 |
(showIndc and:[node showIndicator]) ifTrue:[ |
846 | 1113 |
icon := node isCollapsable ifTrue:[openIndicator] ifFalse:[closeIndicator]. |
1091
2e86163cfb17
care for non-existing icon image
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
1114 |
icon notNil ifTrue:[ |
2e86163cfb17
care for non-existing icon image
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
1115 |
self displayForm:icon x:xIndc y:(yCtr - offIndcY) |
2e86163cfb17
care for non-existing icon image
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
1116 |
] |
846 | 1117 |
]. |
1118 |
prevNode := node. |
|
769 | 1119 |
] |
1072
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1120 |
|
1091
2e86163cfb17
care for non-existing icon image
Claus Gittinger <cg@exept.de>
parents:
1072
diff
changeset
|
1121 |
"Modified: / 22.8.1998 / 12:56:50 / cg" |
792 | 1122 |
! |
1123 |
||
900 | 1124 |
redrawSelFrameAtX:x0 y:y0 toX:x1 |
1125 |
"redraw selection frame for a line |
|
792 | 1126 |
" |
900 | 1127 |
| |
792 | 1128 |
w "{ Class: SmallInteger }" |
1129 |
y "{ Class: SmallInteger }" |
|
1130 |
x "{ Class: SmallInteger }" |
|
1131 |
| |
|
1132 |
||
1133 |
hilightFrameColor notNil ifTrue:[ |
|
1134 |
hilightLevel == 0 ifTrue:[ |
|
1135 |
self paint:hilightFrameColor. |
|
1105
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1136 |
highlightMode == #line ifTrue:[ |
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1137 |
self displayLineFromX:x0 y:y0 toX:x1 y:y0. |
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1138 |
y := y0 + fontHeight - 1. |
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1139 |
^self displayLineFromX:x0 y:y toX:x1 y:y. |
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1140 |
] ifFalse:[ |
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1141 |
^self displayRectangleX:x0 y:y0 width:x1 - x0 height:fontHeight |
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1142 |
] |
792 | 1143 |
] |
1144 |
] ifFalse:[ |
|
1145 |
hilightStyle == #motif ifTrue:[ |
|
1146 |
self paint:bgColor. |
|
900 | 1147 |
y := y0 + 1. |
1105
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1148 |
highlightMode == #line ifTrue:[ |
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1149 |
self displayLineFromX:x0 y:y toX:x1 y:y. |
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1150 |
y := y0 + fontHeight - 2. |
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1151 |
self displayLineFromX:x0 y:y toX:x1 y:y. |
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1152 |
] ifFalse:[ |
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1153 |
self displayRectangleX:x0 + 1 y:y width:x1 - x0 - 2 height:fontHeight - 2 |
c79bb5824b74
draw closed frames around selections if highlightMode ~~ #line
tz
parents:
1091
diff
changeset
|
1154 |
] |
792 | 1155 |
] |
1156 |
]. |
|
1157 |
||
1158 |
hilightLevel ~~ 0 ifTrue:[ |
|
1159 |
"/ draw edge |
|
1160 |
||
900 | 1161 |
highlightMode == #line ifTrue:[ |
1162 |
w := ((width - (2 * margin)) max:(self widthOfContents)) + leftOffset. |
|
1163 |
x := margin - leftOffset. |
|
1164 |
] ifFalse:[ |
|
1165 |
w := x1 - x0. |
|
1166 |
x := x0. |
|
1167 |
]. |
|
1168 |
self drawEdgesForX:x y:y0 width:w height:fontHeight level:hilightLevel. |
|
792 | 1169 |
] |
1170 |
||
1171 |
||
1172 |
||
900 | 1173 |
! |
1174 |
||
1175 |
redrawX:x y:y width:w height:h |
|
1176 |
"a region must be redrawn" |
|
1177 |
||
1178 |
|savClip startLn sel |
|
1179 |
y0 "{ Class:SmallInteger }" |
|
1180 |
y1 "{ Class:SmallInteger }" |
|
1181 |
visStart "{ Class:SmallInteger }" |
|
1182 |
visEnd "{ Class:SmallInteger }" |
|
1183 |
stopLn "{ Class:SmallInteger }" |
|
1184 |
maxY "{ Class:SmallInteger }" |
|
1185 |
maxX "{ Class:SmallInteger }" |
|
1186 |
dltLine "{ Class:SmallInteger }" |
|
1187 |
startY "{ Class:SmallInteger }"| |
|
1188 |
||
1189 |
shown ifFalse:[^ self]. |
|
1190 |
||
1191 |
visStart := self visibleLineOfY:(y + 1). |
|
1192 |
startLn := self visibleLineToAbsoluteLine:visStart. |
|
1193 |
||
1194 |
self paint:bgColor. |
|
1195 |
self fillRectangleX:x y:y width:w height:h. |
|
1196 |
startLn isNil ifTrue:[ ^ self ]. |
|
1197 |
||
1198 |
sel := nil. |
|
1199 |
maxX := x + w. |
|
1200 |
maxY := y + h. |
|
1201 |
visEnd := self visibleLineOfY:maxY. |
|
1202 |
startY := self yOfVisibleLine:visStart. |
|
1203 |
dltLine := startLn - visStart. |
|
1204 |
stopLn := dltLine + visEnd. |
|
1205 |
savClip := clipRect. |
|
1206 |
||
1207 |
self clippingRectangle:(Rectangle left:x top:y width:w height:h). |
|
1208 |
||
1209 |
(highlightMode == #line and:[self hasSelection]) ifTrue:[ |
|
1210 |
"/ redraw the background for all selected lines in the invalid range |
|
1211 |
||
1212 |
self selectionDo:[:lnNr| |
|
1213 |
(lnNr between:startLn and:stopLn) ifTrue:[ |
|
1214 |
sel isNil ifTrue:[ |
|
1215 |
sel := OrderedCollection new. |
|
1216 |
self paint:hilightBgColor. |
|
1217 |
]. |
|
1218 |
sel add:(y0 := self yOfVisibleLine:(lnNr - dltLine)). |
|
1219 |
y1 := y0 + fontHeight min:maxY. |
|
1220 |
y0 := y0 max:y. |
|
1221 |
self fillRectangleX:x y:y0 width:w height:y1 - y0. |
|
1222 |
] |
|
1223 |
] |
|
1224 |
]. |
|
1225 |
self redrawLinesX:x y:startY toX:maxX start:startLn stop:stopLn. |
|
1226 |
||
1227 |
"/ draw selection frames |
|
1228 |
sel notNil ifTrue:[ |
|
1229 |
sel do:[:y0| self redrawSelFrameAtX:x y:y0 toX:maxX] |
|
1230 |
]. |
|
1231 |
||
1232 |
self clippingRectangle:savClip. |
|
444 | 1233 |
! ! |
1234 |
||
494 | 1235 |
!SelectionInTreeView methodsFor:'enumerating'! |
490 | 1236 |
|
494 | 1237 |
detectNode:aOneArgBlock |
1238 |
"evaluate the argument, aBlock for each node in the list until |
|
1239 |
the block returns true; in this case return the node which caused |
|
1240 |
the true evaluation. If none node is detected, nil is returned. |
|
1241 |
" |
|
1242 |
^ listOfNodes detect:aOneArgBlock ifNone:nil |
|
507 | 1243 |
! |
1244 |
||
1245 |
selectedNodesDo:aOneArgBlock |
|
1246 |
"evaluate the block on each node selected |
|
1247 |
" |
|
1248 |
self selectionDo:[:i| aOneArgBlock value:(listOfNodes at:i) ] |
|
490 | 1249 |
! ! |
1250 |
||
569 | 1251 |
!SelectionInTreeView methodsFor:'event handling'! |
1252 |
||
639 | 1253 |
buttonMotion:buttonMask x:x y:y |
1254 |
"mouse-move while button was pressed - handle selection changes" |
|
1255 |
||
1256 |
discardMotionEvents ifFalse:[ |
|
1257 |
super buttonMotion:buttonMask x:x y:y |
|
1258 |
] |
|
1259 |
||
1260 |
||
1261 |
! |
|
1262 |
||
569 | 1263 |
buttonMultiPress:button x:x y:y |
1264 |
||
1265 |
(self indicatiorLineForButton:button atX:x y:y) == 0 ifTrue:[ |
|
1266 |
^ super buttonMultiPress:button x:x y:y |
|
1267 |
]. |
|
1268 |
"/ discard doubleClick on indicator |
|
1269 |
! |
|
1270 |
||
1271 |
buttonPress:button x:x y:y |
|
1171 | 1272 |
"handle button press event |
1273 |
" |
|
1268 | 1274 |
|node menu| |
1171 | 1275 |
|
1276 |
((button == 2) or:[button == #menu]) ifTrue:[ |
|
1277 |
( (node := self selectedNode) notNil |
|
1278 |
and:[(menu := node middleButtonMenu) notNil] |
|
1279 |
) ifTrue:[ |
|
1188 | 1280 |
menu isCollection ifTrue:[ |
1281 |
|appl| |
|
1282 |
||
1283 |
menu := Menu new fromLiteralArrayEncoding:menu. |
|
1284 |
||
1285 |
(appl := self application) notNil ifTrue:[ |
|
1286 |
menu findGuiResourcesIn:appl |
|
1287 |
]. |
|
1288 |
menu receiver:appl. |
|
1289 |
]. |
|
1171 | 1290 |
menu startUp |
1291 |
] ifFalse:[ |
|
1292 |
super buttonPress:button x:x y:y |
|
1293 |
] |
|
1294 |
] ifFalse:[ |
|
1295 |
self handleSelectButtonAtX:x y:y. |
|
1296 |
||
1297 |
( editorWidget isNil |
|
1298 |
and:[(node := self selectedNode) notNil |
|
1299 |
and:[node canEdit |
|
1300 |
and:[x >= (self xOfValueNode:node)]]] |
|
1301 |
) ifTrue:[ |
|
1302 |
self openEditor |
|
1303 |
] |
|
1304 |
] |
|
1305 |
! |
|
1306 |
||
1307 |
buttonRelease:button x:x y:y |
|
1308 |
"stop any autoscroll" |
|
1309 |
||
1310 |
discardMotionEvents ifTrue:[ |
|
1311 |
clickPosition := nil. |
|
1312 |
discardMotionEvents := false. |
|
1313 |
]. |
|
1314 |
super buttonRelease:button x:x y:y |
|
1315 |
||
1316 |
! |
|
1317 |
||
1318 |
doubleClicked |
|
1319 |
"handle a double click; collapse or expand selected entry |
|
1320 |
in case of having children |
|
1321 |
" |
|
1322 |
|node| |
|
1323 |
||
1324 |
(node := self selectedNode) notNil ifTrue:[ |
|
1202
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1325 |
(validateDoubleClickBlock isNil |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1326 |
or:[(validateDoubleClickBlock value:node) ~~ false]) ifTrue:[ |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1327 |
(validateExpandabilityBlock isNil |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1328 |
or:[(validateExpandabilityBlock value:node) ~~ false]) ifTrue:[ |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1329 |
self selectedNodeExpand:(node isExpandable). |
b9a3beb20ca7
added an extra validateExpandability block,
Claus Gittinger <cg@exept.de>
parents:
1191
diff
changeset
|
1330 |
]. |
1171 | 1331 |
super doubleClicked |
1332 |
] |
|
1333 |
] |
|
1334 |
||
1335 |
! |
|
1336 |
||
1337 |
handleSelectButtonAtX:x y:y |
|
1338 |
"handle a select button click |
|
569 | 1339 |
" |
1268 | 1340 |
|node lineNr sensor isExpd| |
569 | 1341 |
|
1171 | 1342 |
lineNr := self indicatiorLineForButton:#select atX:x y:y. |
569 | 1343 |
|
1344 |
lineNr == 0 ifTrue:[ |
|
1171 | 1345 |
^ super buttonPress:#select x:x y:y |
569 | 1346 |
]. |
1347 |
node := listOfNodes at:lineNr. |
|
1348 |
||
639 | 1349 |
discardMotionEvents := true. |
569 | 1350 |
dragIsActive := false. |
1351 |
clickPosition := nil. |
|
1352 |
||
639 | 1353 |
self hasSelection ifTrue:[ |
1354 |
(selectConditionBlock isNil or:[selectConditionBlock value:lineNr]) ifTrue:[ |
|
1355 |
self selection:lineNr |
|
1356 |
] ifFalse:[ |
|
1357 |
self selection:nil |
|
569 | 1358 |
] |
1359 |
]. |
|
855 | 1360 |
|
1361 |
isExpd := node isExpandable. |
|
835 | 1362 |
|
855 | 1363 |
( supportsExpandAll |
1364 |
and:[(sensor := self sensor) notNil |
|
1365 |
and:[(sensor ctrlDown or:[sensor shiftDown])]] |
|
1366 |
) ifTrue:[ |
|
1367 |
isExpd ifTrue:[model doExpandAll:node] |
|
1368 |
ifFalse:[model doCollapseAll:node] |
|
835 | 1369 |
] ifFalse:[ |
855 | 1370 |
isExpd ifTrue:[model doExpand:node] |
1371 |
ifFalse:[model doCollapse:node]. |
|
835 | 1372 |
]. |
848 | 1373 |
|
639 | 1374 |
! |
1375 |
||
569 | 1376 |
indicatiorLineForButton:aButton atX:x y:y |
1377 |
"returns linenumber assigned to indicator at x/y or 0 |
|
1378 |
" |
|
1268 | 1379 |
|nr x0 node| |
569 | 1380 |
|
1381 |
( enabled |
|
1382 |
and:[showDirectoryIndicator |
|
1383 |
and:[aButton == 1 or:[aButton == #select]]] |
|
1384 |
) ifTrue:[ |
|
835 | 1385 |
nr := self visibleLineToListLine:(self visibleLineOfY:y). |
569 | 1386 |
|
835 | 1387 |
nr notNil ifTrue:[ |
1388 |
node := listOfNodes at:nr. |
|
1389 |
node hasChildren ifTrue:[ |
|
1390 |
x0 := self xOfFigureLevel:(node level - 1). |
|
569 | 1391 |
|
835 | 1392 |
(x > x0 and:[(x0 + imageWidth) > x and:[node children notEmpty]]) ifTrue:[ |
1393 |
^ nr |
|
569 | 1394 |
] |
1395 |
] |
|
1396 |
] |
|
1397 |
]. |
|
1398 |
^ 0 |
|
756 | 1399 |
! |
1400 |
||
835 | 1401 |
isCtrlMetaAltOrShiftPressed |
1402 |
"returns true if CTRL, META, ALT or SHIFT is pressed |
|
1403 |
" |
|
1404 |
|sensor| |
|
1405 |
||
1406 |
(sensor := self sensor) notNil ifTrue:[ |
|
1407 |
^ ( sensor ctrlDown |
|
1408 |
or:[sensor altDown |
|
1409 |
or:[sensor shiftDown |
|
1410 |
or:[sensor metaDown]]] |
|
1411 |
) |
|
1412 |
]. |
|
1413 |
^ false |
|
1414 |
! |
|
1415 |
||
756 | 1416 |
key:key select:index x:x y:y |
1417 |
"select an entry by a keyboard action. This is treated like a doubleClick |
|
1418 |
on that entry. |
|
1419 |
Add on: In case that the entry is not selectable, scroll to the entry |
|
1420 |
" |
|
1421 |
(enabled and:[keyActionStyle notNil]) ifFalse:[ |
|
1422 |
^ self |
|
1423 |
]. |
|
1424 |
||
1425 |
(selectConditionBlock isNil or:[selectConditionBlock value:index]) ifTrue:[ |
|
780 | 1426 |
^ super key:key select:index x:x y:y |
756 | 1427 |
]. |
1428 |
||
1429 |
keyActionStyle == #pass ifTrue:[ |
|
1430 |
^ self |
|
1431 |
]. |
|
1432 |
||
1433 |
self gotoLine:index |
|
785 | 1434 |
! |
1435 |
||
811 | 1436 |
keyPress:key x:x y:y |
1437 |
"handle keyboard input" |
|
1438 |
||
1439 |
<resource: #keyboard ( #CursorLeft #CursorRight ) > |
|
1440 |
||
1441 |
|idx node inc end| |
|
1442 |
||
1443 |
enabled ifFalse:[ |
|
1444 |
^ self |
|
1445 |
]. |
|
1446 |
||
1447 |
(key == #CursorLeft or:[key == #CursorRight]) ifTrue:[ |
|
1448 |
(idx := self selectedIndex) == 0 ifTrue:[ ^ self ]. |
|
1449 |
||
1450 |
(key == #CursorLeft) ifTrue:[ inc := -1. end := 0 ] |
|
1451 |
ifFalse:[ inc := 1. end := 1 + listOfNodes size ]. |
|
1452 |
||
1453 |
[(idx := idx + inc) ~~ end] whileTrue:[ |
|
1454 |
node := listOfNodes at:idx. |
|
825 | 1455 |
node hasChildren ifTrue:[ |
811 | 1456 |
^ self key:key select:idx x:x y:y |
1457 |
] |
|
1458 |
]. |
|
1459 |
^ self |
|
1460 |
]. |
|
1461 |
^ super keyPress:key x:x y:y |
|
1462 |
||
1463 |
||
1464 |
||
1465 |
||
569 | 1466 |
! ! |
1467 |
||
1328 | 1468 |
!SelectionInTreeView methodsFor:'initialize / release'! |
444 | 1469 |
|
685 | 1470 |
create |
1471 |
super create. |
|
695
3e5240577e37
dont use Image>>on: -> use Image>>onDevice:
Claus Gittinger <cg@exept.de>
parents:
685
diff
changeset
|
1472 |
lineMask := lineMask onDevice:device. |
685 | 1473 |
|
846 | 1474 |
lineColor := lineColor isNil ifTrue:[fgColor] |
1475 |
ifFalse:[lineColor onDevice:device]. |
|
1175 | 1476 |
|
1477 |
editValueFgColor := editValueFgColor onDevice:device. |
|
685 | 1478 |
! |
1479 |
||
514 | 1480 |
destroy |
1481 |
"remove dependencies |
|
1482 |
" |
|
811 | 1483 |
rootHolder removeDependent:self. |
1484 |
selectionHolder removeDependent:self. |
|
1485 |
||
1486 |
model notNil ifTrue:[ |
|
1487 |
model stopRunningTasks |
|
514 | 1488 |
]. |
1489 |
super destroy. |
|
1490 |
||
1491 |
! |
|
1492 |
||
785 | 1493 |
fetchDefaultImages |
1494 |
"returns a directory with default keys and images; could be |
|
1495 |
redefined by subclass. |
|
1496 |
" |
|
1171 | 1497 |
^ itemClass notNil ifTrue:[itemClass keysAndIcons] |
1498 |
ifFalse:[nil] |
|
785 | 1499 |
! |
1500 |
||
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1501 |
fetchDeviceResources |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1502 |
"initialize heavily used device resources - to avoid rendering |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1503 |
images again and again later" |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1504 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1505 |
super fetchDeviceResources. |
478 | 1506 |
self refetchDeviceResources |
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1507 |
! |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
1508 |
|
478 | 1509 |
fetchImageResources |
1510 |
"initialize heavily used device resources - to avoid rendering |
|
1511 |
images again and again later; returns maximum extent of the images used. |
|
1512 |
Could be redefined by subclass |
|
471 | 1513 |
" |
785 | 1514 |
|img x y keysAndIcons| |
494 | 1515 |
|
1070
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1516 |
x := y := 0. |
494 | 1517 |
imageOpened isNil ifTrue:[ |
846 | 1518 |
imageOpened := self imageOnDevice:(self class imageOpened) |
494 | 1519 |
]. |
1070
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1520 |
imageOpened notNil ifTrue:[ |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1521 |
x := x max:(imageOpened width). |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1522 |
y := y max:(imageOpened height). |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1523 |
]. |
444 | 1524 |
|
494 | 1525 |
imageClosed isNil ifTrue:[ |
569 | 1526 |
imageClosed := self imageOnDevice:(self class imageClosed) |
533
d7867efb6f60
#fetchImageResources returned the max extent only on the first invocation
Stefan Vogel <sv@exept.de>
parents:
532
diff
changeset
|
1527 |
]. |
1070
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1528 |
imageClosed notNil ifTrue:[ |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1529 |
x := x max:(imageClosed width). |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1530 |
y := y max:(imageClosed height). |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1531 |
]. |
494 | 1532 |
|
1533 |
imageItem isNil ifTrue:[ |
|
569 | 1534 |
imageItem := self imageOnDevice:(self class imageItem) |
533
d7867efb6f60
#fetchImageResources returned the max extent only on the first invocation
Stefan Vogel <sv@exept.de>
parents:
532
diff
changeset
|
1535 |
]. |
1070
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1536 |
imageItem notNil ifTrue:[ |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1537 |
x := x max:(imageItem width). |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1538 |
y := y max:(imageItem height). |
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1539 |
]. |
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1540 |
|
785 | 1541 |
(keysAndIcons := self fetchDefaultImages) notNil ifTrue:[ |
1542 |
keysAndIcons keysAndValuesDo:[:aKey :anIcon| |
|
1543 |
(anIcon isImage and:[aKey notNil]) ifTrue:[ |
|
846 | 1544 |
registeredImages at:aKey put:(self imageOnDevice:anIcon) |
785 | 1545 |
] |
1546 |
] |
|
1547 |
]. |
|
1548 |
registeredImages keysAndValuesDo:[:k :img| |
|
1549 |
x := (img width) max:x. |
|
1550 |
y := (img height) max:y. |
|
1551 |
]. |
|
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1552 |
|
785 | 1553 |
(listOfNodes size > 0 and:[(img := listOfNodes first icon) isImage]) ifTrue:[ |
1554 |
x := (img width) max:x. |
|
1555 |
y := (img height) max:y. |
|
1556 |
]. |
|
1557 |
^ x @ y |
|
1070
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1558 |
|
856d037fe133
care for non-existing images.
Claus Gittinger <cg@exept.de>
parents:
1061
diff
changeset
|
1559 |
"Modified: / 12.8.1998 / 12:45:53 / cg" |
444 | 1560 |
! |
1561 |
||
480 | 1562 |
getFontParameters |
546 | 1563 |
"save old computed height derived from images |
1564 |
" |
|
1565 |
|lineHeight| |
|
1566 |
||
1567 |
lineHeight := fontHeight ? 0. |
|
480 | 1568 |
super getFontParameters. |
569 | 1569 |
labelOffsetY := fontAscent - (fontHeight - lineSpacing // 2). |
480 | 1570 |
|
546 | 1571 |
lineHeight > fontHeight ifTrue:[ |
1572 |
fontHeight := lineHeight |
|
1573 |
]. |
|
685 | 1574 |
fontHeight odd ifTrue:[ |
1575 |
fontHeight := fontHeight + 1 |
|
1576 |
] |
|
480 | 1577 |
! |
1578 |
||
900 | 1579 |
initStyle |
1580 |
"setup viewStyle specifics" |
|
1581 |
||
1582 |
super initStyle. |
|
1171 | 1583 |
highlightMode := DefaultHilightMode ? #label. |
900 | 1584 |
|
1585 |
! |
|
1586 |
||
444 | 1587 |
initialize |
471 | 1588 |
"setup instance attributes |
1589 |
" |
|
444 | 1590 |
super initialize. |
1171 | 1591 |
|
1592 |
itemClass isNil ifTrue:[ |
|
1593 |
itemClass := TreeItem |
|
1594 |
]. |
|
1595 |
||
835 | 1596 |
supportsExpandAll := true. |
569 | 1597 |
self bitGravity:#NorthWest. |
773 | 1598 |
showRoot := showDirectoryIndicatorForRoot := showLines := computeResources := true. |
1599 |
showDirectoryIndicator := discardMotionEvents := false. |
|
1275 | 1600 |
leftMargin := 2. |
1601 |
lineMask := Form width:2 height:2 fromArray:#[16rAA 16r55]. |
|
773 | 1602 |
registeredImages := IdentityDictionary new. |
855 | 1603 |
drawVLinesFromLevel := 1. |
659 | 1604 |
textInset := 4. |
494 | 1605 |
imageInset := 0. "/ set during indication enabled |
1606 |
imageWidth := 8. "/ default: will change during startup |
|
848 | 1607 |
|
1608 |
buildInArray := Array new:50. "/ used for temporary calculation |
|
1609 |
"/ suppress garbage collection |
|
1610 |
||
514 | 1611 |
self model:nil. "/ creates a default model. |
1171 | 1612 |
highlightMode := #label. |
1175 | 1613 |
editValueFgColor := Color blue. |
478 | 1614 |
! |
1615 |
||
569 | 1616 |
realize |
1617 |
super realize. |
|
1618 |
self refetchDeviceResources. |
|
1619 |
! |
|
1620 |
||
811 | 1621 |
recomputeDirectoryIndicator |
1622 |
"setup attributes used by directory indicator |
|
1623 |
" |
|
1624 |
|x w| |
|
1625 |
||
1626 |
imageInset := 0. |
|
1627 |
||
1628 |
(showDirectoryIndicator and:[computeResources not]) ifFalse:[ |
|
1629 |
^ self |
|
1630 |
]. |
|
1072
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1631 |
|
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1632 |
x := 0. |
811 | 1633 |
openIndicator isNil ifTrue:[ |
1634 |
openIndicator := self imageOnDevice:(self class openIndicator) |
|
1635 |
]. |
|
1072
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1636 |
openIndicator notNil ifTrue:[ |
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1637 |
x := openIndicator width |
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1638 |
]. |
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1639 |
|
811 | 1640 |
closeIndicator isNil ifTrue:[ |
1641 |
closeIndicator := self imageOnDevice:(self class closeIndicator) |
|
1642 |
]. |
|
1072
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1643 |
closeIndicator notNil ifTrue:[ |
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1644 |
x := x max:(closeIndicator width) |
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1645 |
]. |
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1646 |
|
811 | 1647 |
x := x // 2. |
1648 |
w := imageWidth // 2. |
|
1649 |
||
1650 |
(x := x + self class minImageInset) > w ifTrue:[ |
|
1651 |
imageInset := x - w. |
|
1652 |
]. |
|
1653 |
||
1072
1888703adc18
care for non-existing open/close indicators.
Claus Gittinger <cg@exept.de>
parents:
1070
diff
changeset
|
1654 |
"Modified: / 13.8.1998 / 12:02:04 / cg" |
811 | 1655 |
! |
1656 |
||
478 | 1657 |
refetchDeviceResources |
1658 |
"reinitialize heavily used device resources - to avoid rendering |
|
1659 |
images again and again later |
|
1660 |
" |
|
551 | 1661 |
|extent| |
478 | 1662 |
|
569 | 1663 |
(realized and:[computeResources and:[listOfNodes size ~~ 0]]) ifTrue:[ |
546 | 1664 |
computeResources := false. |
1665 |
extent := self fetchImageResources. |
|
494 | 1666 |
|
546 | 1667 |
extent y >= fontHeight ifTrue:[ |
1668 |
fontHeight := 1 + extent y. |
|
494 | 1669 |
]. |
685 | 1670 |
fontHeight odd ifTrue:[ |
1671 |
fontHeight := fontHeight + 1 |
|
1672 |
]. |
|
846 | 1673 |
"/ round and not odd: because of line drawing |
685 | 1674 |
|
846 | 1675 |
imageWidth := (extent x) // 2. |
1676 |
imageWidth odd ifTrue:[imageWidth := imageWidth + 1]. |
|
1677 |
imageWidth := imageWidth * 2. |
|
1678 |
||
546 | 1679 |
self recomputeDirectoryIndicator. |
569 | 1680 |
self computeNumberOfLinesShown. |
546 | 1681 |
] |
444 | 1682 |
! ! |
1683 |
||
483 | 1684 |
!SelectionInTreeView methodsFor:'model'! |
444 | 1685 |
|
1686 |
getListFromModel |
|
1687 |
"if I have a model, get my list from it using the listMessage. |
|
1688 |
If listMessage is nil, try aspectMessage for backward compatibilty. |
|
1689 |
" |
|
483 | 1690 |
super list:(self listFromModel) keepSelection:true |
1691 |
! |
|
444 | 1692 |
|
483 | 1693 |
listFromModel |
1694 |
"get list from model and return the new list. |
|
1695 |
If listMessage is nil, try aspectMessage for backward compatibilty. |
|
1696 |
" |
|
846 | 1697 |
|msg| |
838 | 1698 |
|
846 | 1699 |
widthOfWidestLine := nil. |
847 | 1700 |
list := listOfNodes := (msg := listMsg ? aspectMsg) notNil ifTrue:[model perform:msg] ifFalse:[#()]. |
1701 |
self refetchDeviceResources. |
|
846 | 1702 |
^ listOfNodes |
494 | 1703 |
! |
1704 |
||
1705 |
model:aModel |
|
514 | 1706 |
"check whether model is nil; than a default model is created |
1707 |
" |
|
855 | 1708 |
|model root| |
514 | 1709 |
|
811 | 1710 |
model notNil ifTrue:[ |
1711 |
model stopRunningTasks |
|
1712 |
]. |
|
1713 |
||
1171 | 1714 |
model := aModel ? (self class defaultModelClass new). |
1715 |
self itemClass:(model class defaultItemClass). |
|
855 | 1716 |
root := model root. |
1717 |
||
514 | 1718 |
model showRoot:showRoot. |
855 | 1719 |
|
1720 |
root notNil ifTrue:[ |
|
1721 |
root expand |
|
1722 |
]. |
|
514 | 1723 |
super model:model. |
855 | 1724 |
self getListFromModel |
811 | 1725 |
|
514 | 1726 |
! |
1727 |
||
1728 |
rootFromModel |
|
1729 |
"update hierarchical list from root model; 'rootHolder' |
|
1730 |
" |
|
1731 |
|root| |
|
1732 |
||
585 | 1733 |
root := rootHolder root. |
514 | 1734 |
|
1735 |
self root == root ifFalse:[ |
|
1736 |
self selection:nil. |
|
1737 |
self root:root. |
|
585 | 1738 |
]. |
514 | 1739 |
! |
1740 |
||
1741 |
selectionFromModel |
|
1742 |
"set the selection derived from the selectionHolder |
|
1743 |
" |
|
855 | 1744 |
|coll value size idx| |
514 | 1745 |
|
1214 | 1746 |
(value := selectionHolder value) isNil ifFalse:[ |
1747 |
(multipleSelectOk and:[value isCollection]) ifFalse:[ |
|
1748 |
^ self selectNode:value |
|
860 | 1749 |
]. |
1214 | 1750 |
|
1751 |
(size := value size) ~~ 0 ifTrue:[ |
|
1752 |
size == 1 ifTrue:[ |
|
1753 |
^ self selectNode:(value at:1) |
|
1754 |
]. |
|
1755 |
||
1756 |
model doMakeVisible:value. |
|
1757 |
||
1758 |
coll := OrderedCollection new:size. |
|
1759 |
||
1760 |
value do:[:el| |
|
1761 |
idx := el isNumber ifTrue:[el] ifFalse:[self indexOfNode:el]. |
|
1762 |
||
1763 |
idx ~~ 0 ifTrue:[ |
|
1764 |
coll add:idx |
|
1765 |
]. |
|
1766 |
]. |
|
1767 |
||
1768 |
coll isEmpty ifTrue:[ |
|
1769 |
coll := nil |
|
1770 |
]. |
|
1771 |
]. |
|
848 | 1772 |
]. |
1773 |
self selection:coll |
|
514 | 1774 |
! |
1775 |
||
1776 |
selectionToModel |
|
1777 |
"write selection to selection holder |
|
1778 |
" |
|
1779 |
|newSel oldSel| |
|
1780 |
||
1781 |
oldSel := selectionHolder value. |
|
1782 |
||
1783 |
multipleSelectOk ifFalse:[ |
|
1784 |
(newSel := self selectedNode) ~~ oldSel ifTrue:[ |
|
1785 |
selectionHolder value:newSel |
|
1786 |
] |
|
1787 |
] ifTrue:[ |
|
1788 |
selection size == 0 ifTrue:[ |
|
1789 |
oldSel notNil ifTrue:[ |
|
1790 |
selectionHolder value:nil |
|
1791 |
] |
|
1792 |
] ifFalse:[ |
|
1793 |
newSel := selection collect:[:i| listOfNodes at:i]. |
|
1794 |
||
1795 |
newSel size ~~ oldSel size ifTrue:[ |
|
1796 |
selectionHolder value:newSel. |
|
1797 |
] ifFalse:[ |
|
1798 |
newSel do:[:aNode| |
|
785 | 1799 |
(oldSel includesIdentical:aNode) ifFalse:[ |
514 | 1800 |
^ selectionHolder value:newSel |
1801 |
] |
|
1802 |
] |
|
1803 |
] |
|
1804 |
] |
|
1805 |
] |
|
444 | 1806 |
! ! |
1807 |
||
490 | 1808 |
!SelectionInTreeView methodsFor:'private'! |
1809 |
||
1171 | 1810 |
closeEditor |
1811 |
"close the editor |
|
1812 |
" |
|
1813 |
editorWidget notNil ifTrue:[ |
|
1814 |
editorWidget destroy. |
|
1815 |
editorIndex := 0. |
|
1816 |
editorWidget := nil. |
|
1817 |
]. |
|
1818 |
||
1819 |
! |
|
1820 |
||
490 | 1821 |
list:aList keepSelection:keepSelection |
585 | 1822 |
"setup new list; keep selection dependent on the boolean state |
1823 |
keepSelection |
|
1824 |
" |
|
1268 | 1825 |
|list| |
490 | 1826 |
|
846 | 1827 |
list := (aList size == 0) ifTrue:[#()] ifFalse:[aList]. |
1828 |
super list:list keepSelection:keepSelection. |
|
1829 |
self refetchDeviceResources. |
|
490 | 1830 |
|
1171 | 1831 |
! |
1832 |
||
1833 |
openEditor |
|
1834 |
"open an editor on selection |
|
1835 |
" |
|
1175 | 1836 |
|node x0 x1 y0| |
1171 | 1837 |
|
1838 |
editorWidget notNil ifTrue:[ |
|
1839 |
^ self |
|
1840 |
]. |
|
1841 |
editorIndex := self selectedIndex. |
|
1842 |
||
1843 |
( (node := listOfNodes at:editorIndex ifAbsent:nil) isNil |
|
1844 |
or:[(y0 := self listLineToVisibleLine:editorIndex) isNil |
|
1845 |
or:[(editorWidget := node editor) isNil]] |
|
1846 |
) ifTrue:[ |
|
1847 |
^ self |
|
1848 |
]. |
|
1175 | 1849 |
editorWidget withAllSubViewsDo:[:v| v font:font ]. |
1850 |
||
1171 | 1851 |
y0 := self yOfVisibleLine:y0. |
1852 |
x0 := self xOfValueNode:node. |
|
1853 |
x1 := (editorWidget preferredExtent x) max:50. |
|
1854 |
x1 := (x0 + x1) min:(self width - 5). |
|
1855 |
||
1856 |
editorWidget geometryLayout:(Rectangle left:x0 right:x1 top:y0 bottom:y0 + fontHeight). |
|
1857 |
||
1858 |
self addComponent:editorWidget. |
|
1859 |
editorWidget realize. |
|
1860 |
self paint:bgColor. |
|
1861 |
||
1862 |
self fillRectangleX:(x0 - SelectionInset) |
|
1863 |
y:y0 |
|
1864 |
width:SelectionInset + SelectionInset + (x1 - x0) |
|
1865 |
height:fontHeight. |
|
1866 |
||
1867 |
||
1868 |
||
1869 |
||
1870 |
||
811 | 1871 |
! ! |
1872 |
||
1873 |
!SelectionInTreeView methodsFor:'private - drag and drop'! |
|
569 | 1874 |
|
811 | 1875 |
collectionOfDragObjects |
1876 |
"returns collection of dragable objects assigned to selection |
|
1877 |
Here, by default, a collection of text-dragObjects is generated; |
|
1878 |
however, if a dragObjectConverter is defined, that one gets a chance |
|
1879 |
to convert as appropriate." |
|
1880 |
||
1881 |
|collection converted selection dLbl dObj node| |
|
1882 |
||
1883 |
selection := self selectionAsCollection. |
|
1884 |
||
1885 |
collection := selection collect:[:nr| |
|
1886 |
node := listOfNodes at:nr. |
|
1887 |
dObj := self dragObjectForNode:node. |
|
1888 |
dObj theObject:(node contents). |
|
846 | 1889 |
dLbl := LabelAndIcon icon:(self figureFor:node) string:(node name). |
811 | 1890 |
dObj displayObject:dLbl. |
1891 |
dObj |
|
1892 |
]. |
|
1893 |
||
1894 |
dragObjectConverter notNil ifTrue:[ |
|
1895 |
converted := OrderedCollection new. |
|
1896 |
collection keysAndValuesDo:[:nr :obj | |
|
1897 |
(dObj := dragObjectConverter value:obj) notNil ifTrue:[ |
|
846 | 1898 |
node := listOfNodes at:nr. |
1899 |
dLbl := LabelAndIcon icon:(self figureFor:node) string:(node name). |
|
811 | 1900 |
converted displayObject:dLbl. |
1901 |
converted add:dObj |
|
1902 |
] |
|
1903 |
]. |
|
1904 |
collection := converted |
|
1905 |
]. |
|
1906 |
^ collection. |
|
1907 |
||
1908 |
||
569 | 1909 |
|
1910 |
! |
|
1911 |
||
811 | 1912 |
dragObjectForNode:aNode |
1913 |
"returns the dragable object for a node; could be redefined in subclass |
|
546 | 1914 |
" |
811 | 1915 |
^ DropObject new:aNode. |
546 | 1916 |
|
811 | 1917 |
|
1918 |
! |
|
546 | 1919 |
|
811 | 1920 |
startDragX:x y:y |
1921 |
"start drag |
|
1922 |
" |
|
1923 |
dragIsActive := true. |
|
546 | 1924 |
|
811 | 1925 |
DragAndDropManager startDrag:(self collectionOfDragObjects) |
1926 |
from:self |
|
1927 |
atEnd:endDragAction |
|
546 | 1928 |
|
1929 |
||
490 | 1930 |
! ! |
1931 |
||
468 | 1932 |
!SelectionInTreeView methodsFor:'private queries'! |
1933 |
||
1934 |
lengthOfLongestLineBetween:firstLine and:lastLine |
|
1935 |
"return the length (in characters) of the longest line in a line-range |
|
1936 |
" |
|
846 | 1937 |
^ self widthOfContents // fontWidth + 1 |
468 | 1938 |
! |
1939 |
||
848 | 1940 |
smallestLevelOfNodesBetween:start and:stop |
1941 |
"returns the smallest level of the nodes in a line range |
|
1942 |
" |
|
1943 |
|prevNode currParent nextParent |
|
1944 |
||
1945 |
lvl "{ Class:SmallInteger }" |
|
1946 |
min "{ Class:SmallInteger }" |
|
1947 |
end "{ Class:SmallInteger }" |
|
1948 |
beg "{ Class:SmallInteger }" |
|
1949 |
| |
|
1950 |
||
1951 |
(end := stop min:(listOfNodes size)) < start ifTrue:[ |
|
1952 |
^ 0 |
|
1953 |
]. |
|
1954 |
||
1955 |
prevNode := listOfNodes at:start. |
|
1956 |
currParent := prevNode parent. |
|
1957 |
||
1958 |
currParent isNil ifTrue:[ |
|
1959 |
^ 1 |
|
1960 |
]. |
|
1961 |
||
1962 |
(min := prevNode level) == 2 ifTrue:[ |
|
1963 |
^ min |
|
1964 |
]. |
|
1965 |
beg := start + 1. |
|
1966 |
||
1967 |
listOfNodes from:beg to:end do:[:currNode| |
|
1968 |
(nextParent := currNode parent) == currParent ifFalse:[ |
|
1969 |
(currParent := nextParent) == prevNode ifFalse:[ |
|
1970 |
(lvl := currNode level) == 2 ifTrue:[ |
|
1971 |
^ 2 |
|
1972 |
]. |
|
1973 |
min := min min:lvl |
|
1974 |
] |
|
1975 |
]. |
|
1976 |
prevNode := currNode |
|
1977 |
]. |
|
1978 |
^ min |
|
1979 |
||
1980 |
||
1981 |
||
1982 |
||
1983 |
! |
|
1984 |
||
468 | 1985 |
widthOfContents |
1986 |
"return the width of the contents in pixels |
|
1987 |
- used for scrollbar interface" |
|
1988 |
||
846 | 1989 |
listOfNodes isNil ifTrue:[^ 0]. |
468 | 1990 |
|
1991 |
(widthOfWidestLine isNil or:[widthOfWidestLine == 0]) ifTrue:[ |
|
846 | 1992 |
widthOfWidestLine := self widthOfLongestLine |
468 | 1993 |
]. |
1994 |
^ widthOfWidestLine + (leftMargin * 2) |
|
1995 |
||
1996 |
! |
|
1997 |
||
846 | 1998 |
widthOfLongestLine |
1999 |
"return the width of the longest line in pixels |
|
468 | 2000 |
" |
848 | 2001 |
|parent pItem p |
846 | 2002 |
startX "{ Class: SmallInteger }" |
2003 |
deltaX "{ Class: SmallInteger }" |
|
838 | 2004 |
level "{ Class: SmallInteger }" |
2005 |
width "{ Class: SmallInteger }" |
|
2006 |
maxSz "{ Class: SmallInteger }"| |
|
468 | 2007 |
|
848 | 2008 |
buildInArray atAllPut:0. |
846 | 2009 |
parent := nil. |
2010 |
maxSz := 1. |
|
838 | 2011 |
level := 1. |
846 | 2012 |
|
2013 |
listOfNodes do:[:anItem| |
|
848 | 2014 |
(p := anItem parent) ~~ parent ifTrue:[ |
2015 |
buildInArray at:level put:maxSz. |
|
846 | 2016 |
|
848 | 2017 |
(parent := p) == pItem ifTrue:[level := level + 1] |
2018 |
ifFalse:[level := anItem level]. |
|
2019 |
||
2020 |
maxSz := buildInArray at:level. |
|
846 | 2021 |
]. |
2022 |
pItem := anItem. |
|
2023 |
maxSz := maxSz max:(anItem name size). |
|
2024 |
]. |
|
848 | 2025 |
buildInArray at:level put:maxSz. |
468 | 2026 |
|
846 | 2027 |
startX := self xOfStringLevel:1. |
2028 |
deltaX := imageInset + imageWidth. |
|
2029 |
width := '1' widthOn:self. |
|
2030 |
maxSz := 0. |
|
468 | 2031 |
|
848 | 2032 |
buildInArray do:[:el| |
846 | 2033 |
el == 0 ifTrue:[ ^ maxSz + leftOffset ]. |
2034 |
maxSz := maxSz max:(el * width + startX). |
|
2035 |
startX := startX + deltaX. |
|
468 | 2036 |
]. |
846 | 2037 |
! ! |
2038 |
||
2039 |
!SelectionInTreeView methodsFor:'private redefinitions'! |
|
2040 |
||
2041 |
expandTabs |
|
2042 |
"nothing to do |
|
2043 |
" |
|
838 | 2044 |
|
2045 |
||
468 | 2046 |
! |
2047 |
||
846 | 2048 |
list:aCollection expandTabs:expand scanForNonStrings:scan |
2049 |
||
2050 |
includesNonStrings := false. |
|
2051 |
self list:aCollection expandTabs:false scanForNonStrings:false includesNonStrings:false |
|
2052 |
! |
|
2053 |
||
468 | 2054 |
withoutRedrawAt:anIndex put:aString |
2055 |
"change a line without redisplay" |
|
2056 |
||
2057 |
|width| |
|
2058 |
||
2059 |
width := widthOfWidestLine. |
|
2060 |
widthOfWidestLine := nil. |
|
2061 |
super withoutRedrawAt:anIndex put:aString. |
|
846 | 2062 |
widthOfWidestLine := width. |
468 | 2063 |
|
846 | 2064 |
(widthOfWidestLine notNil and:[aString size ~~ 0]) ifTrue:[ |
2065 |
width := self xOfStringNode:(listOfNodes at:anIndex) |
|
2066 |
+ (aString widthOn:self) |
|
2067 |
+ leftOffset. |
|
2068 |
||
838 | 2069 |
widthOfWidestLine := widthOfWidestLine max:width. |
468 | 2070 |
]. |
2071 |
! ! |
|
2072 |
||
483 | 2073 |
!SelectionInTreeView methodsFor:'queries'! |
2074 |
||
2075 |
figureFor:aNode |
|
1278 | 2076 |
"return a (bitmap) figure for a node" |
2077 |
||
785 | 2078 |
|icon img| |
2079 |
||
1278 | 2080 |
"/ the item may provide an icon |
2081 |
"/ (it knows for itself if its open or closed) |
|
2082 |
||
785 | 2083 |
(icon := aNode icon) notNil ifTrue:[ |
2084 |
img := registeredImages at:icon ifAbsent:nil. |
|
2085 |
img notNil ifTrue:[ |
|
2086 |
^ img |
|
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
2087 |
]. |
785 | 2088 |
icon isImage ifTrue:[ |
846 | 2089 |
img := self imageOnDevice:icon. |
785 | 2090 |
registeredImages at:icon put:img. |
1278 | 2091 |
^ img |
785 | 2092 |
] |
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
2093 |
]. |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
2094 |
|
1278 | 2095 |
"/ ok, node did not return an icon - use default. |
2096 |
||
846 | 2097 |
aNode hasChildren ifFalse:[ |
1278 | 2098 |
"/ regular |
2099 |
^ imageItem |
|
846 | 2100 |
]. |
1278 | 2101 |
"/ folder |
846 | 2102 |
^ aNode hidden ifTrue:[imageClosed] ifFalse:[imageOpened] |
785 | 2103 |
|
483 | 2104 |
! |
2105 |
||
2106 |
indexOfNode:aNode |
|
2107 |
"returns index of a node |
|
2108 |
" |
|
785 | 2109 |
^ listOfNodes identityIndexOf:aNode |
483 | 2110 |
! |
2111 |
||
494 | 2112 |
xOfFigureLevel:aLevel |
2113 |
"origin x where to draw the icon |
|
2114 |
" |
|
785 | 2115 |
|l "{ Class:SmallInteger }"| |
494 | 2116 |
|
785 | 2117 |
l := showRoot ifTrue:[aLevel] ifFalse:[aLevel - 1]. |
494 | 2118 |
|
659 | 2119 |
showDirectoryIndicator ifFalse:[ |
2120 |
l := l - 1 |
|
2121 |
] ifTrue:[ |
|
2122 |
showDirectoryIndicatorForRoot ifFalse:[ |
|
2123 |
l := l - 1 |
|
2124 |
] |
|
2125 |
]. |
|
494 | 2126 |
^ (l * (imageInset + imageWidth)) + imageInset - leftOffset + leftMargin |
2127 |
||
2128 |
! |
|
2129 |
||
483 | 2130 |
xOfFigureNode:aNode |
2131 |
"origin x where to draw the icon |
|
2132 |
" |
|
494 | 2133 |
^ self xOfFigureLevel:(aNode level) |
2134 |
! |
|
490 | 2135 |
|
494 | 2136 |
xOfStringLevel:aLevel |
2137 |
"origin x where to draw the text( label ) |
|
2138 |
" |
|
2139 |
^ (self xOfFigureLevel:aLevel) + imageWidth + textInset |
|
483 | 2140 |
|
2141 |
! |
|
2142 |
||
2143 |
xOfStringNode:aNode |
|
2144 |
"origin x where to draw the text( label ) |
|
2145 |
" |
|
494 | 2146 |
^ self xOfStringLevel:(aNode level) |
483 | 2147 |
|
1171 | 2148 |
! |
2149 |
||
2150 |
xOfValueNode:aNode |
|
2151 |
"returns the left x position of the start of the value |
|
2152 |
" |
|
2153 |
|p x| |
|
2154 |
||
2155 |
p := aNode parent. |
|
2156 |
||
2157 |
x := p notNil ifTrue:[30 + (p childrenWidthOn:self)] |
|
2158 |
ifFalse:[0]. |
|
2159 |
||
2160 |
^ x + (self xOfStringNode:aNode) |
|
2161 |
||
483 | 2162 |
! ! |
2163 |
||
1061
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2164 |
!SelectionInTreeView methodsFor:'scrolling'! |
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2165 |
|
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2166 |
needScrollToMakeLine:aListLineNr |
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2167 |
"redefined to scroll whenever line is not in top half" |
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2168 |
|
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2169 |
(aListLineNr >= firstLineShown) ifTrue:[ |
1162 | 2170 |
(aListLineNr < (firstLineShown + nFullLinesShown)) ifTrue:[ |
1061
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2171 |
^ false |
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2172 |
] |
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2173 |
]. |
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2174 |
^ true |
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2175 |
|
1171 | 2176 |
! |
2177 |
||
2178 |
originChanged:delta |
|
2179 |
"sent after scrolling - have to update origin of editor |
|
2180 |
" |
|
2181 |
super originChanged:delta. |
|
2182 |
||
2183 |
editorWidget notNil ifTrue:[ |
|
2184 |
editorWidget origin:(editorWidget origin - delta) |
|
2185 |
] |
|
2186 |
||
1061
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2187 |
! ! |
8eba9d898259
scroll to bring selection into upper half of view
Claus Gittinger <cg@exept.de>
parents:
908
diff
changeset
|
2188 |
|
444 | 2189 |
!SelectionInTreeView methodsFor:'selection'! |
2190 |
||
468 | 2191 |
selectNode:aNode |
2192 |
"change selection to a node |
|
2193 |
" |
|
855 | 2194 |
|index| |
848 | 2195 |
|
860 | 2196 |
(index := aNode) notNil ifTrue:[ |
2197 |
index isNumber ifFalse:[ |
|
2198 |
(index := self indexOfNode:aNode) == 0 ifTrue:[ |
|
2199 |
model doMakeVisible:aNode. |
|
2200 |
index := self indexOfNode:aNode. |
|
2201 |
] |
|
855 | 2202 |
]. |
848 | 2203 |
index == 0 ifTrue:[ |
855 | 2204 |
index := nil |
848 | 2205 |
] |
2206 |
]. |
|
2207 |
self selection:index |
|
468 | 2208 |
|
2209 |
||
2210 |
! |
|
2211 |
||
456 | 2212 |
selectedIndex |
2213 |
"get single selected index or 0 |
|
2214 |
" |
|
483 | 2215 |
selection size == 1 ifTrue:[^ selection first]. |
2216 |
selection isNumber ifTrue:[^ selection]. |
|
456 | 2217 |
^ 0 |
444 | 2218 |
! |
2219 |
||
2220 |
selectedNode |
|
2221 |
"get the single selected node or nil |
|
2222 |
" |
|
456 | 2223 |
|idx| |
2224 |
||
2225 |
(idx := self selectedIndex) ~~ 0 ifTrue:[ |
|
2226 |
^ listOfNodes at:idx |
|
444 | 2227 |
]. |
2228 |
^ nil |
|
514 | 2229 |
! |
2230 |
||
2231 |
selectionChangedFrom:oldSelection |
|
2232 |
"update selectionHolder if not nil |
|
2233 |
" |
|
1171 | 2234 |
self closeEditor. |
514 | 2235 |
|
623
4de870640523
first change selectionHolders value,
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
2236 |
"/ first change my selectionHolders value ... |
514 | 2237 |
selectionHolder notNil ifTrue:[ |
2238 |
self selectionToModel. |
|
2239 |
]. |
|
2240 |
||
623
4de870640523
first change selectionHolders value,
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
2241 |
"/ ... then make notifications. |
4de870640523
first change selectionHolders value,
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
2242 |
super selectionChangedFrom:oldSelection. |
4de870640523
first change selectionHolders value,
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
2243 |
|
4de870640523
first change selectionHolders value,
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
2244 |
|
1171 | 2245 |
! |
2246 |
||
2247 |
setSelection:aSelection |
|
2248 |
"if no selection exists, close the editor |
|
2249 |
" |
|
2250 |
(aSelection isNil or:[aSelection == 0]) ifTrue:[ |
|
2251 |
self closeEditor |
|
2252 |
]. |
|
2253 |
super setSelection:aSelection |
|
2254 |
||
2255 |
||
444 | 2256 |
! ! |
2257 |
||
855 | 2258 |
!SelectionInTreeView methodsFor:'selection actions'! |
507 | 2259 |
|
2260 |
selectedNodeAdd:something |
|
2261 |
"add a node or collection of nodes after selected node |
|
2262 |
" |
|
2263 |
|node| |
|
2264 |
||
2265 |
something notNil ifTrue:[ |
|
2266 |
(node := self selectedNode) notNil ifTrue:[ |
|
2267 |
node parent notNil ifTrue:[ |
|
2268 |
node isCollapsable ifTrue:[ |
|
2269 |
model add:something beforeIndex:1 below:node |
|
2270 |
] ifFalse:[ |
|
2271 |
model add:something after:node |
|
2272 |
] |
|
2273 |
] ifFalse:[ |
|
2274 |
model add:something beforeIndex:1 below:(self root) |
|
2275 |
] |
|
2276 |
] |
|
2277 |
] |
|
2278 |
||
2279 |
! |
|
2280 |
||
2281 |
selectedNodeBecomeChildOfNext |
|
2282 |
"become node a child of followd node |
|
2283 |
" |
|
2284 |
|idx node cprt nprt| |
|
2285 |
||
2286 |
((node := self selectedNode) isNil or:[(cprt := node parent) isNil]) ifFalse:[ |
|
2287 |
idx := cprt indexOfChild:node. |
|
2288 |
||
2289 |
idx == cprt children size ifFalse:[ |
|
2290 |
nprt := cprt childAt:(idx + 1). |
|
2291 |
||
2292 |
nprt notNil ifTrue:[ |
|
855 | 2293 |
self setSelection:nil. |
2294 |
model remove:node. |
|
507 | 2295 |
model add:node beforeIndex:1 below:nprt. |
2296 |
self selectNode:node. |
|
2297 |
] |
|
2298 |
] |
|
2299 |
] |
|
2300 |
! |
|
2301 |
||
2302 |
selectedNodeBecomeSisterOfParent |
|
2303 |
"become node a sister of its current parent |
|
2304 |
" |
|
2305 |
|node cprt nprt| |
|
2306 |
||
2307 |
( (node := self selectedNode) isNil |
|
2308 |
or:[(cprt := node parent) isNil |
|
2309 |
or:[(nprt := cprt parent) isNil]] |
|
2310 |
) ifFalse:[ |
|
855 | 2311 |
self setSelection:nil. |
2312 |
model remove:node. |
|
507 | 2313 |
model add:node afterIndex:(nprt indexOfChild:cprt) below:nprt. |
855 | 2314 |
self selectNode:node. |
507 | 2315 |
] |
2316 |
||
2317 |
! |
|
2318 |
||
2319 |
selectedNodeChangeSequenceOrder:anOffset |
|
2320 |
"move child 'anOffset' forward or backward in list of children |
|
2321 |
" |
|
2322 |
|idx node size parent| |
|
2323 |
||
2324 |
( (node := self selectedNode) notNil |
|
2325 |
and:[(parent := node parent) notNil |
|
2326 |
and:[(size := parent children size) > 1]] |
|
2327 |
) ifTrue:[ |
|
2328 |
idx := parent indexOfChild:node. |
|
855 | 2329 |
self setSelection:nil. |
2330 |
model remove:node. |
|
507 | 2331 |
|
2332 |
(idx := idx + anOffset) < 1 ifTrue:[ |
|
2333 |
idx := size |
|
2334 |
] ifFalse:[ |
|
2335 |
idx > size ifTrue:[idx := 1] |
|
2336 |
]. |
|
2337 |
model add:node beforeIndex:idx below:parent. |
|
2338 |
self selectNode:node. |
|
2339 |
] |
|
2340 |
! |
|
2341 |
||
2342 |
selectedNodeExpand:doExpand |
|
2343 |
"collapse or expand selected node |
|
2344 |
" |
|
855 | 2345 |
|node| |
507 | 2346 |
|
855 | 2347 |
(node := self selectedNode) notNil ifTrue:[ |
2348 |
doExpand ifTrue:[model doExpand:node] |
|
2349 |
ifFalse:[model doCollapse:node] |
|
2350 |
] |
|
507 | 2351 |
! |
2352 |
||
2353 |
selectedNodesRemove |
|
2354 |
"remove selected nodes |
|
2355 |
" |
|
855 | 2356 |
|selection| |
2357 |
||
2358 |
selection := self selection. |
|
507 | 2359 |
self selection:nil. |
855 | 2360 |
model remove:selection. |
507 | 2361 |
! ! |
2362 |
||
444 | 2363 |
!SelectionInTreeView class methodsFor:'documentation'! |
2364 |
||
2365 |
version |
|
1328 | 2366 |
^ '$Header: /cvs/stx/stx/libwidg2/Attic/SelTreeV.st,v 1.83 1999-04-23 12:47:39 cg Exp $' |
444 | 2367 |
! ! |