author | ca |
Thu, 19 Feb 1998 10:35:34 +0100 | |
changeset 769 | 15fafccfed86 |
parent 764 | 7063f2604814 |
child 770 | f197d1f5a246 |
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 |
|
517 | 15 |
instanceVariableNames:'validateDoubleClickBlock selectionHolder rootHolder imageWidth |
685 | 16 |
showLines listOfNodes imageInset textInset labelOffsetY lineMask |
17 |
lineColor openIndicator computeResources closeIndicator showRoot |
|
569 | 18 |
extentOpenIndicator extentCloseIndicator showDirectoryIndicator |
659 | 19 |
showDirectoryIndicatorForRoot indicatorExtentDiv2 imageOpened |
20 |
imageClosed imageItem discardMotionEvents' |
|
490 | 21 |
classVariableNames:'ImageOpened ImageClosed ImageItem OpenIndicator CloseIndicator' |
444 | 22 |
poolDictionaries:'' |
23 |
category:'Views-Text' |
|
24 |
! |
|
25 |
||
26 |
!SelectionInTreeView class methodsFor:'documentation'! |
|
27 |
||
28 |
copyright |
|
29 |
" |
|
30 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
|
31 |
All Rights Reserved |
|
32 |
||
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
||
41 |
! |
|
42 |
||
43 |
documentation |
|
44 |
" |
|
45 |
somewhat like a SelectionInListView; but specialized for hierarchical (i.e. tree-like) |
|
46 |
lists and adds the functions to show/hide subtrees. |
|
456 | 47 |
Requires SelectionInTree as model and TreeItem (or compatible) list entries. |
444 | 48 |
|
456 | 49 |
This class obsoletes SelectionInTreeView, which is no longer |
446 | 50 |
maintained but kept for backward compatibility. |
51 |
||
52 |
||
444 | 53 |
[see also:] |
456 | 54 |
SelectionInTree |
55 |
TreeItem |
|
56 |
SelectionInTreeView |
|
444 | 57 |
SelectionInListView |
494 | 58 |
FileSelectionTree |
444 | 59 |
|
60 |
[author:] |
|
61 |
Claus Atzkern |
|
62 |
" |
|
63 |
||
64 |
! |
|
65 |
||
66 |
examples |
|
67 |
" |
|
68 |
shows the tree of smalltalk classes: |
|
69 |
[exBegin] |
|
514 | 70 |
|top sel| |
456 | 71 |
|
514 | 72 |
top := StandardSystemView new; extent:300@300. |
456 | 73 |
sel := SelectionInTreeView new. |
514 | 74 |
sel root:(TreeItem newAsTreeFromSmalltalkClass:Object). |
456 | 75 |
sel action:[:nr | Transcript show:'selected:'; showCR:nr]. |
76 |
top add:(ScrollableView forView:sel) in:((0.0 @ 0.0 ) corner:( 1.0 @ 1.0)). |
|
77 |
top open. |
|
78 |
[exEnd] |
|
79 |
||
80 |
||
485 | 81 |
|
456 | 82 |
same, including nil-subclasses (i.e. really all classes): |
83 |
[exBegin] |
|
514 | 84 |
|top sel| |
444 | 85 |
|
514 | 86 |
top := StandardSystemView new; extent:300@300. |
456 | 87 |
sel := SelectionInTreeView new. |
514 | 88 |
sel root:(TreeItem newAsTreeFromSmalltalkClass:nil). |
456 | 89 |
sel action:[:nr | Transcript show:'selected:'; showCR:nr]. |
685 | 90 |
sel lineColor:(Color red). |
456 | 91 |
top add:(ScrollableView forView:sel) in:((0.0 @ 0.0 ) corner:( 1.0 @ 1.0)). |
92 |
top open. |
|
93 |
[exEnd] |
|
94 |
||
485 | 95 |
|
483 | 96 |
|
485 | 97 |
shows the tree of smalltalk classes; show directory indication and no |
98 |
lines. |
|
99 |
[exBegin] |
|
514 | 100 |
|top sel| |
483 | 101 |
|
514 | 102 |
top := StandardSystemView new; extent:300@300. |
483 | 103 |
sel := SelectionInTreeView new. |
485 | 104 |
sel showLines:false. |
105 |
sel showDirectoryIndicator:true. |
|
514 | 106 |
sel root:(TreeItem newAsTreeFromSmalltalkClass:Object). |
485 | 107 |
sel action:[:nr | Transcript show:'selected:'; showCR:nr]. |
483 | 108 |
top add:(ScrollableView forView:sel) in:((0.0 @ 0.0 ) corner:( 1.0 @ 1.0)). |
109 |
top open. |
|
485 | 110 |
[exEnd] |
111 |
" |
|
112 |
||
514 | 113 |
|
444 | 114 |
! ! |
115 |
||
116 |
!SelectionInTreeView class methodsFor:'constants'! |
|
117 |
||
494 | 118 |
minImageInset |
119 |
"returns minimum inset from directory indication to image |
|
471 | 120 |
" |
494 | 121 |
^ 6 |
490 | 122 |
|
123 |
||
124 |
! ! |
|
125 |
||
126 |
!SelectionInTreeView class methodsFor:'default images'! |
|
127 |
||
128 |
closeIndicator |
|
589 | 129 |
<resource: #fileImage> |
130 |
||
490 | 131 |
CloseIndicator isNil ifTrue:[ |
132 |
CloseIndicator := Image fromFile:('xpmBitmaps/plus.xpm'). |
|
133 |
]. |
|
134 |
^ CloseIndicator |
|
135 |
" |
|
136 |
CloseIndicator := nil |
|
137 |
" |
|
589 | 138 |
|
139 |
"Modified: / 29.10.1997 / 03:36:00 / cg" |
|
471 | 140 |
! |
141 |
||
444 | 142 |
imageClosed |
589 | 143 |
<resource: #fileImage> |
144 |
||
444 | 145 |
ImageClosed isNil ifTrue:[ |
146 |
ImageClosed := Image fromFile:('xpmBitmaps/document_images/tiny_yellow_dir.xpm'). |
|
147 |
]. |
|
148 |
^ ImageClosed |
|
149 |
" |
|
150 |
ImageClosed := nil |
|
151 |
" |
|
152 |
||
589 | 153 |
"Modified: / 29.10.1997 / 03:36:05 / cg" |
444 | 154 |
! |
155 |
||
156 |
imageItem |
|
589 | 157 |
<resource: #fileImage> |
158 |
||
444 | 159 |
ImageItem isNil ifTrue:[ |
160 |
ImageItem := Image fromFile:('xpmBitmaps/document_images/tiny_file_plain.xpm') |
|
161 |
||
162 |
]. |
|
163 |
^ ImageItem |
|
164 |
" |
|
165 |
ImageItem := nil |
|
166 |
" |
|
167 |
||
589 | 168 |
"Modified: / 29.10.1997 / 03:36:10 / cg" |
444 | 169 |
! |
170 |
||
171 |
imageOpened |
|
589 | 172 |
<resource: #fileImage> |
173 |
||
444 | 174 |
ImageOpened isNil ifTrue:[ |
175 |
ImageOpened := Image fromFile:('xpmBitmaps/document_images/tiny_yellow_dir_open.xpm'). |
|
176 |
||
177 |
]. |
|
178 |
^ ImageOpened |
|
179 |
" |
|
180 |
ImageOpened := nil |
|
181 |
" |
|
589 | 182 |
|
183 |
"Modified: / 29.10.1997 / 03:36:15 / cg" |
|
490 | 184 |
! |
185 |
||
186 |
openIndicator |
|
589 | 187 |
<resource: #fileImage> |
188 |
||
490 | 189 |
OpenIndicator isNil ifTrue:[ |
190 |
OpenIndicator := Image fromFile:('xpmBitmaps/minus.xpm'). |
|
191 |
]. |
|
192 |
^ OpenIndicator |
|
193 |
" |
|
194 |
OpenIndicator := nil |
|
195 |
" |
|
196 |
||
589 | 197 |
"Modified: / 29.10.1997 / 03:36:21 / cg" |
444 | 198 |
! ! |
199 |
||
200 |
!SelectionInTreeView methodsFor:'accessing'! |
|
201 |
||
685 | 202 |
lineColor |
203 |
"returns user configured line color or nil |
|
204 |
" |
|
205 |
^ lineColor |
|
206 |
||
207 |
! |
|
208 |
||
209 |
lineColor:aColor |
|
210 |
"returns user configured line color or nil |
|
211 |
" |
|
212 |
|col| |
|
213 |
||
214 |
col := aColor = fgColor ifTrue:[nil] ifFalse:[aColor]. |
|
215 |
||
216 |
col = lineColor ifFalse:[ |
|
217 |
lineColor := col. |
|
218 |
||
219 |
shown ifTrue:[ |
|
220 |
lineColor notNil ifTrue:[lineColor := lineColor on:device]. |
|
221 |
self invalidate |
|
222 |
] |
|
223 |
] |
|
224 |
! |
|
225 |
||
490 | 226 |
nodeAtIndex:anIndex |
227 |
"returns node at an index or nil |
|
228 |
" |
|
229 |
(anIndex notNil and:[anIndex ~~ 0 and:[anIndex <= listOfNodes size]]) ifTrue:[ |
|
230 |
^ listOfNodes at:anIndex |
|
231 |
]. |
|
232 |
^ nil |
|
233 |
! |
|
234 |
||
507 | 235 |
root |
236 |
"gets the root of the model; the first item into list. |
|
237 |
" |
|
238 |
^ self nodeAtIndex:1 |
|
239 |
! |
|
240 |
||
241 |
root:aRoot |
|
242 |
"sets the root of the model; the first item into list. |
|
243 |
" |
|
514 | 244 |
aRoot notNil ifTrue:[aRoot expand]. |
507 | 245 |
model root:aRoot |
246 |
! |
|
247 |
||
490 | 248 |
textInset |
249 |
"get the left inset of the text label |
|
250 |
" |
|
251 |
^ textInset |
|
252 |
! |
|
253 |
||
254 |
textInset:anInset |
|
255 |
"set the left inset of the text label |
|
256 |
" |
|
257 |
anInset ~~ textInset ifTrue:[ |
|
258 |
anInset >= 0 ifTrue:[ |
|
259 |
textInset := anInset. |
|
260 |
self invalidate |
|
261 |
] ifFalse:[ |
|
262 |
self error |
|
263 |
] |
|
264 |
]. |
|
265 |
! ! |
|
266 |
||
267 |
!SelectionInTreeView methodsFor:'accessing-behavior'! |
|
268 |
||
269 |
showDirectoryIndicator |
|
270 |
"returns true if directories has an open/closed indicator |
|
271 |
" |
|
272 |
^ showDirectoryIndicator |
|
273 |
! |
|
274 |
||
275 |
showDirectoryIndicator:aState |
|
276 |
"set or clear open/closed indicator for directories |
|
277 |
" |
|
278 |
"show or hide lines |
|
279 |
" |
|
280 |
aState ~~ showDirectoryIndicator ifTrue:[ |
|
494 | 281 |
showDirectoryIndicator := aState. |
546 | 282 |
self recomputeDirectoryIndicator. |
490 | 283 |
self invalidate |
284 |
]. |
|
285 |
! |
|
286 |
||
659 | 287 |
showDirectoryIndicatorForRoot |
288 |
"returns true if root directory has an open/closed indicator if |
|
289 |
the common showDirectoryIndicator is enabled |
|
290 |
" |
|
291 |
^ showDirectoryIndicatorForRoot |
|
292 |
! |
|
293 |
||
294 |
showDirectoryIndicatorForRoot:aState |
|
295 |
"true if root directory has an open/closed indicator if |
|
296 |
the common showDirectoryIndicator is enabled |
|
297 |
" |
|
298 |
aState ~~ showDirectoryIndicator ifTrue:[ |
|
299 |
showDirectoryIndicatorForRoot := aState. |
|
300 |
self recomputeDirectoryIndicator. |
|
301 |
self invalidate |
|
302 |
]. |
|
303 |
! |
|
304 |
||
490 | 305 |
showLines |
306 |
"returns true if lines are shown |
|
307 |
" |
|
308 |
^ showLines |
|
309 |
! |
|
310 |
||
311 |
showLines:aState |
|
312 |
"show or hide lines |
|
313 |
" |
|
314 |
aState ~~ showLines ifTrue:[ |
|
315 |
showLines := aState. |
|
316 |
self invalidate |
|
317 |
]. |
|
494 | 318 |
! |
319 |
||
320 |
showRoot |
|
321 |
"list with or without root |
|
322 |
" |
|
323 |
^ showRoot |
|
324 |
! |
|
325 |
||
326 |
showRoot:aState |
|
327 |
"list with or without root |
|
328 |
" |
|
329 |
showRoot ~~ aState ifTrue:[ |
|
514 | 330 |
model showRoot:(showRoot := aState) |
331 |
]. |
|
517 | 332 |
! |
333 |
||
334 |
validateDoubleClickBlock |
|
335 |
"set the conditionBlock; this block is evaluated before a doubleClick action |
|
336 |
on a node will be performed. In case of returning false, the doubleClick will |
|
337 |
not be handled. |
|
338 |
" |
|
339 |
^ validateDoubleClickBlock |
|
340 |
||
341 |
||
342 |
! |
|
343 |
||
344 |
validateDoubleClickBlock:aOneArgBlock |
|
345 |
"set the conditionBlock; this block is evaluated before a doubleClick action |
|
346 |
on a node will be performed. In case of returning false, the doubleClick will |
|
347 |
not be handled. |
|
348 |
" |
|
349 |
validateDoubleClickBlock := aOneArgBlock |
|
350 |
||
351 |
||
514 | 352 |
! ! |
353 |
||
354 |
!SelectionInTreeView methodsFor:'accessing-channels'! |
|
355 |
||
356 |
rootHolder |
|
357 |
"get the holder which keeps the hierarchical list entry or nil |
|
358 |
" |
|
359 |
^ rootHolder |
|
360 |
! |
|
361 |
||
362 |
rootHolder:aValueHolder |
|
363 |
"set the holder which keeps the hierarchical list entry or nil |
|
364 |
" |
|
365 |
rootHolder notNil ifTrue:[ |
|
366 |
rootHolder removeDependent:self |
|
367 |
]. |
|
368 |
(rootHolder := aValueHolder) notNil ifTrue:[ |
|
369 |
rootHolder addDependent:self. |
|
370 |
self rootFromModel. |
|
494 | 371 |
]. |
514 | 372 |
! |
373 |
||
374 |
selectionHolder |
|
375 |
"get the holder which keeps a list of selected items or nil |
|
376 |
" |
|
377 |
^ selectionHolder |
|
378 |
||
379 |
! |
|
380 |
||
381 |
selectionHolder:aHolder |
|
382 |
"set the holder which keeps a list of selected items or nil |
|
383 |
" |
|
384 |
selectionHolder notNil ifTrue:[ |
|
385 |
selectionHolder removeDependent:self |
|
386 |
]. |
|
387 |
||
388 |
(selectionHolder := aHolder) notNil ifTrue:[ |
|
389 |
selectionHolder addDependent:self. |
|
390 |
self selectionFromModel |
|
391 |
]. |
|
392 |
||
490 | 393 |
! ! |
394 |
||
395 |
!SelectionInTreeView methodsFor:'accessing-images'! |
|
396 |
||
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
397 |
imageClosed |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
398 |
"return the value of the instance variable 'imageClosed' (automatically generated)" |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
399 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
400 |
^ imageClosed |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
401 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
402 |
"Created: 3.7.1997 / 12:34:31 / cg" |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
403 |
! |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
404 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
405 |
imageItem |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
406 |
"return the value of the instance variable 'imageItem' (automatically generated)" |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
407 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
408 |
^ imageItem |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
409 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
410 |
"Created: 3.7.1997 / 12:34:34 / cg" |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
411 |
! |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
412 |
|
569 | 413 |
imageOnDevice:anImage |
414 |
"associate iamge to device and clear pixel mask (in case of realized); |
|
415 |
returns the new image. |
|
416 |
" |
|
417 |
|img| |
|
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
418 |
|
569 | 419 |
img := anImage onDevice:device. |
420 |
||
421 |
realized ifTrue:[ |
|
422 |
img := img clearMaskedPixels |
|
423 |
]. |
|
424 |
^ img |
|
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
425 |
! |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
426 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
427 |
imageOpened |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
428 |
"return the value of the instance variable 'imageOpened' (automatically generated)" |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
429 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
430 |
^ imageOpened |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
431 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
432 |
"Created: 3.7.1997 / 12:34:28 / cg" |
471 | 433 |
! ! |
434 |
||
514 | 435 |
!SelectionInTreeView methodsFor:'change & update'! |
436 |
||
437 |
update:something with:aParameter from:aModel |
|
438 |
"one of my models changed its value |
|
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
439 |
" |
514 | 440 |
aModel == rootHolder ifTrue:[ |
441 |
^ self rootFromModel |
|
442 |
]. |
|
443 |
aModel == selectionHolder ifTrue:[ |
|
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
444 |
^ self selectionFromModel |
514 | 445 |
]. |
446 |
||
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
447 |
aModel == model ifTrue:[ |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
448 |
something == #list ifTrue:[ |
585 | 449 |
^ self getListFromModel |
450 |
] |
|
451 |
]. |
|
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
452 |
|
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
453 |
aModel == self selectedNode ifTrue:[ |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
454 |
something == #value ifTrue:[ |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
455 |
^ self redrawLine: (self indexOfNode: aModel) |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
456 |
] |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
457 |
]. |
514 | 458 |
^ super update:something with:aParameter from:aModel. |
459 |
||
460 |
||
461 |
||
462 |
! ! |
|
463 |
||
444 | 464 |
!SelectionInTreeView methodsFor:'drawing'! |
465 |
||
481 | 466 |
drawLine:line atX:atX inVisible:visLineNr with:fg and:bg |
467 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fg and:bg |
|
444 | 468 |
|
469 |
! |
|
470 |
||
471 |
drawLine:line fromX:x inVisible:visLineNr with:fg and:bg |
|
481 | 472 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fg and:bg |
444 | 473 |
|
474 |
! |
|
475 |
||
476 |
drawLine:line inVisible:visLineNr with:fg and:bg |
|
481 | 477 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fg and:bg |
444 | 478 |
|
479 |
! |
|
480 |
||
481 |
drawVisibleLine:visLineNr col:col with:fg and:bg |
|
481 | 482 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fg and:bg |
444 | 483 |
|
484 |
! |
|
485 |
||
486 |
drawVisibleLine:visLineNr from:startCol to:endCol with:fg and:bg |
|
481 | 487 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fg and:bg |
488 |
||
444 | 489 |
! |
490 |
||
491 |
drawVisibleLine:visLineNr from:startCol with:fg and:bg |
|
481 | 492 |
self drawFromVisibleLine:visLineNr to:visLineNr with:fg and:bg |
444 | 493 |
|
494 |
! ! |
|
495 |
||
496 |
!SelectionInTreeView methodsFor:'drawing basics'! |
|
497 |
||
481 | 498 |
drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg |
769 | 499 |
"redraw a visible line range with clearing the background |
500 |
" |
|
501 |
|y0 y1 sz| |
|
481 | 502 |
|
769 | 503 |
shown ifTrue:[ |
504 |
y0 := self yOfVisibleLine:startVisLineNr. |
|
505 |
y0 := y0 - 1. |
|
506 |
sz := endVisLineNr - startVisLineNr + 1. |
|
507 |
y1 := sz * fontHeight. |
|
508 |
||
509 |
"/ clear rectangle line and set background color |
|
510 |
self paint:bg. |
|
511 |
self fillRectangleX:0 y:y0 width:width height:y1. |
|
512 |
||
513 |
(y1 := self visibleLineToAbsoluteLine:startVisLineNr) notNil ifTrue:[ |
|
514 |
self redrawLinesX:0 y:y0 toX:width start:y1 stop:(y1 + sz) |
|
515 |
] |
|
516 |
] |
|
517 |
! |
|
518 |
||
519 |
drawLabelIndex:anIndex atX:x y:yCenter |
|
520 |
"draw text label at x and y centered |
|
521 |
" |
|
522 |
|lbl| |
|
523 |
||
524 |
(lbl := (listOfNodes at:anIndex) name) notNil ifTrue:[ |
|
525 |
self displayOpaqueString:lbl x:x y:(yCenter + labelOffsetY). |
|
526 |
] |
|
527 |
! |
|
528 |
||
529 |
redrawLinesX:x0 y:y0 toX:x1 start:start stop:stop |
|
530 |
"redraw from line to line without clearing the background |
|
531 |
" |
|
532 |
|chgdPaint node image isSelected |
|
533 |
x "{ Class:SmallInteger }" |
|
534 |
yTop "{ Class:SmallInteger }" |
|
535 |
yBot "{ Class:SmallInteger }" |
|
536 |
yCtr "{ Class:SmallInteger }" |
|
537 |
size "{ Class:SmallInteger }" |
|
538 |
end "{ Class:SmallInteger }" |
|
539 |
index "{ Class:SmallInteger }" |
|
540 |
xCross "{ Class:SmallInteger }" |
|
541 |
xFig "{ Class:SmallInteger }" |
|
542 |
xStr "{ Class:SmallInteger }" |
|
543 |
idx "{ Class:SmallInteger }" |
|
544 |
level "{ Class:SmallInteger }" |
|
545 |
lv "{ Class:SmallInteger }" |
|
546 |
figWidthDiv2 "{ Class:SmallInteger }" |
|
547 |
| |
|
481 | 548 |
|
552 | 549 |
level := nil. "/ to force evaluation of #ifFalse in loop |
769 | 550 |
yTop := y0. |
551 |
index := start. |
|
494 | 552 |
size := listOfNodes size. |
769 | 553 |
end := stop min:size. |
481 | 554 |
|
541 | 555 |
figWidthDiv2 := imageWidth // 2. |
685 | 556 |
figWidthDiv2 odd ifTrue:[figWidthDiv2 := figWidthDiv2 + 1]. |
494 | 557 |
yCtr := yTop - (fontHeight // 2). |
485 | 558 |
|
769 | 559 |
[index <= end] whileTrue:[ |
494 | 560 |
node := listOfNodes at:index. |
561 |
yBot := yTop + fontHeight. |
|
562 |
yCtr := yCtr + fontHeight. |
|
485 | 563 |
|
494 | 564 |
(lv := node level) == level ifFalse:[ |
565 |
level := lv. |
|
566 |
xFig := self xOfFigureLevel:lv. |
|
567 |
xStr := self xOfStringLevel:lv. |
|
568 |
xCross := (self xOfFigureLevel:(lv-1)) + figWidthDiv2. |
|
481 | 569 |
]. |
570 |
||
769 | 571 |
(isSelected := self isInSelection:index) ifTrue:[ |
572 |
self paint:hilightFgColor on:hilightBgColor. |
|
573 |
] ifFalse:[ |
|
574 |
self paint:fgColor on:bgColor. |
|
575 |
]. |
|
576 |
||
481 | 577 |
showLines ifTrue:[ |
769 | 578 |
chgdPaint := (lineColor isNil or:[isSelected]) not. |
579 |
||
580 |
chgdPaint ifTrue:[ |
|
685 | 581 |
self paint:lineColor. |
582 |
]. |
|
769 | 583 |
|
685 | 584 |
self mask:lineMask. |
585 |
self setMaskOrigin:(self viewOrigin + (0 @ 1) \\ (lineMask extent)). |
|
586 |
||
769 | 587 |
xCross < x1 ifTrue:[ |
588 |
( ((x := xFig + figWidthDiv2) between:x0 and:x1) |
|
589 |
and:[node isCollapsable |
|
590 |
and:[node numberOfChildren ~~ 0]] |
|
591 |
) ifTrue:[ |
|
592 |
self displayLineFromX:x y:yCtr toX:x y:yBot |
|
593 |
]. |
|
594 |
||
595 |
"/ vertical line from previous to current form |
|
596 |
( xCross >= x0 |
|
597 |
and:[level ~~ 1 |
|
598 |
and:[node parent children last == node]] |
|
599 |
) ifTrue:[ |
|
600 |
self displayLineFromX:xCross y:yTop - 1 toX:xCross y:yCtr |
|
601 |
]. |
|
602 |
||
603 |
"/ horizontal line from previous to current form |
|
604 |
( xFig > x0 |
|
605 |
and:[(level ~~ 1 |
|
606 |
or:[showDirectoryIndicatorForRoot and:[showDirectoryIndicator]])] |
|
607 |
) ifTrue:[ |
|
608 |
self displayLineFromX:xCross y:yCtr toX:xFig y:yCtr |
|
609 |
] |
|
490 | 610 |
]. |
659 | 611 |
|
769 | 612 |
"/ draw all vertical lines to left side |
613 |
xCross > x0 ifTrue:[ |
|
614 |
idx := index. |
|
615 |
||
616 |
[(lv > 0 and:[(idx := idx + 1) <= size])] whileTrue:[ |
|
617 |
(x := (listOfNodes at:idx) level) <= lv ifTrue:[ |
|
618 |
lv := x - 1. |
|
481 | 619 |
|
769 | 620 |
(x := (self xOfFigureLevel:lv) + figWidthDiv2) < x0 ifTrue:[ |
621 |
lv := 0 |
|
622 |
] ifFalse:[ |
|
623 |
x <= x1 ifTrue:[ |
|
624 |
self displayLineFromX:x y:yTop - 1 toX:x y:yBot |
|
625 |
] |
|
626 |
] |
|
627 |
] |
|
481 | 628 |
] |
685 | 629 |
]. |
630 |
self mask:nil. |
|
769 | 631 |
|
632 |
chgdPaint ifTrue:[ |
|
633 |
isSelected ifTrue:[self paint:hilightFgColor on:hilightBgColor] |
|
634 |
ifFalse:[self paint:fgColor on:bgColor] |
|
635 |
] |
|
481 | 636 |
]. |
637 |
||
638 |
"/ draw image |
|
769 | 639 |
(image := self figureFor:node) notNil ifTrue:[ |
640 |
(xFig < x1 and:[(xFig + image width) > x0]) ifTrue:[ |
|
641 |
self displayForm:image x:xFig y:(yCtr - (image height // 2)) |
|
642 |
] |
|
541 | 643 |
]. |
481 | 644 |
|
645 |
"/ draw text label |
|
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
646 |
self drawLabelIndex:index atX:xStr y:yCtr . |
490 | 647 |
|
494 | 648 |
"/ draw directory indicator |
659 | 649 |
|
569 | 650 |
(showDirectoryIndicator and:[node showIndicator]) ifTrue:[ |
659 | 651 |
(level ~~ 1 or:[showDirectoryIndicatorForRoot]) ifTrue:[ |
652 |
node isCollapsable ifTrue:[ |
|
653 |
image := openIndicator. |
|
654 |
x := extentOpenIndicator. |
|
655 |
] ifFalse:[ |
|
656 |
image := closeIndicator. |
|
657 |
x := extentCloseIndicator. |
|
658 |
]. |
|
769 | 659 |
idx := x x. |
660 |
||
661 |
(xCross - idx < x1 and:[xCross + idx > x0]) ifTrue:[ |
|
662 |
self displayForm:image x:(xCross - idx) y:(yCtr - x y) |
|
663 |
] |
|
659 | 664 |
] |
485 | 665 |
]. |
481 | 666 |
"/ setup next line |
494 | 667 |
index := index + 1. |
668 |
yTop := yBot. |
|
769 | 669 |
] |
569 | 670 |
! |
444 | 671 |
|
569 | 672 |
redrawX:x y:y width:w height:h |
769 | 673 |
"a region must be redrawn" |
569 | 674 |
|
769 | 675 |
|saveClip |
676 |
y0 "{ Class:SmallInteger }" |
|
677 |
y1 "{ Class:SmallInteger }" |
|
678 |
visStart "{ Class:SmallInteger }" |
|
679 |
visEnd "{ Class:SmallInteger }" |
|
680 |
startLn "{ Class:SmallInteger }" |
|
681 |
stopLn "{ Class:SmallInteger }" |
|
682 |
maxY "{ Class:SmallInteger }" |
|
683 |
startY "{ Class:SmallInteger }"| |
|
684 |
||
685 |
shown ifFalse:[^ self]. |
|
686 |
||
687 |
visStart := self visibleLineOfY:y. |
|
688 |
visEnd := self visibleLineOfY:(y + h). |
|
689 |
startLn := self visibleLineToAbsoluteLine:visStart. |
|
690 |
||
691 |
self paint:bgColor. |
|
692 |
self fillRectangleX:x y:y width:w height:h. |
|
693 |
||
694 |
startLn isNil ifTrue:[ |
|
695 |
^ self |
|
696 |
]. |
|
697 |
startY := (self yOfVisibleLine:visStart) - 1. |
|
698 |
stopLn := startLn + visEnd - visStart. |
|
699 |
||
700 |
saveClip := clipRect. |
|
701 |
self clippingRectangle:(Rectangle left:x top:y width:w height:h). |
|
702 |
||
703 |
self hasSelection ifTrue:[ |
|
704 |
maxY := y + h. |
|
705 |
||
706 |
self selectionDo:[:i| |
|
707 |
(i between:startLn and:stopLn) ifTrue:[ |
|
708 |
self paint:hilightBgColor. |
|
709 |
y0 := (startY + (i - startLn * fontHeight)) max:y. |
|
710 |
y1 := (y0 + fontHeight) min:maxY. |
|
711 |
self fillRectangleX:x y:y0 width:w height:y1 - y0. |
|
712 |
] |
|
713 |
] |
|
569 | 714 |
]. |
769 | 715 |
self redrawLinesX:x y:startY toX:(x + w) start:startLn stop:stopLn. |
716 |
self clippingRectangle:saveClip. |
|
717 |
||
444 | 718 |
! ! |
719 |
||
494 | 720 |
!SelectionInTreeView methodsFor:'enumerating'! |
490 | 721 |
|
494 | 722 |
detectNode:aOneArgBlock |
723 |
"evaluate the argument, aBlock for each node in the list until |
|
724 |
the block returns true; in this case return the node which caused |
|
725 |
the true evaluation. If none node is detected, nil is returned. |
|
726 |
" |
|
727 |
^ listOfNodes detect:aOneArgBlock ifNone:nil |
|
507 | 728 |
! |
729 |
||
730 |
selectedNodesDo:aOneArgBlock |
|
731 |
"evaluate the block on each node selected |
|
732 |
" |
|
733 |
self selectionDo:[:i| aOneArgBlock value:(listOfNodes at:i) ] |
|
490 | 734 |
! ! |
735 |
||
569 | 736 |
!SelectionInTreeView methodsFor:'event handling'! |
737 |
||
639 | 738 |
buttonMotion:buttonMask x:x y:y |
739 |
"mouse-move while button was pressed - handle selection changes" |
|
740 |
||
741 |
discardMotionEvents ifFalse:[ |
|
742 |
super buttonMotion:buttonMask x:x y:y |
|
743 |
] |
|
744 |
||
745 |
||
746 |
! |
|
747 |
||
569 | 748 |
buttonMultiPress:button x:x y:y |
749 |
||
750 |
(self indicatiorLineForButton:button atX:x y:y) == 0 ifTrue:[ |
|
751 |
^ super buttonMultiPress:button x:x y:y |
|
752 |
]. |
|
753 |
"/ discard doubleClick on indicator |
|
754 |
! |
|
755 |
||
756 |
buttonPress:button x:x y:y |
|
757 |
"check for indicator |
|
758 |
" |
|
639 | 759 |
|expand node lineNr| |
569 | 760 |
|
761 |
lineNr := self indicatiorLineForButton:button atX:x y:y. |
|
762 |
||
763 |
lineNr == 0 ifTrue:[ |
|
764 |
^ super buttonPress:button x:x y:y |
|
765 |
]. |
|
766 |
node := listOfNodes at:lineNr. |
|
767 |
||
768 |
( validateDoubleClickBlock isNil |
|
769 |
or:[(validateDoubleClickBlock value:node) ~~ false] |
|
770 |
) ifFalse:[ |
|
771 |
^ super buttonPress:button x:x y:y |
|
772 |
]. |
|
639 | 773 |
discardMotionEvents := true. |
569 | 774 |
dragIsActive := false. |
775 |
clickPosition := nil. |
|
776 |
||
639 | 777 |
self hasSelection ifTrue:[ |
778 |
(selectConditionBlock isNil or:[selectConditionBlock value:lineNr]) ifTrue:[ |
|
779 |
self selection:lineNr |
|
780 |
] ifFalse:[ |
|
781 |
self selection:nil |
|
569 | 782 |
] |
783 |
]. |
|
639 | 784 |
self nodeAt:lineNr expand:(node isExpandable). |
569 | 785 |
|
639 | 786 |
! |
787 |
||
788 |
buttonRelease:button x:x y:y |
|
789 |
"stop any autoscroll" |
|
569 | 790 |
|
639 | 791 |
discardMotionEvents ifTrue:[ |
792 |
clickPosition := nil. |
|
793 |
discardMotionEvents := false. |
|
794 |
]. |
|
795 |
super buttonRelease:button x:x y:y |
|
796 |
||
569 | 797 |
! |
798 |
||
799 |
doubleClicked |
|
800 |
"handle a double click; collapse or expand selected entry |
|
801 |
in case of having children |
|
802 |
" |
|
803 |
|node| |
|
804 |
||
805 |
(node := self selectedNode) notNil ifTrue:[ |
|
806 |
( validateDoubleClickBlock isNil |
|
807 |
or:[(validateDoubleClickBlock value:node) ~~ false] |
|
808 |
) ifTrue:[ |
|
809 |
self selectedNodeExpand:(node isExpandable). |
|
810 |
super doubleClicked |
|
811 |
] |
|
812 |
] |
|
813 |
||
814 |
! |
|
815 |
||
816 |
indicatiorLineForButton:aButton atX:x y:y |
|
817 |
"returns linenumber assigned to indicator at x/y or 0 |
|
818 |
" |
|
819 |
|sensor nr x0 node| |
|
820 |
||
821 |
( enabled |
|
822 |
and:[showDirectoryIndicator |
|
823 |
and:[aButton == 1 or:[aButton == #select]]] |
|
824 |
) ifTrue:[ |
|
825 |
sensor := self sensor. |
|
826 |
||
827 |
(sensor ctrlDown or:[sensor shiftDown]) ifFalse:[ |
|
828 |
nr := self visibleLineToListLine:(self visibleLineOfY:y). |
|
829 |
||
830 |
nr notNil ifTrue:[ |
|
831 |
node := listOfNodes at:nr. |
|
832 |
x0 := self xOfFigureLevel:(node level - 1). |
|
833 |
||
834 |
(x > x0 and:[(x0 + imageWidth) > x and:[node numberOfChildren ~~ 0]]) ifTrue:[ |
|
835 |
^ nr |
|
836 |
] |
|
837 |
] |
|
838 |
] |
|
839 |
]. |
|
840 |
^ 0 |
|
756 | 841 |
! |
842 |
||
843 |
key:key select:index x:x y:y |
|
844 |
"select an entry by a keyboard action. This is treated like a doubleClick |
|
845 |
on that entry. |
|
846 |
Add on: In case that the entry is not selectable, scroll to the entry |
|
847 |
" |
|
848 |
(enabled and:[keyActionStyle notNil]) ifFalse:[ |
|
849 |
^ self |
|
850 |
]. |
|
851 |
||
852 |
(selectConditionBlock isNil or:[selectConditionBlock value:index]) ifTrue:[ |
|
853 |
super key:key select:index x:x y:y |
|
854 |
]. |
|
855 |
||
856 |
keyActionStyle == #pass ifTrue:[ |
|
857 |
^ self |
|
858 |
]. |
|
859 |
||
860 |
self gotoLine:index |
|
569 | 861 |
! ! |
862 |
||
444 | 863 |
!SelectionInTreeView methodsFor:'initialization'! |
864 |
||
685 | 865 |
create |
866 |
super create. |
|
695
3e5240577e37
dont use Image>>on: -> use Image>>onDevice:
Claus Gittinger <cg@exept.de>
parents:
685
diff
changeset
|
867 |
lineMask := lineMask onDevice:device. |
685 | 868 |
|
869 |
lineColor notNil ifTrue:[ |
|
695
3e5240577e37
dont use Image>>on: -> use Image>>onDevice:
Claus Gittinger <cg@exept.de>
parents:
685
diff
changeset
|
870 |
lineColor := lineColor onDevice:device |
685 | 871 |
] |
872 |
! |
|
873 |
||
514 | 874 |
destroy |
875 |
"remove dependencies |
|
876 |
" |
|
877 |
rootHolder notNil ifTrue:[ |
|
878 |
rootHolder removeDependent:self |
|
879 |
]. |
|
880 |
selectionHolder notNil ifTrue:[ |
|
881 |
selectionHolder removeDependent:self |
|
882 |
]. |
|
883 |
super destroy. |
|
884 |
||
885 |
||
886 |
! |
|
887 |
||
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
888 |
fetchDeviceResources |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
889 |
"initialize heavily used device resources - to avoid rendering |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
890 |
images again and again later" |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
891 |
|
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
892 |
super fetchDeviceResources. |
478 | 893 |
self refetchDeviceResources |
448
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
894 |
! |
7f9f3531660c
cache device images for fast drawing
Claus Gittinger <cg@exept.de>
parents:
446
diff
changeset
|
895 |
|
478 | 896 |
fetchImageResources |
897 |
"initialize heavily used device resources - to avoid rendering |
|
898 |
images again and again later; returns maximum extent of the images used. |
|
899 |
Could be redefined by subclass |
|
471 | 900 |
" |
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
901 |
|icon extent| |
494 | 902 |
|
903 |
imageOpened isNil ifTrue:[ |
|
569 | 904 |
imageOpened := (self class imageOpened) onDevice:device |
494 | 905 |
]. |
444 | 906 |
|
494 | 907 |
imageClosed isNil ifTrue:[ |
569 | 908 |
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
|
909 |
]. |
569 | 910 |
extent := (imageOpened extent) max:(imageClosed extent). |
494 | 911 |
|
912 |
imageItem isNil ifTrue:[ |
|
569 | 913 |
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
|
914 |
]. |
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
915 |
|
764 | 916 |
(listOfNodes size > 0 and: [(icon := listOfNodes first icon) isImage]) ifTrue: [^icon extent]. |
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
917 |
|
569 | 918 |
^ extent max:(imageItem extent) |
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
919 |
|
444 | 920 |
! |
921 |
||
480 | 922 |
getFontParameters |
546 | 923 |
"save old computed height derived from images |
924 |
" |
|
925 |
|lineHeight| |
|
926 |
||
927 |
lineHeight := fontHeight ? 0. |
|
480 | 928 |
super getFontParameters. |
569 | 929 |
labelOffsetY := fontAscent - (fontHeight - lineSpacing // 2). |
480 | 930 |
|
546 | 931 |
lineHeight > fontHeight ifTrue:[ |
932 |
fontHeight := lineHeight |
|
933 |
]. |
|
685 | 934 |
fontHeight odd ifTrue:[ |
935 |
fontHeight := fontHeight + 1 |
|
936 |
] |
|
480 | 937 |
! |
938 |
||
444 | 939 |
initialize |
471 | 940 |
"setup instance attributes |
941 |
" |
|
444 | 942 |
super initialize. |
569 | 943 |
self bitGravity:#NorthWest. |
485 | 944 |
showLines := true. |
494 | 945 |
showRoot := true. |
546 | 946 |
computeResources := true. |
485 | 947 |
showDirectoryIndicator := false. |
659 | 948 |
showDirectoryIndicatorForRoot := true. |
639 | 949 |
discardMotionEvents := false. |
685 | 950 |
lineMask := Form width:2 height:2 fromArray:#[16rAA 16r55]. |
639 | 951 |
|
659 | 952 |
textInset := 4. |
494 | 953 |
imageInset := 0. "/ set during indication enabled |
954 |
imageWidth := 8. "/ default: will change during startup |
|
514 | 955 |
self model:nil. "/ creates a default model. |
478 | 956 |
! |
957 |
||
569 | 958 |
realize |
959 |
super realize. |
|
960 |
self refetchDeviceResources. |
|
961 |
||
962 |
! |
|
963 |
||
478 | 964 |
refetchDeviceResources |
965 |
"reinitialize heavily used device resources - to avoid rendering |
|
966 |
images again and again later |
|
967 |
" |
|
551 | 968 |
|extent| |
478 | 969 |
|
569 | 970 |
(realized and:[computeResources and:[listOfNodes size ~~ 0]]) ifTrue:[ |
546 | 971 |
computeResources := false. |
972 |
extent := self fetchImageResources. |
|
494 | 973 |
|
546 | 974 |
extent y >= fontHeight ifTrue:[ |
975 |
fontHeight := 1 + extent y. |
|
494 | 976 |
]. |
685 | 977 |
fontHeight odd ifTrue:[ |
978 |
fontHeight := fontHeight + 1 |
|
979 |
]. |
|
980 |
||
546 | 981 |
imageWidth := extent x. |
982 |
self recomputeDirectoryIndicator. |
|
569 | 983 |
self computeNumberOfLinesShown. |
546 | 984 |
] |
444 | 985 |
! ! |
986 |
||
483 | 987 |
!SelectionInTreeView methodsFor:'model'! |
444 | 988 |
|
989 |
getListFromModel |
|
990 |
"if I have a model, get my list from it using the listMessage. |
|
991 |
If listMessage is nil, try aspectMessage for backward compatibilty. |
|
992 |
" |
|
483 | 993 |
super list:(self listFromModel) keepSelection:true |
994 |
! |
|
444 | 995 |
|
483 | 996 |
listFromModel |
997 |
"get list from model and return the new list. |
|
998 |
If listMessage is nil, try aspectMessage for backward compatibilty. |
|
999 |
" |
|
1000 |
|msg| |
|
444 | 1001 |
|
468 | 1002 |
widthOfWidestLine := nil. |
444 | 1003 |
|
514 | 1004 |
(msg := listMsg ? aspectMsg) notNil ifTrue:[ |
1005 |
listOfNodes := model perform:msg. |
|
1006 |
listOfNodes size ~~ 0 ifTrue:[ |
|
546 | 1007 |
self refetchDeviceResources. |
514 | 1008 |
^ listOfNodes collect:[:n|n name] |
483 | 1009 |
] |
1010 |
]. |
|
1011 |
listOfNodes := #(). |
|
1012 |
^ #() |
|
494 | 1013 |
! |
1014 |
||
1015 |
model:aModel |
|
514 | 1016 |
"check whether model is nil; than a default model is created |
1017 |
" |
|
1018 |
|model| |
|
1019 |
||
1020 |
model := aModel ? (SelectionInTree new). |
|
1021 |
model showRoot:showRoot. |
|
1022 |
super model:model. |
|
1023 |
! |
|
1024 |
||
1025 |
rootFromModel |
|
1026 |
"update hierarchical list from root model; 'rootHolder' |
|
1027 |
" |
|
1028 |
|root| |
|
1029 |
||
585 | 1030 |
root := rootHolder root. |
514 | 1031 |
|
1032 |
self root == root ifFalse:[ |
|
1033 |
self selection:nil. |
|
1034 |
self root:root. |
|
585 | 1035 |
]. |
514 | 1036 |
! |
1037 |
||
1038 |
selectionFromModel |
|
1039 |
"set the selection derived from the selectionHolder |
|
1040 |
" |
|
545 | 1041 |
|coll value sz| |
514 | 1042 |
|
1043 |
(value := selectionHolder value) isNil ifTrue:[ |
|
1044 |
^ self deselect |
|
507 | 1045 |
]. |
514 | 1046 |
|
1047 |
multipleSelectOk ifFalse:[ |
|
1048 |
self selectNode:value |
|
1049 |
] ifTrue:[ |
|
545 | 1050 |
(sz := value size) ~~ 0 ifTrue:[ |
1051 |
coll := OrderedCollection new:sz. |
|
514 | 1052 |
|
1053 |
value do:[:aNode||i| |
|
1054 |
(i := self indexOfNode:aNode) notNil ifTrue:[ |
|
1055 |
coll add:i |
|
1056 |
] |
|
1057 |
] |
|
1058 |
]. |
|
1059 |
coll size == 0 ifTrue:[self deselect] |
|
1060 |
ifFalse:[self selection:coll] |
|
1061 |
] |
|
1062 |
! |
|
1063 |
||
1064 |
selectionToModel |
|
1065 |
"write selection to selection holder |
|
1066 |
" |
|
1067 |
|newSel oldSel| |
|
1068 |
||
1069 |
oldSel := selectionHolder value. |
|
1070 |
||
1071 |
multipleSelectOk ifFalse:[ |
|
1072 |
(newSel := self selectedNode) ~~ oldSel ifTrue:[ |
|
1073 |
selectionHolder value:newSel |
|
1074 |
] |
|
1075 |
] ifTrue:[ |
|
1076 |
selection size == 0 ifTrue:[ |
|
1077 |
oldSel notNil ifTrue:[ |
|
1078 |
selectionHolder value:nil |
|
1079 |
] |
|
1080 |
] ifFalse:[ |
|
1081 |
newSel := selection collect:[:i| listOfNodes at:i]. |
|
1082 |
||
1083 |
newSel size ~~ oldSel size ifTrue:[ |
|
1084 |
selectionHolder value:newSel. |
|
1085 |
] ifFalse:[ |
|
1086 |
newSel do:[:aNode| |
|
1087 |
(oldSel includes:aNode) ifFalse:[ |
|
1088 |
^ selectionHolder value:newSel |
|
1089 |
] |
|
1090 |
] |
|
1091 |
] |
|
1092 |
] |
|
1093 |
] |
|
444 | 1094 |
! ! |
1095 |
||
490 | 1096 |
!SelectionInTreeView methodsFor:'private'! |
1097 |
||
1098 |
list:aList keepSelection:keepSelection |
|
585 | 1099 |
"setup new list; keep selection dependent on the boolean state |
1100 |
keepSelection |
|
1101 |
" |
|
490 | 1102 |
|list| |
1103 |
||
1104 |
list := aList. |
|
1105 |
||
1106 |
list size == 0 ifTrue:[ |
|
1107 |
listOfNodes := #() |
|
1108 |
] ifFalse:[ |
|
1109 |
(list first respondsTo:#hasChildren) ifTrue:[ |
|
1110 |
listOfNodes := aList. |
|
546 | 1111 |
self refetchDeviceResources. |
490 | 1112 |
list := listOfNodes collect:[:aNode| aNode name ]. |
1113 |
] |
|
1114 |
]. |
|
1115 |
super list:list keepSelection:keepSelection |
|
546 | 1116 |
! |
1117 |
||
569 | 1118 |
nodeAt:anIndex expand:doExpand |
585 | 1119 |
"expand or collapse the node at an index, anIndex dependent on the boolean state |
1120 |
of doExpand |
|
1121 |
" |
|
569 | 1122 |
|node| |
1123 |
||
1124 |
node := listOfNodes at:anIndex. |
|
1125 |
||
1126 |
node hasChildren ifTrue:[ |
|
1127 |
node isExpandable ifTrue:[ |
|
1128 |
doExpand ifFalse:[^ self]. |
|
1129 |
node expand |
|
1130 |
] ifFalse:[ |
|
1131 |
doExpand ifTrue:[^ self]. |
|
1132 |
node collapse |
|
1133 |
]. |
|
1134 |
||
1135 |
node numberOfChildren == 0 ifTrue:[ |
|
1136 |
"/ no children; redraw selected line (image might change) |
|
1137 |
self redrawLine:anIndex. |
|
1138 |
] ifFalse:[ |
|
1139 |
"/ with children; update list and redraw to end. |
|
585 | 1140 |
model removeDependent:self. |
1141 |
model recomputeList. |
|
1142 |
model addDependent:self. |
|
569 | 1143 |
list := self listFromModel. |
1144 |
self redrawFromLine:anIndex. |
|
1145 |
self contentsChanged. |
|
1146 |
] |
|
1147 |
] |
|
1148 |
||
1149 |
! |
|
1150 |
||
546 | 1151 |
recomputeDirectoryIndicator |
1152 |
"setup attributes used by directory indicator |
|
1153 |
" |
|
1154 |
|x1 x2 y| |
|
1155 |
||
1156 |
imageInset := 0. |
|
1157 |
||
1158 |
(showDirectoryIndicator and:[computeResources not]) ifFalse:[ |
|
1159 |
^ self |
|
1160 |
]. |
|
569 | 1161 |
openIndicator isNil ifTrue:[ |
1162 |
openIndicator := self imageOnDevice:(self class openIndicator) |
|
1163 |
]. |
|
1164 |
closeIndicator isNil ifTrue:[ |
|
1165 |
closeIndicator := self imageOnDevice:(self class closeIndicator) |
|
1166 |
]. |
|
546 | 1167 |
|
1168 |
x1 := (openIndicator widthOn:self) // 2. |
|
1169 |
y := openIndicator heightOn:self. |
|
1170 |
extentOpenIndicator := Point x:x1 y:(y // 2). |
|
1171 |
x2 := (closeIndicator widthOn:self) // 2. |
|
1172 |
y := closeIndicator heightOn:self. |
|
1173 |
extentCloseIndicator := Point x:x2 y:(y // 2). |
|
1174 |
||
1175 |
x2 > x1 ifTrue:[x1 := x2]. |
|
1176 |
||
1177 |
(x1 := x1 + self class minImageInset) > (imageWidth // 2) ifTrue:[ |
|
1178 |
imageInset := x1 - (imageWidth // 2). |
|
1179 |
]. |
|
1180 |
||
490 | 1181 |
! ! |
1182 |
||
468 | 1183 |
!SelectionInTreeView methodsFor:'private queries'! |
1184 |
||
1185 |
lengthOfLongestLineBetween:firstLine and:lastLine |
|
1186 |
"return the length (in characters) of the longest line in a line-range |
|
1187 |
" |
|
1188 |
|max| |
|
1189 |
||
1190 |
max := self widthOfContents:firstLine and:lastLine. |
|
1191 |
^ (max // fontWidth) + 1 |
|
1192 |
! |
|
1193 |
||
1194 |
widthOfContents |
|
1195 |
"return the width of the contents in pixels |
|
1196 |
- used for scrollbar interface" |
|
1197 |
||
1198 |
list isNil ifTrue:[^ 0]. |
|
1199 |
||
1200 |
(widthOfWidestLine isNil or:[widthOfWidestLine == 0]) ifTrue:[ |
|
1201 |
widthOfWidestLine := self widthOfContents:1 and:(self size). |
|
1202 |
]. |
|
1203 |
^ widthOfWidestLine + (leftMargin * 2) |
|
1204 |
||
1205 |
! |
|
1206 |
||
1207 |
widthOfContents:firstLine and:lastLine |
|
1208 |
"return the length (in pixels) of the longest line in a line-range |
|
1209 |
" |
|
1210 |
|max "{ Class: SmallInteger }" |
|
1211 |
thisLen "{ Class: SmallInteger }" |
|
1212 |
first "{ Class: SmallInteger }" |
|
1213 |
last "{ Class: SmallInteger }" | |
|
1214 |
||
1215 |
listOfNodes size == 0 ifTrue:[^ 0]. |
|
1216 |
||
1217 |
last := listOfNodes size. |
|
1218 |
first := firstLine. |
|
1219 |
||
1220 |
(first > last) ifTrue:[^ 0]. |
|
1221 |
||
1222 |
(lastLine < last) ifTrue:[ |
|
1223 |
last := lastLine |
|
1224 |
]. |
|
1225 |
max := 0. |
|
1226 |
||
1227 |
listOfNodes from:first to:last do:[:anItem||name| |
|
1228 |
thisLen := self xOfStringNode:anItem. |
|
1229 |
||
1230 |
(name := anItem name) notNil ifTrue:[ |
|
1231 |
thisLen := thisLen + (name widthOn:self). |
|
1232 |
]. |
|
1233 |
(thisLen > max) ifTrue:[ |
|
1234 |
max := thisLen. |
|
1235 |
] |
|
1236 |
]. |
|
1237 |
^ max + leftOffset. |
|
1238 |
! |
|
1239 |
||
1240 |
withoutRedrawAt:anIndex put:aString |
|
1241 |
"change a line without redisplay" |
|
1242 |
||
1243 |
|width| |
|
1244 |
||
1245 |
width := widthOfWidestLine. |
|
1246 |
widthOfWidestLine := nil. |
|
1247 |
||
1248 |
super withoutRedrawAt:anIndex put:aString. |
|
1249 |
||
1250 |
(widthOfWidestLine := width) notNil ifTrue:[ |
|
1251 |
width := self widthOfContents:anIndex and:anIndex. |
|
1252 |
||
1253 |
width > widthOfWidestLine ifTrue:[ |
|
1254 |
widthOfWidestLine := width |
|
1255 |
] ifFalse:[ |
|
1256 |
widthOfWidestLine := nil "/ means: unknown |
|
1257 |
] |
|
1258 |
]. |
|
1259 |
||
1260 |
||
1261 |
! ! |
|
1262 |
||
483 | 1263 |
!SelectionInTreeView methodsFor:'queries'! |
1264 |
||
1265 |
figureFor:aNode |
|
1266 |
"access figure for a node |
|
1267 |
" |
|
763
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1268 |
|icon| |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1269 |
(icon := aNode icon) notNil |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1270 |
ifTrue: |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1271 |
[ |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1272 |
icon device ~= device |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1273 |
ifTrue: |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1274 |
[ |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1275 |
icon := icon onDevice: device. |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1276 |
aNode icon: icon. |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1277 |
icon clearMaskedPixels |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1278 |
]. |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1279 |
^icon |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1280 |
]. |
dd29c58e8ea6
supports dynamic read behavior for contents, label, children, and icon of tree items
tz
parents:
760
diff
changeset
|
1281 |
|
483 | 1282 |
aNode hasChildren ifTrue:[ |
1283 |
aNode isExpandable ifTrue:[ ^ imageClosed ] |
|
1284 |
ifFalse:[ ^ imageOpened ] |
|
1285 |
]. |
|
1286 |
^ imageItem |
|
1287 |
! |
|
1288 |
||
1289 |
indexOfNode:aNode |
|
1290 |
"returns index of a node |
|
1291 |
" |
|
1292 |
^ listOfNodes findFirst:[:n| n == aNode ] |
|
1293 |
! |
|
1294 |
||
494 | 1295 |
xOfFigureLevel:aLevel |
1296 |
"origin x where to draw the icon |
|
1297 |
" |
|
1298 |
|l| |
|
1299 |
||
1300 |
showRoot ifTrue:[l := aLevel] |
|
1301 |
ifFalse:[l := aLevel - 1]. |
|
1302 |
||
659 | 1303 |
showDirectoryIndicator ifFalse:[ |
1304 |
l := l - 1 |
|
1305 |
] ifTrue:[ |
|
1306 |
showDirectoryIndicatorForRoot ifFalse:[ |
|
1307 |
l := l - 1 |
|
1308 |
] |
|
1309 |
]. |
|
494 | 1310 |
^ (l * (imageInset + imageWidth)) + imageInset - leftOffset + leftMargin |
1311 |
||
1312 |
! |
|
1313 |
||
483 | 1314 |
xOfFigureNode:aNode |
1315 |
"origin x where to draw the icon |
|
1316 |
" |
|
494 | 1317 |
^ self xOfFigureLevel:(aNode level) |
1318 |
! |
|
490 | 1319 |
|
494 | 1320 |
xOfStringLevel:aLevel |
1321 |
"origin x where to draw the text( label ) |
|
1322 |
" |
|
1323 |
^ (self xOfFigureLevel:aLevel) + imageWidth + textInset |
|
483 | 1324 |
|
1325 |
! |
|
1326 |
||
1327 |
xOfStringNode:aNode |
|
1328 |
"origin x where to draw the text( label ) |
|
1329 |
" |
|
494 | 1330 |
^ self xOfStringLevel:(aNode level) |
483 | 1331 |
|
1332 |
! ! |
|
1333 |
||
444 | 1334 |
!SelectionInTreeView methodsFor:'selection'! |
1335 |
||
494 | 1336 |
selectFromListOfNames:aListOfNames |
1337 |
"set selection from a list of names |
|
1338 |
" |
|
497 | 1339 |
|node rdwNd| |
494 | 1340 |
|
1341 |
aListOfNames size < 1 ifTrue:[ |
|
1342 |
^ self selection:nil |
|
1343 |
]. |
|
1344 |
||
1345 |
node := model root. |
|
1346 |
||
1347 |
aListOfNames do:[:el||next| |
|
1348 |
next := node detectChild:[:e|e name = el]. |
|
1349 |
||
1350 |
next notNil ifTrue:[ |
|
1351 |
node hidden ifTrue:[ |
|
1352 |
rdwNd isNil ifTrue:[ |
|
1353 |
rdwNd := node. |
|
1354 |
self selectNode:node. |
|
1355 |
]. |
|
1356 |
node expand |
|
1357 |
]. |
|
1358 |
node := next |
|
1359 |
] |
|
1360 |
]. |
|
1361 |
||
1362 |
rdwNd notNil ifTrue:[ |
|
585 | 1363 |
model removeDependent:self. |
1364 |
model recomputeList. |
|
1365 |
model addDependent:self. |
|
494 | 1366 |
list := self listFromModel. |
1367 |
self redrawFromLine:(self indexOfNode:rdwNd). |
|
1368 |
self contentsChanged. |
|
1369 |
]. |
|
1370 |
self selectNode:node. |
|
1371 |
||
1372 |
! |
|
1373 |
||
468 | 1374 |
selectNode:aNode |
1375 |
"change selection to a node |
|
1376 |
" |
|
483 | 1377 |
self selection:(self indexOfNode:aNode) |
468 | 1378 |
|
1379 |
||
1380 |
! |
|
1381 |
||
456 | 1382 |
selectedIndex |
1383 |
"get single selected index or 0 |
|
1384 |
" |
|
483 | 1385 |
selection size == 1 ifTrue:[^ selection first]. |
1386 |
selection isNumber ifTrue:[^ selection]. |
|
456 | 1387 |
^ 0 |
444 | 1388 |
! |
1389 |
||
1390 |
selectedNode |
|
1391 |
"get the single selected node or nil |
|
1392 |
" |
|
456 | 1393 |
|idx| |
1394 |
||
1395 |
(idx := self selectedIndex) ~~ 0 ifTrue:[ |
|
1396 |
^ listOfNodes at:idx |
|
444 | 1397 |
]. |
1398 |
^ nil |
|
514 | 1399 |
! |
1400 |
||
1401 |
selectionChangedFrom:oldSelection |
|
1402 |
"update selectionHolder if not nil |
|
1403 |
" |
|
1404 |
||
623
4de870640523
first change selectionHolders value,
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
1405 |
"/ first change my selectionHolders value ... |
514 | 1406 |
selectionHolder notNil ifTrue:[ |
1407 |
self selectionToModel. |
|
1408 |
]. |
|
1409 |
||
623
4de870640523
first change selectionHolders value,
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
1410 |
"/ ... then make notifications. |
4de870640523
first change selectionHolders value,
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
1411 |
super selectionChangedFrom:oldSelection. |
4de870640523
first change selectionHolders value,
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
1412 |
|
4de870640523
first change selectionHolders value,
Claus Gittinger <cg@exept.de>
parents:
589
diff
changeset
|
1413 |
|
444 | 1414 |
! ! |
1415 |
||
507 | 1416 |
!SelectionInTreeView methodsFor:'selection-actions'! |
1417 |
||
1418 |
selectedNodeAdd:something |
|
1419 |
"add a node or collection of nodes after selected node |
|
1420 |
" |
|
1421 |
|node| |
|
1422 |
||
1423 |
something notNil ifTrue:[ |
|
1424 |
(node := self selectedNode) notNil ifTrue:[ |
|
1425 |
node parent notNil ifTrue:[ |
|
1426 |
node isCollapsable ifTrue:[ |
|
1427 |
model add:something beforeIndex:1 below:node |
|
1428 |
] ifFalse:[ |
|
1429 |
model add:something after:node |
|
1430 |
] |
|
1431 |
] ifFalse:[ |
|
1432 |
model add:something beforeIndex:1 below:(self root) |
|
1433 |
] |
|
1434 |
] |
|
1435 |
] |
|
1436 |
||
1437 |
! |
|
1438 |
||
1439 |
selectedNodeBecomeChildOfNext |
|
1440 |
"become node a child of followd node |
|
1441 |
" |
|
1442 |
|idx node cprt nprt| |
|
1443 |
||
1444 |
((node := self selectedNode) isNil or:[(cprt := node parent) isNil]) ifFalse:[ |
|
1445 |
idx := cprt indexOfChild:node. |
|
1446 |
||
1447 |
idx == cprt children size ifFalse:[ |
|
1448 |
nprt := cprt childAt:(idx + 1). |
|
1449 |
||
1450 |
nprt notNil ifTrue:[ |
|
1451 |
model removeDependent:self. |
|
1452 |
model removeSelection. |
|
1453 |
selection := nil. |
|
1454 |
model collapse:nprt. |
|
1455 |
model add:node beforeIndex:1 below:nprt. |
|
1456 |
model addDependent:self. |
|
1457 |
model expand:nprt. |
|
1458 |
||
1459 |
self selectNode:node. |
|
1460 |
] |
|
1461 |
] |
|
1462 |
] |
|
1463 |
! |
|
1464 |
||
1465 |
selectedNodeBecomeSisterOfParent |
|
1466 |
"become node a sister of its current parent |
|
1467 |
" |
|
1468 |
|node cprt nprt| |
|
1469 |
||
1470 |
( (node := self selectedNode) isNil |
|
1471 |
or:[(cprt := node parent) isNil |
|
1472 |
or:[(nprt := cprt parent) isNil]] |
|
1473 |
) ifFalse:[ |
|
1474 |
model removeDependent:self. |
|
1475 |
model removeSelection. |
|
1476 |
selection := nil. |
|
1477 |
model addDependent:self. |
|
1478 |
||
1479 |
model add:node afterIndex:(nprt indexOfChild:cprt) below:nprt. |
|
1480 |
self selectNode:node. |
|
1481 |
] |
|
1482 |
||
1483 |
! |
|
1484 |
||
1485 |
selectedNodeChangeSequenceOrder:anOffset |
|
1486 |
"move child 'anOffset' forward or backward in list of children |
|
1487 |
" |
|
1488 |
|idx node size parent| |
|
1489 |
||
1490 |
( (node := self selectedNode) notNil |
|
1491 |
and:[(parent := node parent) notNil |
|
1492 |
and:[(size := parent children size) > 1]] |
|
1493 |
) ifTrue:[ |
|
1494 |
idx := parent indexOfChild:node. |
|
1495 |
||
1496 |
model removeDependent:self. |
|
1497 |
model removeSelection. |
|
1498 |
selection := nil. |
|
1499 |
model addDependent:self. |
|
1500 |
||
1501 |
(idx := idx + anOffset) < 1 ifTrue:[ |
|
1502 |
idx := size |
|
1503 |
] ifFalse:[ |
|
1504 |
idx > size ifTrue:[idx := 1] |
|
1505 |
]. |
|
1506 |
model add:node beforeIndex:idx below:parent. |
|
1507 |
self selectNode:node. |
|
1508 |
] |
|
1509 |
! |
|
1510 |
||
1511 |
selectedNodeExpand:doExpand |
|
1512 |
"collapse or expand selected node |
|
1513 |
" |
|
1514 |
|node index| |
|
1515 |
||
1516 |
(index := self selectedIndex) ~~ 0 ifTrue:[ |
|
1517 |
node := listOfNodes at:index. |
|
1518 |
||
1519 |
node hasChildren ifTrue:[ |
|
1520 |
node isExpandable ifTrue:[ |
|
1521 |
doExpand ifFalse:[^ self]. |
|
1522 |
node expand |
|
1523 |
] ifFalse:[ |
|
1524 |
doExpand ifTrue:[^ self]. |
|
1525 |
node collapse |
|
1526 |
]. |
|
1527 |
||
1528 |
node numberOfChildren == 0 ifTrue:[ |
|
1529 |
"/ no children; redraw selected line (image might change) |
|
1530 |
self redrawLine:index. |
|
1531 |
] ifFalse:[ |
|
1532 |
"/ with children; update list and redraw to end. |
|
585 | 1533 |
model removeDependent:self. |
1534 |
model recomputeList. |
|
1535 |
model addDependent:self. |
|
507 | 1536 |
list := self listFromModel. |
1537 |
self redrawFromLine:index. |
|
1538 |
self contentsChanged. |
|
1539 |
] |
|
1540 |
] |
|
1541 |
]. |
|
1542 |
! |
|
1543 |
||
1544 |
selectedNodesRemove |
|
1545 |
"remove selected nodes |
|
1546 |
" |
|
1547 |
model removeSelection. |
|
1548 |
self selection:nil. |
|
1549 |
||
1550 |
! ! |
|
1551 |
||
444 | 1552 |
!SelectionInTreeView class methodsFor:'documentation'! |
1553 |
||
1554 |
version |
|
769 | 1555 |
^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.40 1998-02-19 09:35:34 ca Exp $' |
444 | 1556 |
! ! |