author | ca |
Fri, 31 Oct 1997 11:23:28 +0100 | |
changeset 372 | 042713cfe1ed |
parent 368 | 9e588f397bc9 |
child 375 | b43507f222ce |
permissions | -rw-r--r-- |
156 | 1 |
" |
2 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
368 | 13 |
|
60 | 14 |
ApplicationModel subclass:#UIPainter |
287 | 15 |
instanceVariableNames:'treeView selectionPanel tabSelection specClass specSelector |
297 | 16 |
specSuperclass aspects layoutCanvas helpCanvas specCanvas |
17 |
transcript' |
|
222 | 18 |
classVariableNames:'IconStepUp IconStepOut IconStepIn IconStepDown' |
60 | 19 |
poolDictionaries:'' |
20 |
category:'Interface-UIPainter' |
|
21 |
! |
|
22 |
||
222 | 23 |
SelectionInTreeView subclass:#TreeView |
24 |
instanceVariableNames:'lastDrawnMaster cvsEventsDisabled imageMasterParent |
|
311 | 25 |
imageEmptyParent imageMasterChild windowSpec' |
282 | 26 |
classVariableNames:'ImageMasterParent ImageMasterChild ImageEmptyParent' |
222 | 27 |
poolDictionaries:'' |
28 |
privateIn:UIPainter |
|
29 |
! |
|
30 |
||
60 | 31 |
!UIPainter class methodsFor:'documentation'! |
32 |
||
156 | 33 |
copyright |
34 |
" |
|
35 |
COPYRIGHT (c) 1995 by eXept Software AG |
|
36 |
All Rights Reserved |
|
37 |
||
38 |
This software is furnished under a license and may be used |
|
39 |
only in accordance with the terms of that license and with the |
|
40 |
inclusion of the above copyright notice. This software may not |
|
41 |
be provided or otherwise made available to, or used by, any |
|
42 |
other person. No title to or ownership of the software is |
|
43 |
hereby transferred. |
|
44 |
" |
|
45 |
||
46 |
! |
|
47 |
||
60 | 48 |
documentation |
49 |
" |
|
127 | 50 |
GUI-Builder: |
51 |
this class allows the user to build its own applications providing a graphical |
|
52 |
user interface to buildin components and to define the behavior of the components |
|
53 |
during runtime. The resulting specifications can be installed as methods on |
|
54 |
classes, typically subclasses of an ApplicationModel. These specifications |
|
55 |
are used by the UIBuilder to generate the application window and its component |
|
56 |
structues when open the application. |
|
60 | 57 |
|
58 |
[start with:] |
|
59 |
UIPainter open |
|
127 | 60 |
|
156 | 61 |
[author:] |
183 | 62 |
Claus Gittinger |
156 | 63 |
Claus Atzkern |
64 |
||
127 | 65 |
[see also:] |
66 |
UIBuilder |
|
67 |
ApplicationModel |
|
68 |
UISpecification |
|
60 | 69 |
" |
109 | 70 |
|
71 |
! ! |
|
72 |
||
73 |
!UIPainter class methodsFor:'instance creation'! |
|
74 |
||
195
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
75 |
openOnClass:aClass andSelector:aSelector |
282 | 76 |
"open up an interface builder, fetching a spec from aClass |
77 |
via some selector |
|
78 |
" |
|
195
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
79 |
^ self new openOnClass:aClass andSelector:aSelector |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
80 |
! |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
81 |
|
109 | 82 |
painter:aBuilderView |
282 | 83 |
"set the painter |
84 |
" |
|
109 | 85 |
|application| |
86 |
||
87 |
application := self new. |
|
88 |
application painter:aBuilderView. |
|
89 |
^ application open |
|
60 | 90 |
! ! |
91 |
||
87 | 92 |
!UIPainter class methodsFor:'ST-80 queries'! |
93 |
||
94 |
preferenceFor:aSymbol |
|
282 | 95 |
"ST-80 compatible; always returns false |
96 |
" |
|
87 | 97 |
^ false |
109 | 98 |
|
99 |
||
100 |
! ! |
|
101 |
||
193 | 102 |
!UIPainter class methodsFor:'help specs'! |
103 |
||
104 |
helpSpec |
|
105 |
"return a dictionary filled with helpKey -> helptext associations. |
|
295 | 106 |
These are used by the activeHelp tool." |
107 |
||
193 | 108 |
" |
295 | 109 |
UIHelpTool openOnClass:UIPainter |
110 |
" |
|
111 |
||
358 | 112 |
<resource: #help> |
113 |
||
193 | 114 |
^ super helpSpec addPairsFrom:#( |
115 |
||
287 | 116 |
#moveSelectionLeft |
117 |
'move selected widgets left while pressing the button' |
|
194 | 118 |
|
119 |
#setToDefaultWidth |
|
282 | 120 |
'set selected widgets to their default width' |
194 | 121 |
|
122 |
#pasteBuffer |
|
282 | 123 |
'paste widgets at current mouse position' |
194 | 124 |
|
295 | 125 |
#moveSelectionUp |
126 |
'move selected widgets up while pressing the button' |
|
127 |
||
282 | 128 |
#galleryShown |
129 |
'show or hide gallery view' |
|
130 |
||
131 |
#moveSelectionDown |
|
132 |
'move selected widgets down while pressing the button' |
|
133 |
||
287 | 134 |
#spreadSelectionVer |
135 |
'vertical spacing between selected widgets is made the same' |
|
136 |
||
282 | 137 |
#menuChangeHierarchy |
138 |
'change hierarchy of the selected widget' |
|
139 |
||
287 | 140 |
#copyExtent |
141 |
'copy extent of the selected widget' |
|
142 |
||
143 |
#moveSelectionRight |
|
144 |
'move selected widgets right while pressing the button' |
|
145 |
||
146 |
#cancel |
|
147 |
'reread specification and layout' |
|
148 |
||
149 |
#pasteWithLayout |
|
150 |
'paste widgets without changing their layouts' |
|
151 |
||
152 |
#alignSelectionRight |
|
153 |
'align selected widgets to the right edge of the dominant widget' |
|
154 |
||
155 |
#alignSelectionLeftAndRight |
|
156 |
'align selected widgets to the right and left edge of the dominant widget' |
|
157 |
||
158 |
#pasteWidth |
|
159 |
'change width of all selected widgets to the last copied extent width' |
|
160 |
||
161 |
#alignSelectionTopAndBottom |
|
162 |
'align selected widgets to the top and bottom edge of the dominant widget' |
|
163 |
||
164 |
#copyLayout |
|
165 |
'copy layout of the selected widget' |
|
166 |
||
167 |
#painterShown |
|
168 |
'show or hide painter view' |
|
169 |
||
170 |
#pasteExtent |
|
171 |
'change extent of all selected widgets to the last copied extent' |
|
172 |
||
173 |
#pasteHeight |
|
174 |
'change height of all selected widgets to the last copied extent height' |
|
175 |
||
176 |
#accept |
|
177 |
'write back changes' |
|
178 |
||
179 |
#centerSelectionVer |
|
180 |
'center vertical horizontal in contained view' |
|
181 |
||
182 |
#centerSelectionHor |
|
183 |
'center widgets horizontal to their top widget' |
|
184 |
||
282 | 185 |
#menuAlignment |
186 |
'provides a set of alignment operation on the current selected widgets' |
|
187 |
||
287 | 188 |
#alignSelectionCenterVer |
189 |
'align selected widgets horizontal to the center of the dominant widget' |
|
190 |
||
191 |
#pasteLayout |
|
192 |
'change layout of all selected widgets to the last copied layout' |
|
193 |
||
194 |
#alignSelectionLeft |
|
195 |
'align selected widgets to the left edge of the dominant widget' |
|
196 |
||
197 |
#spreadSelectionHor |
|
198 |
'horizontal spacing between selected widgets is made the same' |
|
199 |
||
200 |
#alignSelectionBottom |
|
201 |
'align selected widgets to the bottom edge of the dominant widget' |
|
202 |
||
203 |
#setToDefaultExtent |
|
204 |
'set selected widgets to their default extent' |
|
205 |
||
206 |
#alignSelectionCenterHor |
|
207 |
'align selected widgets vertical to the center of the dominant widget' |
|
208 |
||
209 |
#alignSelectionTop |
|
210 |
'align selected widgets to the top edge of the dominant widget' |
|
211 |
||
212 |
#setToDefaultHeight |
|
213 |
'set selected widgets to their default height' |
|
194 | 214 |
|
193 | 215 |
) |
358 | 216 |
|
217 |
"Modified: / 29.10.1997 / 03:19:58 / cg" |
|
193 | 218 |
! ! |
219 |
||
297 | 220 |
!UIPainter class methodsFor:'helpers'! |
221 |
||
368 | 222 |
convertString:aString maxLineSize:maxCharactersPerLine skipLineFeed:skipLineFeed |
297 | 223 |
"converts a string to a string collection with maximum characters |
224 |
per line |
|
225 |
" |
|
226 |
|stream |
|
227 |
max "{ Class:SmallInteger }" |
|
228 |
size "{ Class:SmallInteger }" |
|
229 |
start "{ Class:SmallInteger }" |
|
230 |
stop "{ Class:SmallInteger }" |
|
231 |
cpySz "{ Class:SmallInteger }" |
|
232 |
lnSz "{ Class:SmallInteger }"| |
|
233 |
||
234 |
maxCharactersPerLine < 20 ifFalse:[max := maxCharactersPerLine - 1] |
|
235 |
ifTrue:[max := 20]. |
|
236 |
||
237 |
(size := aString size) <= max ifTrue:[ |
|
238 |
^ aString |
|
239 |
]. |
|
240 |
start := 1. |
|
241 |
lnSz := 0. |
|
242 |
stream := (String new:size) writeStream. |
|
243 |
||
244 |
[start <= size] whileTrue:[ |
|
245 |
(start := aString indexOfNonSeparatorStartingAt:start) == 0 ifTrue:[ |
|
246 |
^ stream contents |
|
247 |
]. |
|
368 | 248 |
(aString at:start) == $\ ifTrue:[ |
249 |
skipLineFeed ifFalse:[ |
|
250 |
stream nextPut:$\ |
|
251 |
]. |
|
252 |
start := start + 1. |
|
253 |
stream cr. |
|
254 |
start := start + 1. |
|
255 |
lnSz := 0. |
|
256 |
] ifFalse:[ |
|
257 |
(stop := aString indexOfSeparatorStartingAt:start) == 0 ifTrue:[ |
|
258 |
stop := size + 1 |
|
259 |
]. |
|
260 |
(aString at:(stop - 1)) == $\ ifTrue:[ |
|
261 |
stop := stop - 1 |
|
262 |
]. |
|
263 |
cpySz := stop - start. |
|
264 |
||
265 |
lnSz == 0 ifFalse:[ |
|
266 |
(lnSz := lnSz + cpySz) >= max ifTrue:[stream cr. lnSz := cpySz ] |
|
267 |
ifFalse:[stream space. lnSz := lnSz + 1] |
|
268 |
] ifTrue:[ |
|
269 |
lnSz := cpySz |
|
270 |
]. |
|
271 |
stream nextPutAll:aString startingAt:start to:(stop - 1). |
|
272 |
start := stop. |
|
273 |
] |
|
297 | 274 |
]. |
275 |
^ stream contents |
|
276 |
! ! |
|
277 |
||
118 | 278 |
!UIPainter class methodsFor:'icons'! |
279 |
||
280 |
iconAlignB |
|
282 | 281 |
"returns image assigned to align bottom |
282 |
" |
|
358 | 283 |
|
284 |
<resource: #fileImage> |
|
285 |
||
118 | 286 |
^ Image fromFile:'b_alignB.xbm' |
287 |
||
358 | 288 |
"Modified: / 29.10.1997 / 03:18:16 / cg" |
118 | 289 |
! |
290 |
||
291 |
iconAlignCenterH |
|
282 | 292 |
"returns image assigned to center horizontal |
293 |
" |
|
358 | 294 |
|
295 |
<resource: #fileImage> |
|
296 |
||
118 | 297 |
^ Image fromFile:'b_alignCH.xbm' |
298 |
||
358 | 299 |
"Modified: / 29.10.1997 / 03:18:34 / cg" |
118 | 300 |
! |
301 |
||
302 |
iconAlignCenterV |
|
282 | 303 |
"returns image assigned to center vertical |
304 |
" |
|
358 | 305 |
|
306 |
<resource: #fileImage> |
|
307 |
||
118 | 308 |
^ Image fromFile:'b_alignCV.xbm' |
309 |
||
358 | 310 |
"Modified: / 29.10.1997 / 03:18:39 / cg" |
118 | 311 |
! |
312 |
||
313 |
iconAlignL |
|
282 | 314 |
"returns image assigned to align left |
315 |
" |
|
358 | 316 |
|
317 |
<resource: #fileImage> |
|
318 |
||
118 | 319 |
^ Image fromFile:'b_alignL.xbm' |
358 | 320 |
|
321 |
"Modified: / 29.10.1997 / 03:18:43 / cg" |
|
118 | 322 |
! |
323 |
||
324 |
iconAlignLR |
|
282 | 325 |
"returns image assigned to align left and right |
326 |
" |
|
358 | 327 |
|
328 |
<resource: #fileImage> |
|
329 |
||
118 | 330 |
^ Image fromFile:'b_alignLR.xbm' |
331 |
||
358 | 332 |
"Modified: / 29.10.1997 / 03:18:48 / cg" |
118 | 333 |
! |
334 |
||
335 |
iconAlignR |
|
282 | 336 |
"returns image assigned to align right |
337 |
" |
|
358 | 338 |
|
339 |
<resource: #fileImage> |
|
340 |
||
118 | 341 |
^ Image fromFile:'b_alignR.xbm' |
342 |
||
358 | 343 |
"Modified: / 29.10.1997 / 03:18:51 / cg" |
118 | 344 |
! |
345 |
||
346 |
iconAlignT |
|
282 | 347 |
"returns image assigned to align top |
348 |
" |
|
358 | 349 |
|
350 |
<resource: #fileImage> |
|
351 |
||
118 | 352 |
^ Image fromFile:'b_alignT.xbm' |
353 |
||
358 | 354 |
"Modified: / 29.10.1997 / 03:18:56 / cg" |
118 | 355 |
! |
356 |
||
357 |
iconAlignTB |
|
282 | 358 |
"returns image assigned to align top and bottom |
359 |
" |
|
358 | 360 |
|
361 |
<resource: #fileImage> |
|
362 |
||
118 | 363 |
^ Image fromFile:'b_alignTB.xbm' |
364 |
||
358 | 365 |
"Modified: / 29.10.1997 / 03:19:01 / cg" |
222 | 366 |
! |
367 |
||
345 | 368 |
iconInstall |
358 | 369 |
|
370 |
<resource: #fileImage> |
|
371 |
||
347 | 372 |
^ Image fromFile:'bitmaps/xpmBitmaps/misc_tools/SaveButton.xpm' |
373 |
||
358 | 374 |
"Modified: / 29.10.1997 / 03:19:06 / cg" |
345 | 375 |
! |
376 |
||
222 | 377 |
iconStepDown |
282 | 378 |
"returns image assigned to step down (change hierarchy). |
379 |
" |
|
358 | 380 |
|
381 |
<resource: #fileImage> |
|
382 |
||
222 | 383 |
IconStepDown isNil ifTrue:[ |
230 | 384 |
IconStepDown := ((Image fromFile:'stepOver.xpm') rotated:90) flipHorizontal |
222 | 385 |
]. |
386 |
^ IconStepDown |
|
387 |
||
230 | 388 |
" |
389 |
IconStepDown := nil |
|
390 |
" |
|
391 |
||
358 | 392 |
"Modified: / 29.10.1997 / 03:19:14 / cg" |
222 | 393 |
! |
394 |
||
395 |
iconStepIn |
|
282 | 396 |
"returns image assigned to step in (change hierarchy). |
397 |
" |
|
358 | 398 |
|
399 |
<resource: #fileImage> |
|
400 |
||
222 | 401 |
IconStepIn isNil ifTrue:[ |
402 |
IconStepIn := ((Image fromFile:'stepIn.xpm') rotated:90) flipHorizontal |
|
403 |
]. |
|
404 |
^ IconStepIn |
|
405 |
||
358 | 406 |
"Modified: / 29.10.1997 / 03:19:19 / cg" |
222 | 407 |
! |
408 |
||
409 |
iconStepOut |
|
282 | 410 |
"returns image assigned to step out (change hierarchy). |
411 |
" |
|
358 | 412 |
|
413 |
<resource: #fileImage> |
|
414 |
||
222 | 415 |
IconStepOut isNil ifTrue:[ |
416 |
IconStepOut := ((Image fromFile:'stepOut.xpm') rotated:90) flipHorizontal |
|
417 |
]. |
|
418 |
^ IconStepOut |
|
358 | 419 |
|
420 |
"Modified: / 29.10.1997 / 03:19:25 / cg" |
|
222 | 421 |
! |
422 |
||
423 |
iconStepUp |
|
282 | 424 |
"returns image assigned to step up (change hierarchy). |
425 |
" |
|
358 | 426 |
|
427 |
<resource: #fileImage> |
|
428 |
||
222 | 429 |
IconStepUp isNil ifTrue:[ |
430 |
IconStepUp := ((Image fromFile:'stepOver.xpm') rotated:90) flipHorizontal flipVertical |
|
431 |
]. |
|
432 |
^ IconStepUp |
|
433 |
||
230 | 434 |
" |
435 |
IconStepUp := nil |
|
436 |
" |
|
358 | 437 |
|
438 |
"Modified: / 29.10.1997 / 03:19:29 / cg" |
|
118 | 439 |
! ! |
440 |
||
60 | 441 |
!UIPainter class methodsFor:'interface specs'! |
442 |
||
366 | 443 |
gridParametersSpec |
444 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
445 |
||
446 |
"do not manually edit this - the painter/builder may not be able to |
|
447 |
handle the specification if its corrupted." |
|
448 |
||
449 |
" |
|
450 |
UIPainter new openOnClass:UIPainter andSelector:#gridParametersSpec |
|
451 |
UIPainter new openInterface:#gridParametersSpec |
|
452 |
" |
|
453 |
"UIPainter open" |
|
454 |
||
455 |
<resource: #canvas> |
|
456 |
||
457 |
^ |
|
458 |
||
459 |
#(#FullSpec |
|
460 |
#'window:' |
|
461 |
#(#WindowSpec |
|
462 |
#'name:' 'Grid Parameters:' |
|
463 |
#'layout:' #(#LayoutFrame 219 0 193 0 484 0 366 0) |
|
464 |
#'label:' 'Grid Parameters:' |
|
465 |
#'min:' #(#Point 10 10) |
|
466 |
#'max:' #(#Point 1280 1024) |
|
467 |
#'bounds:' #(#Rectangle 219 193 485 367) |
|
468 |
) |
|
469 |
#'component:' |
|
470 |
#(#SpecCollection |
|
471 |
#'collection:' |
|
472 |
#( |
|
473 |
#(#LabelSpec |
|
474 |
#'name:' 'gridParameters' |
|
475 |
#'layout:' #(#LayoutOrigin 0 0 0 0) |
|
476 |
#'label:' 'Grid Parameters:' |
|
477 |
#'adjust:' #left |
|
478 |
#'resizeForLabel:' true |
|
479 |
) |
|
480 |
#(#CheckBoxSpec |
|
481 |
#'name:' 'show' |
|
482 |
#'layout:' #(#Point 30 31) |
|
483 |
#'model:' #showGrid |
|
484 |
#'label:' 'show grid' |
|
485 |
) |
|
486 |
#(#CheckBoxSpec |
|
487 |
#'name:' 'align' |
|
488 |
#'layout:' #(#Point 30 57) |
|
489 |
#'model:' #alignToGrid |
|
490 |
#'label:' 'align to grid' |
|
491 |
) |
|
492 |
#(#LabelSpec |
|
493 |
#'name:' 'hrzLabel' |
|
494 |
#'layout:' #(#Point 90 94) |
|
495 |
#'label:' 'pixels horizontal' |
|
496 |
#'resizeForLabel:' true |
|
497 |
) |
|
498 |
#(#InputFieldSpec |
|
499 |
#'name:' 'hrzField' |
|
500 |
#'layout:' #(#LayoutFrame 33 0 91 0 86 0 113 0) |
|
501 |
#'model:' #hspace |
|
502 |
#'type:' #numberOrNil |
|
503 |
) |
|
504 |
#(#LabelSpec |
|
505 |
#'name:' 'vrtLabel' |
|
506 |
#'layout:' #(#Point 90 118) |
|
507 |
#'label:' 'pixels vertical' |
|
508 |
#'resizeForLabel:' true |
|
509 |
) |
|
510 |
#(#InputFieldSpec |
|
511 |
#'name:' 'vrtField' |
|
512 |
#'layout:' #(#LayoutFrame 33 0 115 0 86 0 137 0) |
|
513 |
#'model:' #vspace |
|
514 |
#'type:' #numberOrNil |
|
515 |
) |
|
516 |
#(#HorizontalPanelViewSpec |
|
517 |
#'name:' 'horizontalPanelView1' |
|
518 |
#'layout:' #(#LayoutFrame 0 0.0 -30 1.0 0 1.0 0 1.0) |
|
519 |
#'component:' |
|
520 |
#(#SpecCollection |
|
521 |
#'collection:' |
|
522 |
#( |
|
523 |
#(#ActionButtonSpec |
|
524 |
#'name:' 'cancel' |
|
525 |
#'label:' 'cancel' |
|
526 |
#'model:' #cancel |
|
527 |
#'extent:' #(#Point 128 24) |
|
528 |
) |
|
529 |
#(#ActionButtonSpec |
|
530 |
#'name:' 'accept' |
|
531 |
#'label:' 'accept' |
|
532 |
#'model:' #accept |
|
533 |
#'extent:' #(#Point 129 24) |
|
534 |
) |
|
535 |
) |
|
536 |
) |
|
537 |
#'horizontalLayout:' #fitSpace |
|
538 |
#'verticalLayout:' #fitSpace |
|
539 |
#'horizontalSpace:' 3 |
|
540 |
#'verticalSpace:' 3 |
|
541 |
) |
|
542 |
) |
|
543 |
) |
|
544 |
) |
|
545 |
||
546 |
||
547 |
! |
|
548 |
||
222 | 549 |
nameAndSelectorSpec |
550 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
551 |
||
552 |
"do not manually edit this - the painter/builder may not be able to |
|
553 |
handle the specification if its corrupted." |
|
554 |
||
555 |
" |
|
556 |
UIPainter new openOnClass:UIPainter andSelector:#nameAndSelectorSpec |
|
557 |
UIPainter new openInterface:#nameAndSelectorSpec |
|
558 |
" |
|
559 |
||
560 |
<resource: #canvas> |
|
561 |
||
562 |
^ |
|
563 |
||
564 |
#(#FullSpec |
|
565 |
#'window:' |
|
566 |
#(#WindowSpec |
|
287 | 567 |
#'name:' 'NameAndSelectorSpec' |
222 | 568 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
569 |
#'label:' 'Painter' |
|
570 |
#'bounds:' #(#Rectangle 0 0 391 170) |
|
571 |
) |
|
572 |
#'component:' |
|
573 |
#(#SpecCollection |
|
574 |
#'collection:' |
|
575 |
#( |
|
576 |
#(#LabelSpec |
|
577 |
#'name:' 'classLabel' |
|
265 | 578 |
#'layout:' #(#AlignmentOrigin 50 0.11 51 0 1 0.5) |
222 | 579 |
#'label:' 'class:' |
580 |
#'adjust:' #right |
|
581 |
#'resizeForLabel:' true |
|
582 |
) |
|
583 |
#(#LabelSpec |
|
584 |
#'name:' 'superClassLabel' |
|
265 | 585 |
#'layout:' #(#AlignmentOrigin 50 0.11 77 0 1 0.5) |
222 | 586 |
#'label:' 'superclass:' |
587 |
#'adjust:' #right |
|
588 |
#'resizeForLabel:' true |
|
589 |
) |
|
590 |
#(#LabelSpec |
|
591 |
#'name:' 'selectorLabel' |
|
265 | 592 |
#'layout:' #(#AlignmentOrigin 50 0.11 105 0 1 0.5) |
222 | 593 |
#'label:' 'selector:' |
594 |
#'adjust:' #right |
|
595 |
#'resizeForLabel:' true |
|
596 |
) |
|
597 |
#(#InputFieldSpec |
|
598 |
#'name:' 'methodNameField' |
|
265 | 599 |
#'layout:' #(#LayoutFrame 51 0.11 95 0 -2 1.0 117 0) |
222 | 600 |
#'tabable:' true |
601 |
#'model:' #methodNameChannel |
|
602 |
) |
|
603 |
#(#LabelSpec |
|
604 |
#'name:' 'boxLabel' |
|
265 | 605 |
#'layout:' #(#Point 2 10) |
222 | 606 |
#'label:' 'class & selector for code:' |
607 |
#'adjust:' #left |
|
608 |
#'resizeForLabel:' true |
|
609 |
) |
|
610 |
#(#InputFieldSpec |
|
611 |
#'name:' 'classNameField' |
|
265 | 612 |
#'layout:' #(#LayoutFrame 51 0.11 39 0 -2 1.0 61 0) |
222 | 613 |
#'tabable:' true |
614 |
#'model:' #classNameChannel |
|
615 |
) |
|
616 |
#(#ComboBoxSpec |
|
617 |
#'name:' 'comboBox1' |
|
265 | 618 |
#'layout:' #(#LayoutFrame 51 0.11 67 0 0 1.0 89 0) |
222 | 619 |
#'tabable:' true |
620 |
#'model:' #superclassNameChannel |
|
621 |
#'comboList:' #superclassNameDefaults |
|
622 |
) |
|
623 |
#(#HorizontalPanelViewSpec |
|
624 |
#'name:' 'commitPanel' |
|
265 | 625 |
#'layout:' #(#LayoutFrame 0 0.0 -26 1.0 0 1.0 -2 1.0) |
222 | 626 |
#'component:' |
627 |
#(#SpecCollection |
|
628 |
#'collection:' |
|
629 |
#( |
|
630 |
#(#ActionButtonSpec |
|
631 |
#'name:' 'button1' |
|
632 |
#'label:' 'cancel' |
|
633 |
#'tabable:' true |
|
634 |
#'model:' #cancel |
|
265 | 635 |
#'extent:' #(#Point 190 24) |
222 | 636 |
) |
637 |
#(#ActionButtonSpec |
|
638 |
#'name:' 'button2' |
|
639 |
#'label:' 'ok' |
|
640 |
#'tabable:' true |
|
641 |
#'isDefault:' true |
|
642 |
#'model:' #accept |
|
265 | 643 |
#'extent:' #(#Point 190 22) |
222 | 644 |
) |
645 |
) |
|
646 |
) |
|
647 |
#'horizontalLayout:' #fitSpace |
|
648 |
#'verticalLayout:' #fit |
|
649 |
#'horizontalSpace:' 3 |
|
650 |
#'verticalSpace:' 3 |
|
651 |
) |
|
652 |
) |
|
653 |
) |
|
654 |
) |
|
655 |
||
265 | 656 |
"Modified: 28.7.1997 / 16:49:49 / cg" |
222 | 657 |
! |
658 |
||
659 |
windowSpec |
|
660 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
661 |
||
662 |
"do not manually edit this - the painter/builder may not be able to |
|
663 |
handle the specification if its corrupted." |
|
664 |
||
665 |
" |
|
666 |
UIPainter new openOnClass:UIPainter andSelector:#windowSpec |
|
667 |
UIPainter new openInterface:#windowSpec |
|
668 |
" |
|
669 |
"UIPainter open" |
|
670 |
||
671 |
<resource: #canvas> |
|
672 |
||
673 |
^ |
|
674 |
||
675 |
#(#FullSpec |
|
676 |
#'window:' |
|
677 |
#(#WindowSpec |
|
282 | 678 |
#'name:' 'Tree-View' |
345 | 679 |
#'layout:' #(#LayoutFrame 216 0 173 0 729 0 633 0) |
222 | 680 |
#'label:' 'Tree-View' |
282 | 681 |
#'min:' #(#Point 10 10) |
682 |
#'max:' #(#Point 1160 870) |
|
345 | 683 |
#'bounds:' #(#Rectangle 216 173 730 634) |
222 | 684 |
) |
685 |
#'component:' |
|
686 |
#(#SpecCollection |
|
687 |
#'collection:' |
|
688 |
#( |
|
689 |
#(#MenuPanelSpec |
|
690 |
#'name:' 'menuPullDown' |
|
691 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 25 0) |
|
692 |
#'tabable:' true |
|
693 |
#'menu:' #menuPullDown |
|
694 |
) |
|
695 |
#(#HorizontalPanelViewSpec |
|
696 |
#'name:' 'menuContainer' |
|
697 |
#'layout:' #(#LayoutFrame 0 0.0 26 0 0 1.0 58 0) |
|
698 |
#'component:' |
|
699 |
#(#SpecCollection |
|
700 |
#'collection:' |
|
701 |
#( |
|
702 |
#(#MenuPanelSpec |
|
282 | 703 |
#'name:' 'menuChangeHierarchy' |
704 |
#'activeHelpKey:' #menuChangeHierarchy |
|
705 |
#'enableChannel:' #hasOneSelectionOtherThanCanvas |
|
706 |
#'menu:' #menuChangeHierarchy |
|
222 | 707 |
#'showSeparatingLines:' true |
345 | 708 |
#'extent:' #(#Point 103 32) |
222 | 709 |
) |
710 |
#(#MenuPanelSpec |
|
711 |
#'name:' 'menuAlignment' |
|
282 | 712 |
#'activeHelpKey:' #menuAlignment |
713 |
#'enableChannel:' #canMoveOrAlignSelection |
|
222 | 714 |
#'tabable:' true |
715 |
#'menu:' #menuAlignment |
|
716 |
#'showSeparatingLines:' true |
|
717 |
#'extent:' #(#Point 233 32) |
|
718 |
) |
|
719 |
#(#HorizontalPanelViewSpec |
|
720 |
#'name:' 'panelViewButtons' |
|
721 |
#'component:' |
|
722 |
#(#SpecCollection |
|
723 |
#'collection:' |
|
724 |
#( |
|
725 |
#(#ArrowButtonSpec |
|
726 |
#'name:' 'moveLeft' |
|
282 | 727 |
#'activeHelpKey:' #moveSelectionLeft |
222 | 728 |
#'tabable:' true |
729 |
#'model:' #moveSelectionLeft |
|
730 |
#'isTriggerOnDown:' true |
|
282 | 731 |
#'enableChannel:' #canMoveOrAlignSelection |
222 | 732 |
#'direction:' #left |
282 | 733 |
#'extent:' #(#Point 22 24) |
222 | 734 |
) |
735 |
#(#ArrowButtonSpec |
|
736 |
#'name:' 'moveRight' |
|
282 | 737 |
#'activeHelpKey:' #moveSelectionRight |
222 | 738 |
#'model:' #moveSelectionRight |
739 |
#'isTriggerOnDown:' true |
|
282 | 740 |
#'enableChannel:' #canMoveOrAlignSelection |
222 | 741 |
#'direction:' #right |
282 | 742 |
#'extent:' #(#Point 22 24) |
222 | 743 |
) |
744 |
#(#ArrowButtonSpec |
|
745 |
#'name:' 'moveDown' |
|
282 | 746 |
#'activeHelpKey:' #moveSelectionDown |
222 | 747 |
#'model:' #moveSelectionDown |
748 |
#'isTriggerOnDown:' true |
|
282 | 749 |
#'enableChannel:' #canMoveOrAlignSelection |
222 | 750 |
#'direction:' #down |
282 | 751 |
#'extent:' #(#Point 22 24) |
222 | 752 |
) |
753 |
#(#ArrowButtonSpec |
|
754 |
#'name:' 'moveUp' |
|
282 | 755 |
#'activeHelpKey:' #moveSelectionUp |
222 | 756 |
#'model:' #moveSelectionUp |
757 |
#'isTriggerOnDown:' true |
|
282 | 758 |
#'enableChannel:' #canMoveOrAlignSelection |
222 | 759 |
#'direction:' #up |
760 |
#'extent:' #(#Point 22 24) |
|
761 |
) |
|
762 |
) |
|
763 |
) |
|
764 |
#'level:' 1 |
|
765 |
#'horizontalLayout:' #spreadSpace |
|
766 |
#'verticalLayout:' #fitSpace |
|
767 |
#'horizontalSpace:' 4 |
|
768 |
#'verticalSpace:' 4 |
|
769 |
#'extent:' #(#Point 125 32) |
|
770 |
) |
|
771 |
) |
|
772 |
) |
|
773 |
#'horizontalLayout:' #spread |
|
774 |
#'verticalLayout:' #fit |
|
775 |
#'horizontalSpace:' 3 |
|
776 |
#'verticalSpace:' 3 |
|
777 |
) |
|
297 | 778 |
#(#VariableVerticalPanelSpec |
779 |
#'name:' 'vpanel' |
|
780 |
#'layout:' #(#LayoutFrame 0 0.0 59 0.0 0 1.0 0 1.0) |
|
781 |
#'component:' |
|
782 |
#(#SpecCollection |
|
783 |
#'collection:' |
|
784 |
#( |
|
785 |
#(#VariableHorizontalPanelSpec |
|
786 |
#'name:' 'hpanel' |
|
787 |
#'component:' |
|
788 |
#(#SpecCollection |
|
789 |
#'collection:' |
|
790 |
#( |
|
791 |
#(#ArbitraryComponentSpec |
|
792 |
#'name:' 'treeView' |
|
793 |
#'menu:' #menuCanvas |
|
794 |
#'hasHorizontalScrollBar:' true |
|
795 |
#'hasVerticalScrollBar:' true |
|
796 |
#'miniScrollerHorizontal:' true |
|
797 |
#'miniScrollerVertical:' true |
|
798 |
#'component:' #treeView |
|
799 |
#'hasBorder:' false |
|
800 |
) |
|
801 |
#(#ViewSpec |
|
802 |
#'name:' 'specHolderView' |
|
803 |
#'component:' |
|
804 |
#(#SpecCollection |
|
805 |
#'collection:' |
|
806 |
#( |
|
807 |
#(#NoteBookViewSpec |
|
808 |
#'name:' 'noteBook' |
|
809 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -30 1.0) |
|
810 |
#'enableChannel:' #enableChannel |
|
811 |
#'tabable:' true |
|
345 | 812 |
#'model:' #tabModel |
297 | 813 |
#'menu:' #tabList |
345 | 814 |
#'style:' #(#FontDescription #helvetica #medium #roman 10) |
297 | 815 |
#'canvas:' #noteBookView |
816 |
) |
|
817 |
#(#HorizontalPanelViewSpec |
|
818 |
#'name:' 'modifyPanel' |
|
819 |
#'layout:' #(#LayoutFrame 0 0.0 -30 1.0 0 1.0 0 1.0) |
|
820 |
#'component:' |
|
821 |
#(#SpecCollection |
|
822 |
#'collection:' |
|
823 |
#( |
|
824 |
#(#ActionButtonSpec |
|
825 |
#'name:' 'cancelButton' |
|
826 |
#'activeHelpKey:' #cancel |
|
827 |
#'label:' 'cancel' |
|
828 |
#'tabable:' true |
|
829 |
#'model:' #cancel |
|
830 |
#'enableChannel:' #modifiedChannel |
|
831 |
#'extent:' #(#Point 165 24) |
|
832 |
) |
|
833 |
#(#ActionButtonSpec |
|
834 |
#'name:' 'acceptButton' |
|
835 |
#'activeHelpKey:' #accept |
|
351 | 836 |
#'label:' 'accept' |
297 | 837 |
#'tabable:' true |
838 |
#'model:' #accept |
|
839 |
#'enableChannel:' #modifiedChannel |
|
345 | 840 |
#'extent:' #(#Point 166 24) |
297 | 841 |
) |
842 |
) |
|
843 |
) |
|
844 |
#'horizontalLayout:' #fitSpace |
|
845 |
#'verticalLayout:' #fitSpace |
|
846 |
#'horizontalSpace:' 3 |
|
847 |
#'verticalSpace:' 3 |
|
848 |
) |
|
849 |
) |
|
850 |
) |
|
851 |
#'borderWidth:' 1 |
|
852 |
) |
|
853 |
) |
|
854 |
) |
|
855 |
#'level:' 1 |
|
856 |
#'handles:' #(#Any 0.329435 1.0) |
|
857 |
) |
|
858 |
#(#TextEditorSpec |
|
859 |
#'name:' 'Transcript' |
|
860 |
#'hasHorizontalScrollBar:' true |
|
861 |
#'hasVerticalScrollBar:' true |
|
862 |
#'miniScrollerHorizontal:' true |
|
863 |
#'miniScrollerVertical:' true |
|
864 |
) |
|
865 |
) |
|
866 |
) |
|
867 |
#'handles:' #(#Any 0.880597 1.0) |
|
868 |
) |
|
222 | 869 |
) |
870 |
) |
|
871 |
) |
|
351 | 872 |
|
873 |
"Modified: / 26.10.1997 / 15:57:00 / cg" |
|
222 | 874 |
! ! |
875 |
||
876 |
!UIPainter class methodsFor:'menu specs'! |
|
877 |
||
118 | 878 |
menuAlignment |
217 | 879 |
"this window spec was automatically generated by the ST/X MenuEditor" |
880 |
||
881 |
"do not manually edit this - the builder may not be able to |
|
882 |
handle the specification if its corrupted." |
|
883 |
||
884 |
" |
|
885 |
MenuEditor new openOnClass:UIPainter andSelector:#menuAlignment |
|
886 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuAlignment)) startUp |
|
887 |
" |
|
888 |
||
889 |
<resource: #menu> |
|
890 |
||
891 |
^ |
|
892 |
||
893 |
#(#Menu |
|
894 |
||
895 |
#( |
|
896 |
#(#MenuItem |
|
897 |
#'label:' 'align left' |
|
898 |
#'value:' #alignSelectionLeft |
|
287 | 899 |
#'activeHelpKey:' #alignSelectionLeft |
217 | 900 |
#'labelImage:' |
901 |
#(#ResourceRetriever |
|
902 |
nil #iconAlignL |
|
903 |
) |
|
904 |
) |
|
905 |
#(#MenuItem |
|
906 |
#'label:' 'align right' |
|
907 |
#'value:' #alignSelectionRight |
|
908 |
#'activeHelpKey:' #alignSelectionRight |
|
909 |
#'labelImage:' |
|
910 |
#(#ResourceRetriever |
|
911 |
nil #iconAlignR |
|
912 |
) |
|
913 |
) |
|
914 |
#(#MenuItem |
|
915 |
#'label:' 'align left & right' |
|
916 |
#'value:' #alignSelectionLeftAndRight |
|
917 |
#'activeHelpKey:' #alignSelectionLeftAndRight |
|
918 |
#'labelImage:' |
|
919 |
#(#ResourceRetriever |
|
920 |
nil #iconAlignLR |
|
118 | 921 |
) |
217 | 922 |
) |
923 |
#(#MenuItem |
|
924 |
#'label:' 'align top' |
|
925 |
#'value:' #alignSelectionTop |
|
926 |
#'activeHelpKey:' #alignSelectionTop |
|
927 |
#'labelImage:' |
|
928 |
#(#ResourceRetriever |
|
929 |
nil #iconAlignT |
|
930 |
) |
|
931 |
) |
|
932 |
#(#MenuItem |
|
933 |
#'label:' 'align bottom' |
|
934 |
#'value:' #alignSelectionBottom |
|
935 |
#'activeHelpKey:' #alignSelectionBottom |
|
936 |
#'labelImage:' |
|
937 |
#(#ResourceRetriever |
|
938 |
nil #iconAlignB |
|
939 |
) |
|
940 |
) |
|
941 |
#(#MenuItem |
|
942 |
#'label:' 'align top & bottom' |
|
943 |
#'value:' #alignSelectionTopAndBottom |
|
944 |
#'activeHelpKey:' #alignSelectionTopAndBottom |
|
945 |
#'labelImage:' |
|
946 |
#(#ResourceRetriever |
|
947 |
nil #iconAlignTB |
|
948 |
) |
|
949 |
) |
|
950 |
#(#MenuItem |
|
951 |
#'label:' 'align centered horizontal' |
|
952 |
#'value:' #alignSelectionCenterHor |
|
953 |
#'activeHelpKey:' #alignSelectionCenterHor |
|
954 |
#'labelImage:' |
|
955 |
#(#ResourceRetriever |
|
956 |
nil #iconAlignCenterH |
|
957 |
) |
|
958 |
) |
|
959 |
#(#MenuItem |
|
960 |
#'label:' 'align centered vertical' |
|
961 |
#'value:' #alignSelectionCenterVer |
|
962 |
#'activeHelpKey:' #alignSelectionCenterVer |
|
963 |
#'labelImage:' |
|
964 |
#(#ResourceRetriever |
|
965 |
nil #iconAlignCenterV |
|
966 |
) |
|
967 |
) |
|
968 |
) |
|
969 |
#( 3 3 ) |
|
970 |
nil |
|
971 |
) |
|
118 | 972 |
! |
973 |
||
222 | 974 |
menuCanvas |
975 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
976 |
||
977 |
"do not manually edit this - the builder may not be able to |
|
978 |
handle the specification if its corrupted." |
|
979 |
||
980 |
" |
|
981 |
MenuEditor new openOnClass:UIPainter andSelector:#menuCanvas |
|
982 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuCanvas)) startUp |
|
983 |
" |
|
984 |
||
985 |
<resource: #menu> |
|
986 |
||
987 |
^ |
|
988 |
||
989 |
#(#Menu |
|
990 |
#( |
|
991 |
#(#MenuItem |
|
992 |
#'label:' 'copy' |
|
993 |
#'value:' #copySelection |
|
282 | 994 |
#'enabled:' #hasSelection |
222 | 995 |
#'shortcutKeyCharacter:' #Copy |
996 |
) |
|
997 |
#(#MenuItem |
|
998 |
#'label:' 'cut' |
|
999 |
#'value:' #deleteSelection |
|
282 | 1000 |
#'enabled:' #hasSelection |
222 | 1001 |
#'shortcutKeyCharacter:' #Cut |
1002 |
) |
|
1003 |
#(#MenuItem |
|
1004 |
#'label:' 'paste' |
|
1005 |
#'nameKey:' #paste |
|
282 | 1006 |
#'enabled:' #canPaste |
222 | 1007 |
#'value:' #paste |
1008 |
#'submenu:' |
|
1009 |
#(#Menu |
|
1010 |
||
1011 |
#( |
|
1012 |
#(#MenuItem |
|
1013 |
#'label:' 'paste' |
|
1014 |
#'value:' #pasteBuffer |
|
1015 |
#'activeHelpKey:' #pasteBuffer |
|
1016 |
#'shortcutKeyCharacter:' #Paste |
|
1017 |
) |
|
1018 |
#(#MenuItem |
|
1019 |
#'label:' 'keep layout' |
|
1020 |
#'value:' #pasteWithLayout |
|
282 | 1021 |
#'enabled:' #canKeepLayoutInSelection |
222 | 1022 |
#'activeHelpKey:' #pasteWithLayout |
1023 |
) |
|
1024 |
) nil |
|
1025 |
nil |
|
1026 |
) |
|
1027 |
) |
|
1028 |
#(#MenuItem |
|
1029 |
#'label:' '-' |
|
1030 |
) |
|
1031 |
#(#MenuItem |
|
1032 |
#'label:' 'undo' |
|
1033 |
#'nameKey:' #undo |
|
282 | 1034 |
#'enabled:' #hasUndoHistory |
366 | 1035 |
#'shortcutKeyCharacter:' #Cmdu |
222 | 1036 |
#'value:' #undoLast |
1037 |
) |
|
1038 |
#(#MenuItem |
|
1039 |
#'label:' '-' |
|
1040 |
) |
|
1041 |
#(#MenuItem |
|
1042 |
#'label:' 'dimension' |
|
1043 |
#'value:' #dimension |
|
282 | 1044 |
#'enabled:' #hasSelection |
222 | 1045 |
#'submenu:' |
1046 |
#(#Menu |
|
1047 |
||
1048 |
#( |
|
1049 |
#(#MenuItem |
|
1050 |
#'label:' 'default extent' |
|
1051 |
#'value:' #setToDefaultExtent |
|
282 | 1052 |
#'enabled:' #canMoveOrAlignSelection |
222 | 1053 |
#'activeHelpKey:' #setToDefaultExtent |
1054 |
) |
|
1055 |
#(#MenuItem |
|
1056 |
#'label:' 'default width' |
|
1057 |
#'value:' #setToDefaultWidth |
|
282 | 1058 |
#'enabled:' #canMoveOrAlignSelection |
222 | 1059 |
#'activeHelpKey:' #setToDefaultWidth |
1060 |
) |
|
1061 |
#(#MenuItem |
|
1062 |
#'label:' 'default height' |
|
1063 |
#'value:' #setToDefaultHeight |
|
282 | 1064 |
#'enabled:' #canMoveOrAlignSelection |
222 | 1065 |
#'activeHelpKey:' #setToDefaultHeight |
1066 |
) |
|
1067 |
#(#MenuItem |
|
1068 |
#'label:' 'copy extent' |
|
1069 |
#'value:' #copyExtent |
|
282 | 1070 |
#'enabled:' #hasSingleSelection |
222 | 1071 |
#'activeHelpKey:' #copyExtent |
1072 |
) |
|
1073 |
#(#MenuItem |
|
1074 |
#'label:' 'paste extent' |
|
1075 |
#'value:' #pasteExtent |
|
282 | 1076 |
#'enabled:' #canMoveOrAlignSelection |
222 | 1077 |
#'activeHelpKey:' #pasteExtent |
1078 |
) |
|
1079 |
#(#MenuItem |
|
1080 |
#'label:' 'paste width' |
|
1081 |
#'value:' #pasteWidth |
|
282 | 1082 |
#'enabled:' #canMoveOrAlignSelection |
222 | 1083 |
#'activeHelpKey:' #pasteWidth |
1084 |
) |
|
1085 |
#(#MenuItem |
|
1086 |
#'label:' 'paste height' |
|
1087 |
#'value:' #pasteHeight |
|
282 | 1088 |
#'enabled:' #canMoveOrAlignSelection |
222 | 1089 |
#'activeHelpKey:' #pasteHeight |
1090 |
) |
|
1091 |
#(#MenuItem |
|
1092 |
#'label:' 'copy layout' |
|
1093 |
#'value:' #copyLayout |
|
282 | 1094 |
#'enabled:' #hasSingleSelection |
222 | 1095 |
#'activeHelpKey:' #copyLayout |
1096 |
) |
|
1097 |
#(#MenuItem |
|
1098 |
#'label:' 'paste layout' |
|
1099 |
#'value:' #pasteLayout |
|
282 | 1100 |
#'enabled:' #canMoveOrAlignSelection |
222 | 1101 |
#'activeHelpKey:' #pasteLayout |
1102 |
) |
|
1103 |
) |
|
1104 |
#(3 1 3) |
|
1105 |
nil |
|
1106 |
) |
|
1107 |
) |
|
1108 |
#(#MenuItem |
|
1109 |
#'label:' 'align' |
|
1110 |
#'value:' #align |
|
282 | 1111 |
#'enabled:' #canMoveOrAlignSelection |
222 | 1112 |
#'submenu:' |
1113 |
#(#Menu |
|
1114 |
||
1115 |
#( |
|
1116 |
#(#MenuItem |
|
1117 |
#'label:' 'align left' |
|
1118 |
#'value:' #alignSelectionLeft |
|
1119 |
#'activeHelpKey:' #alignSelectionLeft |
|
1120 |
#'labelImage:' |
|
1121 |
#(#ResourceRetriever |
|
1122 |
#UIPainter #iconAlignL |
|
1123 |
'align left' |
|
1124 |
) |
|
1125 |
) |
|
1126 |
#(#MenuItem |
|
1127 |
#'label:' 'align right' |
|
1128 |
#'value:' #alignSelectionRight |
|
1129 |
#'activeHelpKey:' #alignSelectionRight |
|
1130 |
#'labelImage:' |
|
1131 |
#(#ResourceRetriever |
|
1132 |
#UIPainter #iconAlignR |
|
1133 |
'align right' |
|
1134 |
) |
|
1135 |
) |
|
1136 |
#(#MenuItem |
|
1137 |
#'label:' 'align left & right' |
|
1138 |
#'value:' #alignSelectionLeftAndRight |
|
1139 |
#'activeHelpKey:' #alignSelectionLeftAndRight |
|
1140 |
#'labelImage:' |
|
1141 |
#(#ResourceRetriever |
|
1142 |
#UIPainter #iconAlignLR |
|
1143 |
'align left & right' |
|
1144 |
) |
|
1145 |
) |
|
1146 |
#(#MenuItem |
|
1147 |
#'label:' 'align top' |
|
1148 |
#'value:' #alignSelectionTop |
|
1149 |
#'activeHelpKey:' #alignSelectionTop |
|
1150 |
#'labelImage:' |
|
1151 |
#(#ResourceRetriever |
|
1152 |
#UIPainter #iconAlignT |
|
1153 |
'align top' |
|
1154 |
) |
|
1155 |
) |
|
1156 |
#(#MenuItem |
|
1157 |
#'label:' 'align bottom' |
|
1158 |
#'value:' #alignSelectionBottom |
|
1159 |
#'activeHelpKey:' #alignSelectionBottom |
|
1160 |
#'labelImage:' |
|
1161 |
#(#ResourceRetriever |
|
1162 |
#UIPainter #iconAlignB |
|
1163 |
'align bottom' |
|
1164 |
) |
|
1165 |
) |
|
1166 |
#(#MenuItem |
|
1167 |
#'label:' 'align top & bottom' |
|
1168 |
#'value:' #alignSelectionTopAndBottom |
|
1169 |
#'activeHelpKey:' #alignSelectionTopAndBottom |
|
1170 |
#'labelImage:' |
|
1171 |
#(#ResourceRetriever |
|
1172 |
#UIPainter #iconAlignTB |
|
1173 |
'align top & bottom' |
|
1174 |
) |
|
1175 |
) |
|
1176 |
#(#MenuItem |
|
1177 |
#'label:' 'align centered horizontal' |
|
1178 |
#'value:' #alignSelectionCenterHor |
|
1179 |
#'activeHelpKey:' #alignSelectionCenterHor |
|
1180 |
#'labelImage:' |
|
1181 |
#(#ResourceRetriever |
|
1182 |
#UIPainter #iconAlignCenterH |
|
1183 |
'align centered horizontal' |
|
1184 |
) |
|
1185 |
) |
|
1186 |
#(#MenuItem |
|
1187 |
#'label:' 'align centered vertical' |
|
1188 |
#'value:' #alignSelectionCenterVer |
|
1189 |
#'activeHelpKey:' #alignSelectionCenterVer |
|
1190 |
#'labelImage:' |
|
1191 |
#(#ResourceRetriever |
|
1192 |
#UIPainter #iconAlignCenterV |
|
1193 |
'align centered vertical' |
|
1194 |
) |
|
1195 |
) |
|
1196 |
#(#MenuItem |
|
1197 |
#'label:' 'spread horizontal' |
|
1198 |
#'value:' #spreadSelectionHor |
|
1199 |
#'activeHelpKey:' #spreadSelectionHor |
|
1200 |
) |
|
1201 |
#(#MenuItem |
|
1202 |
#'label:' 'spread vertical' |
|
1203 |
#'value:' #spreadSelectionVer |
|
1204 |
#'activeHelpKey:' #spreadSelectionVer |
|
1205 |
) |
|
1206 |
#(#MenuItem |
|
1207 |
#'label:' 'center horizontal in frame' |
|
1208 |
#'value:' #centerSelectionHor |
|
1209 |
#'activeHelpKey:' #centerSelectionHor |
|
1210 |
) |
|
1211 |
#(#MenuItem |
|
1212 |
#'label:' 'center vertical in frame' |
|
1213 |
#'value:' #centerSelectionVer |
|
1214 |
#'activeHelpKey:' #centerSelectionVer |
|
1215 |
) |
|
1216 |
) |
|
1217 |
#(8 2) |
|
1218 |
nil |
|
1219 |
) |
|
1220 |
) |
|
1221 |
) nil |
|
1222 |
nil |
|
1223 |
) |
|
1224 |
||
1225 |
||
1226 |
! |
|
1227 |
||
282 | 1228 |
menuChangeHierarchy |
222 | 1229 |
"this window spec was automatically generated by the ST/X MenuEditor" |
1230 |
||
1231 |
"do not manually edit this - the builder may not be able to |
|
1232 |
handle the specification if its corrupted." |
|
1233 |
||
1234 |
" |
|
282 | 1235 |
MenuEditor new openOnClass:UIPainter andSelector:#menuChangeHierarchy |
1236 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuChangeHierarchy)) startUp |
|
222 | 1237 |
" |
1238 |
||
1239 |
<resource: #menu> |
|
1240 |
||
1241 |
^ |
|
1242 |
||
1243 |
#(#Menu |
|
1244 |
||
1245 |
#( |
|
1246 |
#(#MenuItem |
|
1247 |
#'label:' 'stepUp' |
|
1248 |
#'value:' #doStepUp |
|
345 | 1249 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconStepUp) |
222 | 1250 |
) |
1251 |
#(#MenuItem |
|
1252 |
#'label:' 'stepDown' |
|
1253 |
#'value:' #doStepDown |
|
345 | 1254 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconStepDown) |
282 | 1255 |
) |
1256 |
#(#MenuItem |
|
222 | 1257 |
#'label:' 'stepIn' |
1258 |
#'value:' #doStepIn |
|
282 | 1259 |
#'enabled:' #canMoveSelectionIntoContainer |
345 | 1260 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconStepIn) |
222 | 1261 |
) |
1262 |
#(#MenuItem |
|
1263 |
#'label:' 'stepOut' |
|
1264 |
#'value:' #doStepOut |
|
282 | 1265 |
#'enabled:' #canMoveSelectionOutOfContainer |
345 | 1266 |
#'labelImage:' #(#ResourceRetriever #UIPainter #iconStepOut) |
222 | 1267 |
) |
282 | 1268 |
) nil |
222 | 1269 |
nil |
1270 |
) |
|
1271 |
! |
|
1272 |
||
118 | 1273 |
menuPullDown |
217 | 1274 |
"this window spec was automatically generated by the ST/X MenuEditor" |
1275 |
||
1276 |
"do not manually edit this - the builder may not be able to |
|
1277 |
handle the specification if its corrupted." |
|
1278 |
||
1279 |
" |
|
1280 |
MenuEditor new openOnClass:UIPainter andSelector:#menuPullDown |
|
1281 |
(Menu new fromLiteralArrayEncoding:(UIPainter menuPullDown)) startUp |
|
1282 |
" |
|
1283 |
||
1284 |
<resource: #menu> |
|
1285 |
||
1286 |
^ |
|
1287 |
||
1288 |
#(#Menu |
|
1289 |
||
1290 |
#( |
|
1291 |
#(#MenuItem |
|
109 | 1292 |
#'label:' 'file' |
114 | 1293 |
#'value:' #file |
217 | 1294 |
#'enabled:' #enableChannel |
1295 |
#'submenu:' |
|
1296 |
#(#Menu |
|
1297 |
||
1298 |
#( |
|
1299 |
#(#MenuItem |
|
1300 |
#'label:' 'new' |
|
1301 |
#'value:' #doNew |
|
1302 |
) |
|
1303 |
#(#MenuItem |
|
1304 |
#'label:' 'from class ...' |
|
1305 |
#'value:' #doFromClass |
|
1306 |
) |
|
1307 |
#(#MenuItem |
|
1308 |
#'label:' 'pick a view ' |
|
1309 |
#'value:' #doPickAView |
|
1310 |
) |
|
1311 |
#(#MenuItem |
|
1312 |
#'label:' '-' |
|
1313 |
) |
|
1314 |
#(#MenuItem |
|
1315 |
#'label:' 'quit' |
|
1316 |
#'value:' #closeRequest |
|
1317 |
) |
|
1318 |
) nil |
|
1319 |
nil |
|
1320 |
) |
|
1321 |
) |
|
1322 |
#(#MenuItem |
|
109 | 1323 |
#'label:' 'misc' |
114 | 1324 |
#'value:' #misc |
217 | 1325 |
#'enabled:' #enableChannel |
1326 |
#'submenu:' |
|
1327 |
#(#Menu |
|
1328 |
||
1329 |
#( |
|
1330 |
#(#MenuItem |
|
1331 |
#'label:' 'grid' |
|
1332 |
#'value:' #grid |
|
1333 |
#'submenu:' |
|
1334 |
#(#Menu |
|
1335 |
||
1336 |
#( |
|
1337 |
#(#MenuItem |
|
1338 |
#'label:' 'show' |
|
1339 |
#'indication:' #'gridShown:' |
|
1340 |
) |
|
1341 |
#(#MenuItem |
|
1342 |
#'label:' 'align' |
|
1343 |
#'indication:' #'gridAlign:' |
|
109 | 1344 |
) |
366 | 1345 |
#(#MenuItem |
1346 |
#'label:' '-' |
|
1347 |
) |
|
1348 |
#(#MenuItem |
|
1349 |
#'label:' 'menu' |
|
1350 |
#'value:' #gridMenu |
|
1351 |
) |
|
217 | 1352 |
) nil |
1353 |
nil |
|
1354 |
) |
|
1355 |
) |
|
1356 |
#(#MenuItem |
|
1357 |
#'label:' 'undo' |
|
1358 |
#'value:' #undo |
|
1359 |
#'submenu:' |
|
1360 |
#(#Menu |
|
1361 |
||
1362 |
#( |
|
1363 |
#(#MenuItem |
|
1364 |
#'label:' 'last' |
|
1365 |
#'value:' #undoLast |
|
1366 |
) |
|
1367 |
#(#MenuItem |
|
1368 |
#'label:' 'menu' |
|
1369 |
#'value:' #openUndoMenu |
|
1370 |
) |
|
1371 |
#(#MenuItem |
|
1372 |
#'label:' '-' |
|
1373 |
) |
|
1374 |
#(#MenuItem |
|
1375 |
#'label:' 'delete' |
|
1376 |
#'value:' #removeUndoHistory |
|
1377 |
) |
|
1378 |
) nil |
|
1379 |
nil |
|
1380 |
) |
|
1381 |
) |
|
1382 |
) nil |
|
1383 |
nil |
|
1384 |
) |
|
1385 |
) |
|
1386 |
#(#MenuItem |
|
109 | 1387 |
#'label:' 'code' |
114 | 1388 |
#'value:' #code |
217 | 1389 |
#'enabled:' #enableChannel |
1390 |
#'submenu:' |
|
1391 |
#(#Menu |
|
1392 |
||
1393 |
#( |
|
1394 |
#(#MenuItem |
|
1395 |
#'label:' 'class && method ...' |
|
1396 |
#'value:' #defineClassAndSelector |
|
1397 |
) |
|
1398 |
#(#MenuItem |
|
345 | 1399 |
#'label:' '-' |
217 | 1400 |
) |
1401 |
#(#MenuItem |
|
1402 |
#'label:' 'install window spec.' |
|
1403 |
#'value:' #doInstallSpec |
|
1404 |
) |
|
1405 |
#(#MenuItem |
|
1406 |
#'label:' 'install help spec.' |
|
1407 |
#'value:' #doInstallHelp |
|
1408 |
#'enabled:' #hasSpecClass |
|
1409 |
) |
|
1410 |
#(#MenuItem |
|
1411 |
#'label:' 'install aspects' |
|
1412 |
#'value:' #doInstallAspects |
|
1413 |
#'enabled:' #hasSpecClass |
|
1414 |
) |
|
1415 |
#(#MenuItem |
|
345 | 1416 |
#'label:' '-' |
217 | 1417 |
) |
1418 |
#(#MenuItem |
|
1419 |
#'label:' 'show window spec.' |
|
1420 |
#'value:' #doWindowSpec |
|
1421 |
) |
|
1422 |
#(#MenuItem |
|
1423 |
#'label:' 'browse application' |
|
1424 |
#'value:' #doBrowseAppClass |
|
1425 |
#'enabled:' #hasSpecClass |
|
1426 |
) |
|
351 | 1427 |
#(#MenuItem |
1428 |
#'label:' 'browse aspect methods' |
|
1429 |
#'value:' #doBrowseAspectMethods |
|
1430 |
) |
|
217 | 1431 |
) nil |
1432 |
nil |
|
1433 |
) |
|
1434 |
) |
|
1435 |
#(#MenuItem |
|
109 | 1436 |
#'label:' 'test' |
118 | 1437 |
#'nameKey:' #test |
114 | 1438 |
#'value:' #test |
217 | 1439 |
#'submenu:' |
1440 |
#(#Menu |
|
1441 |
||
1442 |
#( |
|
1443 |
#(#MenuItem |
|
351 | 1444 |
#'label:' 'geometry test mode' |
217 | 1445 |
#'indication:' #'testMode:' |
1446 |
) |
|
1447 |
) nil |
|
1448 |
nil |
|
1449 |
) |
|
1450 |
) |
|
345 | 1451 |
#(#MenuItem |
1452 |
#'label:' '' |
|
1453 |
) |
|
1454 |
#(#MenuItem |
|
1455 |
#'label:' 'Gallery' |
|
1456 |
#'indication:' #galleryShown |
|
1457 |
) |
|
1458 |
#(#MenuItem |
|
1459 |
#'label:' 'Canvas' |
|
1460 |
#'indication:' #painterShown |
|
1461 |
) |
|
1462 |
#(#MenuItem |
|
1463 |
#'label:' '' |
|
1464 |
) |
|
1465 |
#(#MenuItem |
|
1466 |
#'label:' '-' |
|
1467 |
) |
|
1468 |
#(#MenuItem |
|
1469 |
#'label:' 'Install' |
|
1470 |
#'value:' #doInstallSpec |
|
1471 |
#'labelImage:' #(#ResourceRetriever nil #iconInstall 'Install') |
|
1472 |
) |
|
1473 |
#(#MenuItem |
|
1474 |
#'label:' '-' |
|
1475 |
) |
|
1476 |
#(#MenuItem |
|
1477 |
#'label:' 'Run' |
|
1478 |
#'value:' #doStartApplication |
|
1479 |
) |
|
1480 |
#(#MenuItem |
|
1481 |
#'label:' '-' |
|
1482 |
) |
|
217 | 1483 |
) nil |
1484 |
nil |
|
109 | 1485 |
) |
351 | 1486 |
|
1487 |
"Modified: / 26.10.1997 / 14:34:13 / cg" |
|
222 | 1488 |
! ! |
1489 |
||
109 | 1490 |
!UIPainter methodsFor:'actions'! |
60 | 1491 |
|
109 | 1492 |
accept |
282 | 1493 |
"accept changes done to the specification. The component assigned to the |
1494 |
specification will change immediately dependant on the attributes derived |
|
1495 |
from the specification. |
|
1496 |
" |
|
287 | 1497 |
|layout spec prop key layoutTool| |
60 | 1498 |
|
166 | 1499 |
self isLayoutToolSelected ifTrue:[ |
287 | 1500 |
layoutTool := self layoutTool. |
1501 |
||
144 | 1502 |
(layout := layoutTool layout) notNil ifTrue:[ |
1503 |
layoutTool layoutType == #Extent ifTrue:[ |
|
282 | 1504 |
layoutTool layoutView == self painter topView ifTrue:[ |
1505 |
layoutTool layoutView extent:layout |
|
1506 |
] ifFalse:[ |
|
1507 |
self painter setExtent:layout |
|
1508 |
] |
|
144 | 1509 |
] ifFalse:[ |
149 | 1510 |
self painter setLayout:layout |
109 | 1511 |
] |
144 | 1512 |
] |
1513 |
] ifFalse:[ |
|
287 | 1514 |
spec := self specTool specification. |
1515 |
||
166 | 1516 |
self isHelpToolSelected ifTrue:[ |
287 | 1517 |
self helpTool accept. |
1518 |
key := self helpTool helpKey. |
|
1519 |
prop := treeView propertySelected. |
|
1520 |
||
1521 |
prop notNil ifTrue:[ |
|
1522 |
prop spec activeHelpKey:key |
|
1523 |
]. |
|
1524 |
spec activeHelpKey:key. |
|
1525 |
] ifFalse:[ |
|
1526 |
self painter updateFromSpec:spec. |
|
1527 |
] |
|
144 | 1528 |
]. |
166 | 1529 |
self modifiedChannel value:false. |
109 | 1530 |
! |
1531 |
||
1532 |
cancel |
|
282 | 1533 |
"cancel all changes done to the specification; reread attributes from the |
1534 |
assigned component |
|
109 | 1535 |
" |
328 | 1536 |
|spec key view| |
287 | 1537 |
|
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1538 |
self isModified ifTrue:[ |
287 | 1539 |
(spec := self painter specForSelection) notNil ifTrue:[ |
1540 |
key := spec activeHelpKey. |
|
1541 |
]. |
|
1542 |
self helpTool helpKey:key. |
|
1543 |
self specTool specification:spec. |
|
328 | 1544 |
view := self layoutTool layoutView. |
1545 |
||
1546 |
self setViewInLayoutTool:view. |
|
1547 |
spec class == DataSetSpec ifTrue:[ |
|
1548 |
view columnDescriptors:(spec columns) |
|
1549 |
]. |
|
166 | 1550 |
self modifiedChannel value:false. |
1551 |
] |
|
137 | 1552 |
! |
1553 |
||
282 | 1554 |
moveSelectionDown |
1555 |
"move selected components down |
|
1556 |
" |
|
1557 |
self painter moveSelectionDown |
|
1558 |
! |
|
1559 |
||
1560 |
moveSelectionLeft |
|
1561 |
"move selected components left |
|
1562 |
" |
|
1563 |
self painter moveSelectionLeft |
|
1564 |
||
1565 |
! |
|
1566 |
||
1567 |
moveSelectionRight |
|
1568 |
"move selected components right |
|
1569 |
" |
|
1570 |
self painter moveSelectionRight |
|
1571 |
||
1572 |
! |
|
1573 |
||
1574 |
moveSelectionUp |
|
1575 |
"move selected components up |
|
1576 |
" |
|
1577 |
self painter moveSelectionUp |
|
1578 |
||
1579 |
! |
|
1580 |
||
328 | 1581 |
openDataSetColumnEditor |
1582 |
"opens a column editor |
|
1583 |
" |
|
1584 |
|cls aspect editor columns| |
|
1585 |
||
1586 |
cls := self resolveName:specClass. |
|
1587 |
||
1588 |
cls isNil ifTrue:[ |
|
1589 |
^ self information:'no application class defined yet' |
|
1590 |
]. |
|
1591 |
aspect := self specTool specification columns. |
|
1592 |
editor := DataSetBuilder new. |
|
341 | 1593 |
editor masterApplication:self. |
328 | 1594 |
editor columns:aspect fromView:(self layoutTool layoutView). |
333 | 1595 |
editor rowClassName:(self specTool specification rowClassName). |
328 | 1596 |
editor openModal. |
1597 |
||
1598 |
editor hasChanged ifTrue:[ |
|
1599 |
self specTool specification columns:(editor columns). |
|
333 | 1600 |
self specTool specification rowClassName:(editor rowClassName). |
328 | 1601 |
self modifiedChannel value:true. |
1602 |
]. |
|
1603 |
! |
|
1604 |
||
217 | 1605 |
openEditMenu |
287 | 1606 |
"opens a menu editor on current widget |
1607 |
" |
|
217 | 1608 |
|cls aspect editor| |
1609 |
||
328 | 1610 |
cls := self resolveName:specClass. |
1611 |
||
1612 |
cls isNil ifTrue:[ |
|
1613 |
^ self information:'no application class defined yet' |
|
217 | 1614 |
]. |
1615 |
||
1616 |
cls notNil ifTrue:[ |
|
295 | 1617 |
(aspect := self specTool specification menuSelector) notNil ifTrue:[ |
217 | 1618 |
aspect := aspect asSymbol |
229 | 1619 |
] ifFalse:[ |
267 | 1620 |
"/ cg: q&d hack ... |
1621 |
||
229 | 1622 |
aspect := treeView propertySelected. |
1623 |
aspect notNil ifTrue:[ |
|
245 | 1624 |
Object errorSignal handle:[:ex | |
271 | 1625 |
aspect := nil. |
245 | 1626 |
] do:[ |
1627 |
aspect := aspect view asMenu. |
|
1628 |
] |
|
271 | 1629 |
]. |
217 | 1630 |
]. |
229 | 1631 |
|
217 | 1632 |
editor := MenuEditor new. |
1633 |
editor masterApplication:self. |
|
287 | 1634 |
editor useHelpDictionary:(self helpTool dictionary). |
271 | 1635 |
editor openModalOnClass:cls andSelector:aspect. |
287 | 1636 |
self helpTool updateList. |
271 | 1637 |
|
1638 |
editor selectorName ~= aspect ifTrue:[ |
|
1639 |
editor didInstall ifTrue:[ |
|
295 | 1640 |
self specTool specification menuSelector:editor selectorName asSymbol. |
271 | 1641 |
self modifiedChannel value:true. |
1642 |
self accept |
|
1643 |
] |
|
1644 |
]. |
|
217 | 1645 |
] |
1646 |
||
271 | 1647 |
"Modified: 31.7.1997 / 14:26:13 / cg" |
301 | 1648 |
! |
1649 |
||
1650 |
openHierarchicalListEditor |
|
1651 |
"opens a hierarchical list editor editor on current widget |
|
1652 |
" |
|
1653 |
|cls aspect editor| |
|
1654 |
||
328 | 1655 |
cls := self resolveName:specClass. |
1656 |
||
1657 |
cls isNil ifTrue:[ |
|
1658 |
^ self information:'no application class defined yet' |
|
301 | 1659 |
]. |
1660 |
||
328 | 1661 |
(aspect := self specTool specification hierarchicalList) notNil ifTrue:[ |
1662 |
aspect := aspect asSymbol |
|
1663 |
] ifFalse:[ |
|
1664 |
"/ cg: q&d hack ... |
|
1665 |
||
1666 |
aspect := treeView propertySelected. |
|
1667 |
aspect notNil ifTrue:[ |
|
1668 |
Object errorSignal handle:[:ex | |
|
1669 |
aspect := nil. |
|
1670 |
] do:[ |
|
1671 |
aspect := aspect view asMenu. |
|
301 | 1672 |
] |
1673 |
]. |
|
328 | 1674 |
]. |
1675 |
||
1676 |
editor := HierarchicalListEditor new. |
|
1677 |
editor masterApplication:self. |
|
1678 |
editor openModalOnClass:cls andSelector:aspect. |
|
1679 |
||
1680 |
editor selectorName ~= aspect ifTrue:[ |
|
1681 |
editor didInstall ifTrue:[ |
|
1682 |
self specTool specification hierarchicalList:editor selectorName asSymbol. |
|
1683 |
self modifiedChannel value:true. |
|
1684 |
self accept |
|
1685 |
] |
|
301 | 1686 |
] |
60 | 1687 |
! ! |
1688 |
||
365
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1689 |
!UIPainter methodsFor:'active help'! |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1690 |
|
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1691 |
showHelp:aHelpText for:view |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1692 |
"display active help texts in my own info area." |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1693 |
|
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1694 |
|txt| |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1695 |
|
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1696 |
aHelpText isNil ifTrue:[ |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1697 |
txt := nil |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1698 |
] ifFalse:[ |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1699 |
txt := self class |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1700 |
convertString:(aHelpText asString) |
368 | 1701 |
maxLineSize:(transcript width // transcript font width) |
1702 |
skipLineFeed:true |
|
365
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1703 |
]. |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1704 |
transcript hideCursor. |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1705 |
transcript contents:txt. |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1706 |
^ true |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1707 |
|
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1708 |
"Modified: / 29.10.1997 / 22:33:55 / cg" |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1709 |
! ! |
1610933f0e94
clear help view if there is no help
Claus Gittinger <cg@exept.de>
parents:
363
diff
changeset
|
1710 |
|
60 | 1711 |
!UIPainter methodsFor:'aspects'! |
1712 |
||
282 | 1713 |
canMoveOrAlignSelection |
1714 |
"returns a boolean value holder which is true in case that any selection exists |
|
1715 |
and all widgets in the selection can change its layout through to a move or |
|
1716 |
align operation |
|
1717 |
" |
|
1718 |
^ builder booleanValueAspectFor:#canMoveOrAlignSelection |
|
222 | 1719 |
! |
1720 |
||
282 | 1721 |
canMoveSelectionIntoContainer |
1722 |
"returns a boolean value holder which is true in case that one component is selected |
|
1723 |
and can change its container widget to the next element in the list which will have |
|
1724 |
the same container. |
|
1725 |
" |
|
1726 |
^ builder booleanValueAspectFor:#canMoveSelectionIntoContainer |
|
1727 |
! |
|
1728 |
||
1729 |
canMoveSelectionOutOfContainer |
|
1730 |
"returns a boolean value holder which is true in case that one component is selected |
|
1731 |
which is contained within another component |
|
1732 |
" |
|
1733 |
^ builder booleanValueAspectFor:#canMoveSelectionOutOfContainer |
|
222 | 1734 |
! |
1735 |
||
118 | 1736 |
enableChannel |
1737 |
"true if modifications are allowed otherwise running test |
|
1738 |
" |
|
1739 |
^ self painter enableChannel |
|
109 | 1740 |
! |
1741 |
||
173 | 1742 |
galleryShown |
282 | 1743 |
"returns a boolean value holder which is set to true if the gallery is shown |
1744 |
" |
|
173 | 1745 |
|holder| |
1746 |
||
1747 |
(holder := builder bindingAt:#galleryShown) isNil ifTrue:[ |
|
1748 |
builder aspectAt:#galleryShown put:(holder := true asValue). |
|
1749 |
holder addDependent:self |
|
1750 |
]. |
|
1751 |
^ holder |
|
1752 |
||
1753 |
! |
|
1754 |
||
282 | 1755 |
hasOneSelectionOtherThanCanvas |
1756 |
"returns a value holder which is true in case that one component is selected |
|
1757 |
other than the canvas. |
|
1758 |
" |
|
1759 |
^ builder booleanValueAspectFor:#hasOneSelectionOtherThanCanvas |
|
222 | 1760 |
! |
1761 |
||
109 | 1762 |
modifiedChannel |
282 | 1763 |
"returns a boolean value holder which is set to true if something is modified |
1764 |
and not accepted |
|
1765 |
" |
|
256 | 1766 |
^ builder booleanValueAspectFor:#modifiedChannel |
109 | 1767 |
! |
1768 |
||
1769 |
noteBookView |
|
282 | 1770 |
"returns the notebook view; initialize components within the notebook |
1771 |
" |
|
287 | 1772 |
|noteBook channel helpTool layoutTool specTool| |
109 | 1773 |
|
1774 |
(noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[ |
|
166 | 1775 |
noteBook := View new. |
1776 |
layoutTool := UILayoutTool new. |
|
287 | 1777 |
helpTool := UIHelpTool new. |
1778 |
helpTool helpSpecFrom:specClass. |
|
166 | 1779 |
specTool := UISpecificationTool new. |
144 | 1780 |
channel := self modifiedChannel. |
166 | 1781 |
|
152 | 1782 |
layoutTool masterApplication:self. |
166 | 1783 |
specTool masterApplication:self. |
287 | 1784 |
helpTool masterApplication:self. |
1785 |
||
1786 |
layoutCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
1787 |
helpCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
1788 |
specCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
1789 |
||
1790 |
layoutCanvas client:layoutTool. |
|
1791 |
helpCanvas client:helpTool. |
|
1792 |
specTool builder:(specCanvas client:specTool). |
|
166 | 1793 |
|
1794 |
layoutTool masterApplication:self. |
|
1795 |
specTool masterApplication:self. |
|
287 | 1796 |
helpTool masterApplication:self. |
1797 |
||
109 | 1798 |
layoutTool modifiedHolder:channel. |
287 | 1799 |
helpTool modifiedHolder:channel. |
166 | 1800 |
specTool modifiedHolder:channel. |
287 | 1801 |
|
109 | 1802 |
builder aspectAt:#noteBookView put:noteBook. |
1803 |
]. |
|
1804 |
^ noteBook |
|
1805 |
! |
|
1806 |
||
282 | 1807 |
painterShown |
1808 |
"returns a boolean value holder which is set to true if the painter is shown |
|
109 | 1809 |
" |
173 | 1810 |
|holder| |
1811 |
||
1812 |
(holder := builder bindingAt:#painterShown) isNil ifTrue:[ |
|
1813 |
builder aspectAt:#painterShown put:(holder := true asValue). |
|
1814 |
holder addDependent:self |
|
1815 |
]. |
|
1816 |
^ holder |
|
1817 |
||
1818 |
! |
|
1819 |
||
109 | 1820 |
tabList |
282 | 1821 |
"returns a value holder which keeps a list of labels assigned to the tabs |
1822 |
" |
|
109 | 1823 |
|holder| |
1824 |
||
1825 |
(holder := builder bindingAt:#tabList) isNil ifTrue:[ |
|
1826 |
builder aspectAt:#tabList put:(holder := ValueHolder new). |
|
144 | 1827 |
holder value:#( 'Properties' ). |
109 | 1828 |
]. |
1829 |
^ holder |
|
1830 |
! |
|
1831 |
||
1832 |
tabModel |
|
282 | 1833 |
"returns a value holder which keeps the current name of the tab selected |
1834 |
" |
|
109 | 1835 |
|holder| |
1836 |
||
1837 |
(holder := builder bindingAt:#tabModel) isNil ifTrue:[ |
|
1838 |
holder := AspectAdaptor new subject:self; forAspect:#tabSelection. |
|
1839 |
builder aspectAt:#tabModel put:holder. |
|
1840 |
]. |
|
1841 |
^ holder |
|
222 | 1842 |
! |
1843 |
||
1844 |
treeView |
|
282 | 1845 |
"returns the selection tree view which holds all widget identifiers |
1846 |
" |
|
222 | 1847 |
^ treeView |
60 | 1848 |
! ! |
1849 |
||
109 | 1850 |
!UIPainter methodsFor:'binding access'! |
1851 |
||
1852 |
aspectFor:aKey |
|
222 | 1853 |
"aspect for a key |
109 | 1854 |
" |
222 | 1855 |
^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ] |
109 | 1856 |
! ! |
1857 |
||
1858 |
!UIPainter methodsFor:'change & update'! |
|
1859 |
||
222 | 1860 |
layoutChanged |
282 | 1861 |
"called by the painter/canvas whenever the layout of the current selected |
1862 |
widget changed |
|
1863 |
" |
|
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1864 |
self isModified ifFalse:[ |
287 | 1865 |
self layoutTool update. |
222 | 1866 |
self modifiedChannel value:false |
1867 |
] |
|
1868 |
! |
|
1869 |
||
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1870 |
propertyChanged |
282 | 1871 |
"called by the painter/canvas whenever the property of the current selected |
1872 |
widget changed |
|
222 | 1873 |
" |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1874 |
|p| |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1875 |
|
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1876 |
(p := treeView propertySelected) notNil ifTrue:[ |
287 | 1877 |
self specTool specification:(p spec copy). |
282 | 1878 |
self setViewInLayoutTool:(p view). |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1879 |
self modifiedChannel value:false |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1880 |
] ifFalse:[ |
287 | 1881 |
self layoutTool layoutView notNil ifTrue:[ |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1882 |
self modifiedChannel value:false. |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1883 |
self treeSelection |
222 | 1884 |
] |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
1885 |
] |
222 | 1886 |
! |
1887 |
||
1888 |
update:something with:aParameter from:someObject |
|
282 | 1889 |
"catch change notifications |
1890 |
" |
|
222 | 1891 |
someObject == treeView model ifTrue:[ |
362 | 1892 |
(something == #selection |
1893 |
or:[something == #selectionIndex]) ifTrue:[self treeSelection]. |
|
222 | 1894 |
^ self |
173 | 1895 |
]. |
1896 |
||
1897 |
self galleryShown == someObject ifTrue:[ |
|
1898 |
(self galleryShown value) ifTrue:[ |
|
1899 |
self raiseUIView:(selectionPanel window) |
|
1900 |
] ifFalse:[ |
|
1901 |
self hideUIView:(selectionPanel window) |
|
1902 |
]. |
|
1903 |
^ self |
|
1904 |
]. |
|
1905 |
||
1906 |
self painterShown == someObject ifTrue:[ |
|
1907 |
(self painterShown value) ifTrue:[ |
|
1908 |
self raiseUIView:(self painter topView) |
|
1909 |
] ifFalse:[ |
|
1910 |
self hideUIView:(self painter topView) |
|
1911 |
]. |
|
1912 |
^ self |
|
1913 |
]. |
|
1914 |
||
362 | 1915 |
"Modified: / 29.10.1997 / 17:48:19 / cg" |
109 | 1916 |
! ! |
1917 |
||
1918 |
!UIPainter methodsFor:'event handling'! |
|
1919 |
||
1920 |
doesNotUnderstand:aMessage |
|
282 | 1921 |
|
1922 |
|painter| |
|
1923 |
||
1924 |
painter := self painter. |
|
1925 |
||
1926 |
(painter respondsTo:(aMessage selector)) ifTrue:[ |
|
109 | 1927 |
^ aMessage sendTo:painter |
282 | 1928 |
]. |
1929 |
super doesNotUnderstand:aMessage |
|
1930 |
||
1931 |
! ! |
|
1932 |
||
1933 |
!UIPainter methodsFor:'menu accessing'! |
|
1934 |
||
1935 |
menuAlignment |
|
1936 |
"returns the pull down menu which keeps the alignment operations |
|
1937 |
" |
|
1938 |
^ self class menuAlignment |
|
1939 |
||
1940 |
! |
|
1941 |
||
1942 |
menuCanvas |
|
1943 |
"returns the middle button menu used by the painter and the tree view |
|
1944 |
" |
|
1945 |
^ [ treeView canvas showMiddleButtonMenu ] |
|
1946 |
! |
|
1947 |
||
1948 |
menuChangeHierarchy |
|
1949 |
"returns the hierarchy pull down menu |
|
1950 |
" |
|
1951 |
^ self class menuChangeHierarchy |
|
1952 |
||
1953 |
||
1954 |
! |
|
1955 |
||
1956 |
menuPullDown |
|
1957 |
"returns the main pull down menu |
|
1958 |
" |
|
1959 |
^ self class menuPullDown |
|
1960 |
||
109 | 1961 |
|
60 | 1962 |
! ! |
1963 |
||
297 | 1964 |
!UIPainter methodsFor:'printing'! |
1965 |
||
1966 |
show:aText |
|
1967 |
transcript hideCursor. |
|
1968 |
transcript contents:aText. |
|
1969 |
||
1970 |
! ! |
|
1971 |
||
109 | 1972 |
!UIPainter methodsFor:'private'! |
1973 |
||
173 | 1974 |
hideUIView:aView |
282 | 1975 |
"hide the view which is an application or top view |
1976 |
" |
|
173 | 1977 |
aView beIndependent. |
1978 |
aView unmap. |
|
1979 |
! |
|
1980 |
||
287 | 1981 |
raiseTabView |
1982 |
||
1983 |
self isLayoutToolSelected ifTrue:[ |
|
1984 |
layoutCanvas raise |
|
1985 |
] ifFalse:[ |
|
1986 |
self isHelpToolSelected ifTrue:[ |
|
1987 |
helpCanvas raise |
|
1988 |
] ifFalse:[ |
|
1989 |
self specTool selection:tabSelection. |
|
1990 |
specCanvas raise |
|
1991 |
] |
|
1992 |
] |
|
173 | 1993 |
! |
1994 |
||
1995 |
raiseUIView:aView |
|
282 | 1996 |
"raise the view which is an application or top view |
1997 |
" |
|
173 | 1998 |
aView map. |
1999 |
aView bePartner. |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2000 |
! |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2001 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2002 |
setClass:cls selector:selector |
282 | 2003 |
"set the application class and the selector under which the |
2004 |
window specification should be stored |
|
2005 |
" |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2006 |
|clsName superClassName| |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2007 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2008 |
clsName := cls name. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2009 |
superClassName := cls superclass name. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2010 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2011 |
(self aspectFor:#classNameChannel) value:clsName. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2012 |
(self aspectFor:#methodNameChannel) value:(selector ? ''). |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2013 |
(self aspectFor:#superclassNameChannel) value:superClassName. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2014 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2015 |
self painter |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2016 |
className:clsName |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2017 |
superclassName:superClassName |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2018 |
selector:(selector ? ''). |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2019 |
|
287 | 2020 |
self specClass:clsName. |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2021 |
specSelector := (selector ? ''). |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2022 |
specSuperclass := superClassName. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2023 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2024 |
"Modified: 24.6.1997 / 19:07:01 / cg" |
282 | 2025 |
! |
2026 |
||
2027 |
setViewInLayoutTool:aView |
|
2028 |
"set view for layout tool |
|
2029 |
" |
|
287 | 2030 |
|type| |
2031 |
||
2032 |
self painter topView == aView ifTrue:[ |
|
2033 |
type := #Extent |
|
2034 |
]. |
|
2035 |
self layoutTool layoutView:aView type:type |
|
2036 |
||
2037 |
! |
|
2038 |
||
2039 |
specClass:aClass |
|
2040 |
specClass := aClass. |
|
2041 |
self helpTool helpSpecFrom:specClass. |
|
2042 |
! ! |
|
2043 |
||
2044 |
!UIPainter methodsFor:'private tools'! |
|
2045 |
||
2046 |
helpTool |
|
2047 |
"returns the help tool |
|
2048 |
" |
|
2049 |
helpCanvas isNil ifTrue:[ |
|
2050 |
self noteBookView |
|
282 | 2051 |
]. |
287 | 2052 |
^ helpCanvas application |
2053 |
! |
|
2054 |
||
2055 |
layoutTool |
|
2056 |
"returns the layout tool |
|
2057 |
" |
|
2058 |
layoutCanvas isNil ifTrue:[ |
|
2059 |
self noteBookView |
|
2060 |
]. |
|
2061 |
^ layoutCanvas application |
|
2062 |
! |
|
2063 |
||
2064 |
painter |
|
2065 |
"returns the painter/canvas view |
|
2066 |
" |
|
2067 |
^ treeView canvas |
|
2068 |
! |
|
2069 |
||
2070 |
specTool |
|
2071 |
"returns the spec tool |
|
2072 |
" |
|
2073 |
specCanvas isNil ifTrue:[ |
|
2074 |
self noteBookView |
|
2075 |
]. |
|
2076 |
^ specCanvas application |
|
109 | 2077 |
! ! |
2078 |
||
166 | 2079 |
!UIPainter methodsFor:'queries'! |
2080 |
||
217 | 2081 |
hasSpecClass |
282 | 2082 |
"checks whether an application class is defined |
2083 |
" |
|
328 | 2084 |
^ (self resolveName:specClass) notNil |
217 | 2085 |
! |
2086 |
||
2087 |
hasSpecClassAndSelector |
|
282 | 2088 |
"checks whether an application class and a selector under which |
2089 |
the window specification is stored is defined. |
|
2090 |
" |
|
217 | 2091 |
specSelector size > 1 ifTrue:[ |
2092 |
^ self hasSpecClass |
|
2093 |
]. |
|
2094 |
^ false |
|
2095 |
! |
|
2096 |
||
166 | 2097 |
isHelpToolSelected |
282 | 2098 |
"returns true if current selected tab in the noteBook is assigned |
2099 |
to the 'Help' tool |
|
2100 |
" |
|
287 | 2101 |
^ tabSelection = UIHelpTool label |
2102 |
||
166 | 2103 |
! |
2104 |
||
2105 |
isLayoutToolSelected |
|
282 | 2106 |
"returns true if current selected tab in the noteBook is assigned |
2107 |
to the 'Layout' tool |
|
2108 |
" |
|
287 | 2109 |
^ tabSelection = UILayoutTool label |
217 | 2110 |
! |
2111 |
||
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2112 |
isModified |
282 | 2113 |
"returns true if current specification or layout is modified |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2114 |
" |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2115 |
^ self modifiedChannel value |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2116 |
! |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2117 |
|
217 | 2118 |
isPainterEnabled |
282 | 2119 |
"returns true if not running in test mode |
2120 |
" |
|
217 | 2121 |
^ self painter enabled |
166 | 2122 |
! ! |
2123 |
||
109 | 2124 |
!UIPainter methodsFor:'selection'! |
2125 |
||
2126 |
tabSelection |
|
282 | 2127 |
"returns name of current selected tab in the notebook. |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2128 |
" |
109 | 2129 |
^ tabSelection |
2130 |
! |
|
2131 |
||
2132 |
tabSelection:something |
|
282 | 2133 |
"the tab selection of the notebook changed |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2134 |
" |
351 | 2135 |
|
2136 |
|whatToDo| |
|
2137 |
||
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2138 |
(something isNil or:[tabSelection = something]) ifTrue:[ |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2139 |
^ self |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2140 |
]. |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2141 |
|
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2142 |
self isModified ifTrue:[ |
351 | 2143 |
whatToDo := DialogBox |
2144 |
confirmWithCancel:'accept change made in ' , tabSelection printString , ' section ?' |
|
2145 |
labels:#('cancel' 'ignore' 'accept') |
|
2146 |
default:3. |
|
2147 |
whatToDo isNil ifTrue:[^self]. |
|
2148 |
whatToDo == true ifTrue:[ |
|
2149 |
self accept |
|
2150 |
] ifFalse:[ |
|
2151 |
self cancel |
|
2152 |
] |
|
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2153 |
]. |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2154 |
|
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2155 |
tabSelection := something. |
287 | 2156 |
self raiseTabView. |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2157 |
self cancel. |
351 | 2158 |
|
2159 |
"Modified: / 26.10.1997 / 15:54:15 / cg" |
|
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2160 |
! |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2161 |
|
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2162 |
treeSelection |
282 | 2163 |
"called whenever the selection of the treeview changed |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2164 |
" |
295 | 2165 |
|view list spec slices size property tabComponent| |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2166 |
|
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2167 |
self isModified ifTrue:[ |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2168 |
(self confirm:'accept change made in ' , tabSelection printString , ' section ?') ifTrue:[ |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2169 |
self accept |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2170 |
] |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2171 |
]. |
282 | 2172 |
self canMoveOrAlignSelection value:(treeView canMoveOrAlignSelection). |
2173 |
self canMoveSelectionIntoContainer value:(treeView canMoveSelectionIntoContainer). |
|
2174 |
self canMoveSelectionOutOfContainer value:(treeView canMoveSelectionOutOfContainer). |
|
2175 |
self hasOneSelectionOtherThanCanvas value:(treeView hasOneSelectionOtherThanCanvas). |
|
2176 |
||
281 | 2177 |
treeView isCanvasSelected ifTrue:[ |
282 | 2178 |
spec := treeView canvasSpec. |
2179 |
view := self painter topView. |
|
2180 |
] ifFalse:[ |
|
2181 |
(property := treeView propertySelected) notNil ifTrue:[ |
|
301 | 2182 |
treeView canResizeSelectedWidget ifTrue:[ |
2183 |
view := property view. |
|
2184 |
]. |
|
282 | 2185 |
spec := property spec copy. |
2186 |
] |
|
281 | 2187 |
]. |
282 | 2188 |
tabComponent := builder componentAt:#noteBook. |
2189 |
self setViewInLayoutTool:view. |
|
287 | 2190 |
self specTool specification:spec. |
282 | 2191 |
|
2192 |
spec notNil ifTrue:[ |
|
287 | 2193 |
self helpTool helpKey:(spec activeHelpKey). |
295 | 2194 |
slices := spec class slices. |
2195 |
size := slices size. |
|
301 | 2196 |
|
2197 |
view notNil ifTrue:[ |
|
2198 |
list := Array new:(size + 2). |
|
2199 |
list at:(size + 2) put:(UILayoutTool label). |
|
2200 |
] ifFalse:[ |
|
2201 |
list := Array new:(size + 1). |
|
2202 |
]. |
|
295 | 2203 |
1 to:size do:[:i| list at:i put:((slices at:i) first asString)]. |
2204 |
list at:(size + 1) put:(UIHelpTool label). |
|
301 | 2205 |
|
282 | 2206 |
self tabList value:list. |
297 | 2207 |
self show:(spec class name). |
282 | 2208 |
tabComponent enabled:true. |
2209 |
||
2210 |
(tabSelection := tabComponent selection) isNil ifTrue:[ |
|
2211 |
tabComponent setSelection:(tabSelection := list first) |
|
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2212 |
]. |
287 | 2213 |
self raiseTabView |
282 | 2214 |
] ifFalse:[ |
287 | 2215 |
self helpTool helpKey:nil. |
282 | 2216 |
tabComponent enabled:false. |
297 | 2217 |
self show:nil. |
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2218 |
]. |
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
2219 |
self modifiedChannel value:false. |
60 | 2220 |
! ! |
2221 |
||
109 | 2222 |
!UIPainter methodsFor:'startup / release'! |
2223 |
||
2224 |
closeRequest |
|
2225 |
"close all windows open by builder |
|
2226 |
" |
|
222 | 2227 |
self painter isModified ifTrue:[ |
268 | 2228 |
(self confirm:'quit without without saving your modifications ?') ifFalse:[ |
133 | 2229 |
^ self |
2230 |
] |
|
2231 |
]. |
|
2232 |
||
222 | 2233 |
treeView model removeDependent:self. |
2234 |
self painter release. |
|
366 | 2235 |
ColorMenu releaseResources. |
60 | 2236 |
|
109 | 2237 |
selectionPanel notNil ifTrue:[ |
183 | 2238 |
selectionPanel masterApplication:nil. |
109 | 2239 |
selectionPanel closeRequest |
2240 |
]. |
|
149 | 2241 |
selectionPanel := nil. |
222 | 2242 |
treeView := nil. |
149 | 2243 |
|
351 | 2244 |
ActiveHelp stopFor:self. |
2245 |
||
109 | 2246 |
super closeRequest. |
2247 |
||
351 | 2248 |
"Modified: / 27.10.1997 / 00:01:30 / cg" |
109 | 2249 |
! |
2250 |
||
2251 |
closeRequestFor:aTopView |
|
2252 |
"handle a close request for a specific view |
|
2253 |
" |
|
173 | 2254 |
|topView| |
60 | 2255 |
|
109 | 2256 |
topView := self window. |
60 | 2257 |
|
109 | 2258 |
topView == aTopView ifTrue:[ |
2259 |
super closeRequestFor:aTopView |
|
2260 |
] ifFalse:[ |
|
173 | 2261 |
aTopView = selectionPanel window ifTrue:[ |
2262 |
self galleryShown value:false |
|
2263 |
] ifFalse:[ |
|
2264 |
self painterShown value:false |
|
2265 |
]. |
|
133 | 2266 |
topView raise. |
109 | 2267 |
]. |
60 | 2268 |
! |
2269 |
||
345 | 2270 |
openInterface:aSymbol |
109 | 2271 |
"open interfaces |
2272 |
" |
|
345 | 2273 |
|painterView painter cls topView| |
60 | 2274 |
|
2275 |
aspects := IdentityDictionary new. |
|
2276 |
||
2277 |
aspects at:#classNameChannel put:( |
|
2278 |
(specClass notNil ifTrue:[specClass] |
|
2279 |
ifFalse:['NewApplication']) asValue |
|
2280 |
). |
|
2281 |
specSuperclass isNil ifTrue:[ |
|
2282 |
specClass notNil ifTrue:[ |
|
328 | 2283 |
(cls := self resolveName:specClass) notNil ifTrue:[ |
60 | 2284 |
specSuperclass := cls superclass name. |
2285 |
] |
|
2286 |
] |
|
2287 |
]. |
|
2288 |
aspects at:#superclassNameChannel put:( |
|
2289 |
(specSuperclass notNil ifTrue:[specSuperclass] |
|
2290 |
ifFalse:['ApplicationModel']) asValue |
|
2291 |
). |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2292 |
aspects at:#superclassNameDefaults put:#('ApplicationModel' 'SimpleDialog') asValue. |
60 | 2293 |
aspects at:#methodNameChannel put:( |
161 | 2294 |
(specSelector notNil ifTrue:[specSelector asValue] |
60 | 2295 |
ifFalse:[#windowSpec]) asValue |
2296 |
). |
|
136 | 2297 |
|
222 | 2298 |
treeView := TreeView new. |
136 | 2299 |
painterView := StandardSystemView new. |
2300 |
painterView label:'unnamed canvas'. |
|
2301 |
painterView extent:300@300. |
|
2302 |
||
2303 |
painter := UIPainterView in:painterView. |
|
109 | 2304 |
painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout. |
136 | 2305 |
|
222 | 2306 |
treeView := treeView canvas:painter. |
2307 |
painter treeView:treeView. |
|
2308 |
treeView model addDependent:self. |
|
136 | 2309 |
|
345 | 2310 |
super openInterface:aSymbol. |
2311 |
||
297 | 2312 |
transcript := (self builder componentAt:#Transcript) scrolledView. |
136 | 2313 |
topView := self window. |
2314 |
topView bePartner. |
|
345 | 2315 |
topView label:'GUI Painter'. |
136 | 2316 |
|
2317 |
painterView openInGroup:(topView windowGroup). |
|
2318 |
painterView bePartner. |
|
2319 |
painterView application:self. |
|
2320 |
painterView open. |
|
2321 |
||
2322 |
painterView application:self. |
|
183 | 2323 |
selectionPanel := UISelectionPanel new. |
136 | 2324 |
selectionPanel allButOpenInterface:#windowSpec. |
345 | 2325 |
selectionPanel window openInGroup:(topView windowGroup). |
2326 |
selectionPanel window bePartner. |
|
136 | 2327 |
selectionPanel openWindow. |
183 | 2328 |
selectionPanel masterApplication:self. |
274 | 2329 |
|
345 | 2330 |
topView iconLabel:'GUI Painter'. |
2331 |
topView icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100). |
|
2332 |
||
2333 |
painterView iconLabel:'GUI Painter'. |
|
2334 |
painterView icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100). |
|
2335 |
||
2336 |
selectionPanel window iconLabel:'GUI Painter'. |
|
2337 |
selectionPanel window icon:(Image fromFile:'bitmaps/UIPainter.xbm' resolution:100). |
|
2338 |
||
351 | 2339 |
ActiveHelp startFor:self. |
2340 |
||
2341 |
"Modified: / 27.10.1997 / 00:01:12 / cg" |
|
60 | 2342 |
! |
2343 |
||
2344 |
openNewWindowCanvas |
|
109 | 2345 |
"open new |
2346 |
" |
|
60 | 2347 |
self open. |
2348 |
||
2349 |
||
2350 |
! |
|
2351 |
||
109 | 2352 |
openOnClass:aClass |
2353 |
"open up an interface builder |
|
2354 |
" |
|
2355 |
self openOnClass:aClass andSelector:#windowSpec |
|
2356 |
! |
|
2357 |
||
60 | 2358 |
openOnClass:aClass andSelector:aSelector |
2359 |
"open up an interface builder, fetching a spec from someClass |
|
109 | 2360 |
via some selector |
2361 |
" |
|
2362 |
|painter| |
|
60 | 2363 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2364 |
aClass isNil ifTrue:[ |
351 | 2365 |
(self confirm:'nil class given to UIPainter (class was probably renamed ?)\\Open anyway (to create a new interface) ?' withCRs) |
2366 |
ifFalse:[^ nil]. |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2367 |
]. |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2368 |
|
109 | 2369 |
self openInterface. |
60 | 2370 |
|
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2371 |
aClass notNil ifTrue:[ |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2372 |
painter := self painter. |
60 | 2373 |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2374 |
self setClass:aClass selector:aSelector. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2375 |
"/ specClass := aClass name. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2376 |
"/ specSuperclass := aClass superclass name. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2377 |
"/ specSelector := aSelector. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2378 |
"/ |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2379 |
"/ (aspects at:#classNameChannel) value:specClass. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2380 |
"/ (aspects at:#superclassNameChannel) value:specSuperclass. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2381 |
"/ (aspects at:#methodNameChannel) value:specSelector asSymbol. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2382 |
"/ |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2383 |
"/ painter |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2384 |
"/ className:aClass name |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2385 |
"/ superclassName:aClass superclass name |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2386 |
"/ selector:aSelector. |
60 | 2387 |
|
195
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2388 |
(aClass respondsTo:aSelector) ifTrue:[ |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2389 |
painter setupFromSpec:(aClass perform:aSelector). |
350f95af5d9d
check before sending selector to class
Claus Gittinger <cg@exept.de>
parents:
194
diff
changeset
|
2390 |
] |
157
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2391 |
] |
ce974dce3dd4
enhanced class & method dialog
Claus Gittinger <cg@exept.de>
parents:
156
diff
changeset
|
2392 |
|
351 | 2393 |
"Modified: / 25.10.1997 / 19:11:51 / cg" |
60 | 2394 |
! ! |
2395 |
||
109 | 2396 |
!UIPainter methodsFor:'user interaction - dialog'! |
60 | 2397 |
|
2398 |
checkClassAndSelector |
|
2399 |
"check for class & superclass" |
|
2400 |
||
2401 |
|superclass cls| |
|
2402 |
||
2403 |
specClass isNil ifTrue:[^ false]. |
|
2404 |
||
328 | 2405 |
cls := self resolveName:specClass. |
2406 |
||
60 | 2407 |
cls isNil ifTrue:[ |
328 | 2408 |
superclass := self resolveName:specSuperclass. |
2409 |
||
2410 |
superclass isNil ifTrue:[ |
|
60 | 2411 |
self warn:'no class named ' , specSuperclass , ' exists.'. |
2412 |
^ false. |
|
2413 |
]. |
|
2414 |
(self confirm:'create ' , specClass , ' ?') ifTrue:[ |
|
2415 |
superclass subclass:(specClass asSymbol) |
|
2416 |
instanceVariableNames:'' |
|
2417 |
classVariableNames:'' |
|
2418 |
poolDictionaries:'' |
|
280 | 2419 |
category:'Applications'. |
60 | 2420 |
^ true. |
2421 |
]. |
|
2422 |
^ false. |
|
2423 |
]. |
|
2424 |
cls isBehavior ifFalse:[ |
|
2425 |
self warn:'a global named ' , specClass , ' exists, but is no class.'. |
|
2426 |
^ false. |
|
2427 |
]. |
|
2428 |
||
2429 |
specSuperclass isBehavior ifFalse:[ |
|
179 | 2430 |
specSuperclass isEmpty ifFalse:[ |
328 | 2431 |
superclass := self resolveName:specSuperclass |
179 | 2432 |
] ifTrue:[ |
2433 |
specSuperclass := nil. |
|
2434 |
] |
|
60 | 2435 |
] ifTrue:[ |
2436 |
superclass := specSuperclass |
|
2437 |
]. |
|
179 | 2438 |
|
60 | 2439 |
specSuperclass notNil ifTrue:[ |
2440 |
superclass isNil ifTrue:[ |
|
2441 |
self warn:'no class named ' , specSuperclass , ' exists.'. |
|
2442 |
^ false. |
|
2443 |
]. |
|
2444 |
||
2445 |
(cls isSubclassOf:superclass) ifFalse:[ |
|
206 | 2446 |
self information:('a global named ' , specClass , ' exists,\' , |
2447 |
'but is not a subclass of ' , superclass name , '.\\' , |
|
2448 |
'Check and try again if that is not what you want.') withCRs. |
|
60 | 2449 |
] |
2450 |
]. |
|
179 | 2451 |
|
2452 |
superclass isNil ifTrue:[ |
|
2453 |
cls notNil ifTrue:[ |
|
2454 |
specSuperclass := cls superclass name |
|
2455 |
] |
|
2456 |
]. |
|
2457 |
||
60 | 2458 |
^ true |
109 | 2459 |
|
280 | 2460 |
"Modified: 12.8.1997 / 23:39:10 / cg" |
60 | 2461 |
! |
2462 |
||
2463 |
defineClassAndSelector |
|
2464 |
"launch a dialog to define class, superclass and method" |
|
2465 |
||
176 | 2466 |
|again tmp| |
60 | 2467 |
|
2468 |
[ |
|
2469 |
again := false. |
|
160 | 2470 |
|
176 | 2471 |
(tmp := specClass) isNil ifTrue:[tmp := 'NewApplication']. |
2472 |
aspects at:#classNameChannel put:tmp asValue. |
|
2473 |
||
2474 |
(tmp := specSelector) isNil ifTrue:[tmp := 'windowSpec']. |
|
2475 |
aspects at:#methodNameChannel put:tmp asValue. |
|
2476 |
||
2477 |
(tmp := specSuperclass) isNil ifTrue:[tmp := 'ApplicationModel']. |
|
2478 |
aspects at:#superclassNameChannel put:tmp asValue. |
|
160 | 2479 |
|
60 | 2480 |
(self openDialogInterface:#nameAndSelectorSpec) ifTrue:[ |
2481 |
||
287 | 2482 |
specClass := (self aspectFor:#classNameChannel) value. |
60 | 2483 |
specSelector := (self aspectFor:#methodNameChannel) value. |
161 | 2484 |
specSelector notNil ifTrue:[specSelector := specSelector asSymbol]. |
60 | 2485 |
specSuperclass := (self aspectFor:#superclassNameChannel) value. |
2486 |
||
109 | 2487 |
(again := self checkClassAndSelector not) ifFalse:[ |
2488 |
self painter className:specClass |
|
2489 |
superclassName:specSuperclass |
|
2490 |
selector:specSelector. |
|
2491 |
] |
|
60 | 2492 |
] |
109 | 2493 |
|
287 | 2494 |
] doWhile:[again]. |
2495 |
||
2496 |
self specClass:specClass. |
|
366 | 2497 |
! |
2498 |
||
2499 |
gridMenu |
|
2500 |
"open a dialog for grip parameters configuration |
|
2501 |
" |
|
2502 |
|hspace vspace bindings painter gridPara| |
|
2503 |
||
2504 |
painter := self painter. |
|
2505 |
bindings := IdentityDictionary new. |
|
2506 |
gridPara := painter gridParameters copy. |
|
2507 |
||
2508 |
bindings at:#showGrid put:(painter gridShown asValue). |
|
2509 |
bindings at:#alignToGrid put:(painter gridAlign asValue). |
|
2510 |
bindings at:#hspace put:((gridPara at:1) asValue). |
|
2511 |
bindings at:#vspace put:((gridPara at:2) asValue). |
|
2512 |
||
2513 |
(self openDialogInterface:#gridParametersSpec withBindings:bindings) ifFalse:[ |
|
2514 |
^ self |
|
2515 |
]. |
|
2516 |
||
2517 |
hspace := (bindings at:#hspace) value ? 5. |
|
2518 |
vspace := (bindings at:#vspace) value ? 5. |
|
2519 |
||
2520 |
gridPara at:1 put:hspace. |
|
2521 |
gridPara at:2 put:vspace. |
|
2522 |
gridPara at:5 put:hspace. |
|
2523 |
gridPara at:6 put:vspace. |
|
2524 |
||
2525 |
painter gridShown:false. |
|
2526 |
painter gridAlign:false. |
|
2527 |
painter gridParameters:gridPara. |
|
2528 |
painter gridAlign:(bindings at:#alignToGrid) value. |
|
2529 |
painter gridShown:(bindings at:#showGrid) value. |
|
2530 |
||
2531 |
||
60 | 2532 |
! ! |
2533 |
||
222 | 2534 |
!UIPainter methodsFor:'user interaction - move'! |
2535 |
||
2536 |
doStepDown |
|
282 | 2537 |
"move selected component after the next component in the hierarchy of |
2538 |
its container widget |
|
2539 |
" |
|
222 | 2540 |
treeView doStepOver:1 |
2541 |
! |
|
2542 |
||
2543 |
doStepIn |
|
282 | 2544 |
"change the container of the selected widget |
2545 |
" |
|
222 | 2546 |
treeView doStepIn |
2547 |
! |
|
2548 |
||
2549 |
doStepOut |
|
282 | 2550 |
"change the container of the selected widget |
2551 |
" |
|
222 | 2552 |
treeView doStepOut |
2553 |
! |
|
2554 |
||
2555 |
doStepUp |
|
282 | 2556 |
"move selected component before the previous component in the hierarchy of |
2557 |
its container widget |
|
2558 |
" |
|
222 | 2559 |
treeView doStepOver:-1 |
2560 |
! ! |
|
2561 |
||
109 | 2562 |
!UIPainter methodsFor:'user interaction - pullDown'! |
60 | 2563 |
|
149 | 2564 |
doBrowseAppClass |
2565 |
"open a browser on the class" |
|
2566 |
||
2567 |
|cls| |
|
2568 |
||
268 | 2569 |
self painter isModified ifTrue:[ |
2570 |
self warn:'the change have not yet been reinstalled.\\The browser will show the old interfaces code.' withCRs. |
|
2571 |
]. |
|
328 | 2572 |
cls := self resolveName:specClass. |
2573 |
||
2574 |
cls notNil ifTrue:[ |
|
2575 |
SystemBrowser openInClass:cls |
|
2576 |
] ifFalse:[ |
|
2577 |
self information:'no class yet'. |
|
149 | 2578 |
]. |
2579 |
||
2580 |
! |
|
2581 |
||
351 | 2582 |
doBrowseAspectMethods |
2583 |
"open a browser on the aspect methods" |
|
2584 |
||
2585 |
|cls methods| |
|
2586 |
||
2587 |
self painter isModified ifTrue:[ |
|
2588 |
self warn:'the changes have not yet been reinstalled.\\The browser may show old code.' withCRs. |
|
2589 |
]. |
|
2590 |
cls := self resolveName:specClass. |
|
2591 |
||
2592 |
cls notNil ifTrue:[ |
|
2593 |
methods := self painter aspectMethods. |
|
2594 |
methods isEmpty ifTrue:[ |
|
2595 |
self warn:'no aspect methods have been installed yet.'. |
|
2596 |
^ self. |
|
2597 |
]. |
|
2598 |
SystemBrowser browseMethods:methods title:'aspect methods'. |
|
2599 |
] ifFalse:[ |
|
2600 |
self information:'no class yet'. |
|
2601 |
]. |
|
2602 |
||
2603 |
"Created: / 25.10.1997 / 19:07:55 / cg" |
|
2604 |
! |
|
2605 |
||
60 | 2606 |
doFromClass |
282 | 2607 |
"setup new specification from a class and selector accessed through |
2608 |
to a dialog |
|
2609 |
" |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2610 |
|className methodName cls sel accepted failed spec s painter| |
109 | 2611 |
|
222 | 2612 |
self painter isModified ifTrue:[ |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2613 |
(self confirm:'edit another interface without saving your modifications ?') ifFalse:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2614 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2615 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2616 |
]. |
60 | 2617 |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2618 |
className := (specClass ? '') asValue. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2619 |
methodName := (specSelector ? '') asValue. |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2620 |
painter := self painter. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2621 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2622 |
(s := painter className) notNil ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2623 |
className value:s |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2624 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2625 |
(s := painter methodName) notNil ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2626 |
methodName value:s |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2627 |
]. |
60 | 2628 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2629 |
failed := false. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2630 |
[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2631 |
accepted := |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2632 |
(DialogBox new |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2633 |
addTextLabel:'Classes name:'; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2634 |
addInputFieldOn:className; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2635 |
addVerticalSpace; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2636 |
addTextLabel:'methods name:'; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2637 |
addInputFieldOn:methodName; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2638 |
addAbortButton; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2639 |
addOkButton; |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2640 |
open |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2641 |
) accepted. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2642 |
|
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2643 |
accepted ifTrue:[ |
348 | 2644 |
cls := self resolveName:className value. |
328 | 2645 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2646 |
cls isNil ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2647 |
failed := true. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2648 |
self warn:'no such class'. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2649 |
] ifFalse:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2650 |
sel := methodName value asSymbol. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2651 |
(cls respondsTo:sel ) ifFalse:[ |
60 | 2652 |
failed := true. |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2653 |
self warn:'no such method' |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2654 |
] ifTrue:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2655 |
spec := cls perform:sel. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2656 |
spec isArray ifFalse:[ |
60 | 2657 |
failed := true. |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2658 |
self warn:'not a windowSpec method' |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2659 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2660 |
"/ ok, got it |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2661 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2662 |
self setClass:cls selector:sel. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2663 |
|
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2664 |
painter setupFromSpec:spec. |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2665 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2666 |
^ self |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2667 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2668 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2669 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2670 |
] doWhile:[accepted and:[failed]]. |
60 | 2671 |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2672 |
"Modified: 24.6.1997 / 18:59:29 / cg" |
60 | 2673 |
! |
2674 |
||
2675 |
doInstallAspects |
|
282 | 2676 |
"install aspects and actions |
2677 |
" |
|
60 | 2678 |
|code| |
2679 |
||
217 | 2680 |
self hasSpecClassAndSelector ifFalse:[ |
60 | 2681 |
self defineClassAndSelector |
2682 |
]. |
|
2683 |
||
2684 |
self checkClassAndSelector ifFalse:[ |
|
2685 |
^ self |
|
2686 |
]. |
|
2687 |
||
109 | 2688 |
self painter className:specClass |
2689 |
superclassName:specSuperclass |
|
2690 |
selector:specSelector. |
|
60 | 2691 |
|
109 | 2692 |
code := self painter generateAspectMethods. |
60 | 2693 |
(ReadStream on:code) fileIn. |
2694 |
||
2695 |
! |
|
2696 |
||
152 | 2697 |
doInstallHelp |
197 | 2698 |
"install help text |
171 | 2699 |
" |
287 | 2700 |
self helpTool installHelpSpecInto:specClass |
152 | 2701 |
! |
2702 |
||
60 | 2703 |
doInstallSpec |
282 | 2704 |
"install window specification |
2705 |
" |
|
176 | 2706 |
|code painter| |
60 | 2707 |
|
217 | 2708 |
self hasSpecClassAndSelector ifFalse:[ |
60 | 2709 |
self defineClassAndSelector |
2710 |
]. |
|
2711 |
||
2712 |
self checkClassAndSelector ifFalse:[ |
|
2713 |
^ self |
|
2714 |
]. |
|
351 | 2715 |
|
2716 |
self isModified ifTrue:[ |
|
2717 |
(self confirm:'accept change made in ' , tabSelection printString , ' section ?') ifTrue:[ |
|
2718 |
self accept |
|
2719 |
] ifFalse:[ |
|
2720 |
(self confirm:'install old specification ?') ifFalse:[ |
|
2721 |
^ self |
|
2722 |
] |
|
2723 |
] |
|
2724 |
]. |
|
2725 |
||
176 | 2726 |
painter := self painter. |
60 | 2727 |
|
176 | 2728 |
painter className:specClass |
2729 |
superclassName:specSuperclass |
|
2730 |
selector:specSelector. |
|
60 | 2731 |
|
176 | 2732 |
code := painter generateWindowSpecMethodSource withCRs. |
2733 |
painter resetModification. |
|
60 | 2734 |
(ReadStream on:code) fileIn. |
2735 |
||
351 | 2736 |
"Modified: / 26.10.1997 / 15:47:48 / cg" |
60 | 2737 |
! |
2738 |
||
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2739 |
doNew |
282 | 2740 |
"remove all components and associated resources |
2741 |
" |
|
222 | 2742 |
self painter isModified ifTrue:[ |
268 | 2743 |
(self confirm:'edit a new interface without saving your modifications ?') ifFalse:[ |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2744 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2745 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2746 |
]. |
282 | 2747 |
self painter removeAll |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2748 |
! |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2749 |
|
60 | 2750 |
doPickAView |
282 | 2751 |
"pick a view and setup specifications |
2752 |
" |
|
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2753 |
|painter view cls spec| |
60 | 2754 |
|
222 | 2755 |
self painter isModified ifTrue:[ |
155
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2756 |
(self confirm:'pick another interface without saving your modifications ?') ifFalse:[ |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2757 |
^ self |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2758 |
] |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2759 |
]. |
575239b7ad0b
confirm pick/new/fromClass if unsaved & modified
Claus Gittinger <cg@exept.de>
parents:
152
diff
changeset
|
2760 |
|
171 | 2761 |
(view := Screen current viewFromUser) notNil ifTrue:[ |
174 | 2762 |
view == Screen current rootView ifFalse:[ |
2763 |
painter := self painter. |
|
2764 |
spec := UISpecification fromView:view topView. |
|
60 | 2765 |
|
174 | 2766 |
"/ ok, got it |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2767 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2768 |
view application notNil ifTrue:[ |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2769 |
cls := view application class |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2770 |
] ifFalse:[ |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2771 |
cls := view class |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2772 |
]. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2773 |
self setClass:cls selector:nil. |
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2774 |
|
174 | 2775 |
painter setupFromSpec:spec. |
2776 |
] |
|
109 | 2777 |
] |
177
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2778 |
|
eefd69a52f5b
fixed setup of class/selector when picking/fetching via
Claus Gittinger <cg@exept.de>
parents:
176
diff
changeset
|
2779 |
"Modified: 24.6.1997 / 19:02:57 / cg" |
60 | 2780 |
! |
2781 |
||
149 | 2782 |
doStartApplication |
282 | 2783 |
"start current edited application |
2784 |
" |
|
351 | 2785 |
|cls app infoMessage| |
2786 |
||
2787 |
self isModified ifTrue:[ |
|
2788 |
(self confirm:'accept change made in ' , tabSelection printString , ' section ?') ifTrue:[ |
|
2789 |
self accept. |
|
363 | 2790 |
"/ "XXX must be fixed - canvas changes are not recorded in the history |
2791 |
"/ so isModified returns false here |
|
2792 |
"/ |
|
2793 |
"/ self painter isModified ifTrue:[ |
|
2794 |
"/ |
|
351 | 2795 |
(self confirm:'reinstall the new spec ?' withCRs) ifTrue:[ |
2796 |
self doInstallSpec |
|
2797 |
] |
|
363 | 2798 |
"/ ]. |
351 | 2799 |
] |
2800 |
]. |
|
268 | 2801 |
self painter isModified ifTrue:[ |
2802 |
(self confirm:'the changed spec has not yet been reinstalled.\\Start anyway (based upon the previous interface) ?' withCRs) ifFalse:[ |
|
2803 |
^ self |
|
2804 |
] |
|
2805 |
]. |
|
2806 |
||
217 | 2807 |
(specClass isNil or:[specSelector size < 2]) ifTrue:[ |
351 | 2808 |
infoMessage := 'no class or selector defined'. |
2809 |
] ifFalse:[ |
|
2810 |
cls := self resolveName:specClass. |
|
2811 |
||
2812 |
cls isNil ifTrue:[ |
|
2813 |
infoMessage := 'class not existant'. |
|
2814 |
] ifFalse:[ |
|
2815 |
(cls respondsTo:specSelector) ifFalse:[ |
|
2816 |
infoMessage := ('no method for: #' |
|
2817 |
, specSelector , ' in ' , cls name |
|
2818 |
, '\\(did you install the spec ?)') withCRs. |
|
2819 |
] |
|
2820 |
] |
|
149 | 2821 |
]. |
2822 |
||
351 | 2823 |
infoMessage notNil ifTrue:[ |
2824 |
^ self information:infoMessage |
|
149 | 2825 |
]. |
351 | 2826 |
app := cls new. |
2827 |
(app respondsTo:#openInterface:) ifFalse:[ |
|
2828 |
^ self warn:('The application does not respond to the ''openInterface:'' message.\\(maybe its supposed to be used as subApplication/subCanvas)') withCRs. |
|
2829 |
]. |
|
2830 |
app openInterface:specSelector |
|
2831 |
||
363 | 2832 |
"Modified: / 29.10.1997 / 19:01:50 / cg" |
149 | 2833 |
! |
2834 |
||
60 | 2835 |
doWindowSpec |
282 | 2836 |
"create the window specification but do not write to application; instead |
2837 |
open a view |
|
2838 |
" |
|
250 | 2839 |
|code v| |
60 | 2840 |
|
109 | 2841 |
code := self painter generateWindowSpecMethodSource. |
68 | 2842 |
|
60 | 2843 |
v := CodeView open. |
2844 |
v contents:code. |
|
2845 |
v label:'windowSpec'. |
|
2846 |
||
81 | 2847 |
! ! |
2848 |
||
222 | 2849 |
!UIPainter::TreeView class methodsFor:'constants'! |
2850 |
||
282 | 2851 |
defaultNameOfCanvas |
2852 |
"returns the default name (id) of the application |
|
2853 |
" |
|
2854 |
^ 'Canvas' |
|
2855 |
! |
|
2856 |
||
2857 |
imageEmptyParent |
|
358 | 2858 |
<resource: #fileImage> |
2859 |
||
282 | 2860 |
|
2861 |
ImageEmptyParent isNil ifTrue:[ |
|
2862 |
ImageEmptyParent := Image fromFile:('xpmBitmaps/document_images/tiny_dir.xpm'). |
|
2863 |
]. |
|
2864 |
^ ImageEmptyParent |
|
2865 |
||
2866 |
" |
|
2867 |
ImageEmptyParent := nil |
|
2868 |
" |
|
358 | 2869 |
|
2870 |
"Modified: / 29.10.1997 / 03:36:37 / cg" |
|
282 | 2871 |
! |
2872 |
||
222 | 2873 |
imageMasterChild |
358 | 2874 |
<resource: #fileImage> |
2875 |
||
222 | 2876 |
|
2877 |
ImageMasterChild isNil ifTrue:[ |
|
248 | 2878 |
ImageMasterChild := Image fromFile:('xpmBitmaps/document_images/tiny_file_plain_gray.xpm'). |
222 | 2879 |
]. |
248 | 2880 |
^ ImageMasterChild |
2881 |
||
2882 |
" |
|
2883 |
ImageMasterChild := nil |
|
2884 |
" |
|
2885 |
||
358 | 2886 |
"Modified: / 29.10.1997 / 03:36:42 / cg" |
222 | 2887 |
! |
2888 |
||
2889 |
imageMasterParent |
|
358 | 2890 |
<resource: #fileImage> |
2891 |
||
222 | 2892 |
|
2893 |
ImageMasterParent isNil ifTrue:[ |
|
248 | 2894 |
ImageMasterParent := Image fromFile:('xpmBitmaps/document_images/tiny_yellow_dir_gray.xpm'). |
222 | 2895 |
]. |
248 | 2896 |
^ ImageMasterParent |
2897 |
||
2898 |
" |
|
2899 |
ImageMasterParent := nil |
|
2900 |
" |
|
2901 |
||
358 | 2902 |
"Modified: / 29.10.1997 / 03:36:47 / cg" |
222 | 2903 |
! ! |
2904 |
||
2905 |
!UIPainter::TreeView class methodsFor:'documentation'! |
|
2906 |
||
2907 |
documentation |
|
2908 |
" |
|
2909 |
selection in tree view; only used by the UIPainter |
|
2910 |
||
2911 |
[see also:] |
|
2912 |
SelectionInTreeView |
|
2913 |
SelectionInTree |
|
2914 |
TreeItem |
|
2915 |
UIPainter |
|
2916 |
||
2917 |
[author:] |
|
2918 |
Claus Atzkern |
|
2919 |
" |
|
2920 |
||
2921 |
||
2922 |
! ! |
|
2923 |
||
2924 |
!UIPainter::TreeView methodsFor:'accessing'! |
|
2925 |
||
2926 |
canvas |
|
2927 |
"returns the canvas( UIPainter ) |
|
2928 |
" |
|
2929 |
^ model root contents view |
|
2930 |
||
2931 |
||
2932 |
! |
|
2933 |
||
2934 |
canvas:aCanvas |
|
2935 |
"install canvas( UIPainter ) |
|
2936 |
" |
|
2937 |
|props| |
|
2938 |
||
2939 |
props := UIPainterView::ViewProperty new. |
|
2940 |
props view:aCanvas. |
|
282 | 2941 |
model root:(TreeItem name:(self class defaultNameOfCanvas) contents:props). |
222 | 2942 |
model root expand. |
2943 |
self enableChannel:(aCanvas enableChannel). |
|
2944 |
||
281 | 2945 |
! |
2946 |
||
2947 |
canvasSpec |
|
2948 |
"returns spec assigned to canvas |
|
2949 |
" |
|
2950 |
|spec| |
|
2951 |
||
2952 |
spec := WindowSpec new. |
|
311 | 2953 |
|
281 | 2954 |
spec fromView:(self canvas topView) callBack:nil. |
2955 |
spec name:(listOfNodes at:1) name. |
|
311 | 2956 |
|
2957 |
windowSpec notNil ifTrue:[ |
|
362 | 2958 |
spec copyValuesFromSpec:windowSpec |
311 | 2959 |
]. |
362 | 2960 |
^ spec |
2961 |
||
2962 |
"Modified: / 29.10.1997 / 18:06:44 / cg" |
|
282 | 2963 |
! |
2964 |
||
311 | 2965 |
canvasSpec:aSpec |
2966 |
"update canvas from spec |
|
2967 |
" |
|
2968 |
|spec| |
|
2969 |
||
2970 |
self setAttributesFromWindowSpec:aSpec. |
|
2971 |
spec := aSpec copy. |
|
2972 |
spec menu:nil. |
|
2973 |
spec flags:nil. |
|
2974 |
||
2975 |
spec setAttributesIn:(self canvas topView) with:(UIBuilder new). |
|
2976 |
! |
|
2977 |
||
282 | 2978 |
itemOfView:aView |
2979 |
"returns item assigned to view or nil |
|
2980 |
" |
|
2981 |
aView notNil ifTrue:[ |
|
2982 |
self allItemsDo:[:anItem| |
|
2983 |
(anItem contents view == aView) ifTrue:[^ anItem] |
|
2984 |
] |
|
2985 |
]. |
|
2986 |
^ nil |
|
2987 |
||
2988 |
||
222 | 2989 |
! ! |
2990 |
||
2991 |
!UIPainter::TreeView methodsFor:'accessing property'! |
|
2992 |
||
2993 |
propertiesDo:aOneArgBlock |
|
2994 |
"evaluate the argument a block on each property |
|
2995 |
" |
|
2996 |
self allItemsDo:[:anItem| aOneArgBlock value:(anItem contents)] |
|
2997 |
||
2998 |
||
2999 |
! |
|
3000 |
||
3001 |
propertyDetect:aOneArgBlock |
|
3002 |
"evaluate the block on each property |
|
3003 |
" |
|
3004 |
self allItemsDo:[:anItem| |
|
3005 |
(aOneArgBlock value:(anItem contents)) ifTrue:[^ anItem contents] |
|
3006 |
]. |
|
3007 |
^ nil |
|
3008 |
||
3009 |
! |
|
3010 |
||
3011 |
propertySelected |
|
3012 |
"returns current selected property or nil in case of multi selection |
|
3013 |
or empty selection |
|
3014 |
" |
|
3015 |
|idx| |
|
3016 |
||
3017 |
selection size == 1 ifTrue:[ |
|
3018 |
(idx := selection first) ~~ 1 ifTrue:[ "canvas: not yet supported" |
|
3019 |
^ (listOfNodes at:idx) contents |
|
3020 |
] |
|
3021 |
]. |
|
3022 |
^ nil |
|
3023 |
||
3024 |
! ! |
|
3025 |
||
3026 |
!UIPainter::TreeView methodsFor:'adding & removing'! |
|
3027 |
||
3028 |
addProperty:aProperty |
|
3029 |
"add a new item |
|
3030 |
" |
|
295 | 3031 |
|parent| |
3032 |
||
3033 |
parent := self detectItemRespondsToView:(aProperty view superView). |
|
3034 |
||
3035 |
parent notNil ifTrue:[ |
|
3036 |
model add:(TreeItem name:(aProperty name) contents:aProperty) below:parent |
|
3037 |
] |
|
222 | 3038 |
|
3039 |
! |
|
3040 |
||
3041 |
removeAll |
|
3042 |
"remove all items other than canvas |
|
3043 |
" |
|
3044 |
lastDrawnMaster := nil. |
|
311 | 3045 |
windowSpec := nil. |
222 | 3046 |
|
3047 |
self canvas subViews copy do:[:aView| |
|
3048 |
(aView isKindOf:InputView) ifFalse:[aView destroy] |
|
3049 |
]. |
|
282 | 3050 |
model root name:(self class defaultNameOfCanvas). |
222 | 3051 |
model root children:(OrderedCollection new). |
3052 |
model recomputeList. |
|
3053 |
self selection:nil. |
|
3054 |
||
3055 |
||
3056 |
! |
|
3057 |
||
3058 |
removeView:aView |
|
3059 |
"remove a view |
|
3060 |
" |
|
282 | 3061 |
|item prnt| |
3062 |
||
3063 |
((item := self itemOfView:aView) notNil and:[(prnt := item parent) notNil]) ifTrue:[ |
|
222 | 3064 |
aView destroy. |
282 | 3065 |
prnt contents view sizeChanged:nil. |
222 | 3066 |
model remove:item |
3067 |
] |
|
3068 |
||
3069 |
||
3070 |
! ! |
|
3071 |
||
311 | 3072 |
!UIPainter::TreeView methodsFor:'building'! |
3073 |
||
3074 |
generateFullSpecForComponents:aSpecArray |
|
351 | 3075 |
"generates a full spec for components |
311 | 3076 |
" |
351 | 3077 |
|fullSpec winSpec| |
311 | 3078 |
|
3079 |
fullSpec := FullSpec new. |
|
3080 |
||
3081 |
fullSpec fromBuilder:(self canvas topView) |
|
3082 |
components:(SpecCollection new collection:aSpecArray). |
|
3083 |
||
3084 |
windowSpec notNil ifTrue:[ |
|
351 | 3085 |
winSpec := fullSpec window. |
362 | 3086 |
winSpec copyValuesFromSpec:windowSpec |
311 | 3087 |
]. |
3088 |
^ fullSpec literalArrayEncoding. |
|
351 | 3089 |
|
362 | 3090 |
"Modified: / 29.10.1997 / 18:05:58 / cg" |
311 | 3091 |
! |
3092 |
||
3093 |
setAttributesFromWindowSpec:aWindowSpec |
|
3094 |
"set windowSpec from argument a WindowSpec |
|
3095 |
" |
|
362 | 3096 |
windowSpec := WindowSpec new copyValuesFromSpec:aWindowSpec. |
311 | 3097 |
self canvasNameChanged:aWindowSpec name. |
362 | 3098 |
|
3099 |
"Modified: / 29.10.1997 / 18:06:56 / cg" |
|
311 | 3100 |
! ! |
3101 |
||
222 | 3102 |
!UIPainter::TreeView methodsFor:'canvas selection'! |
3103 |
||
3104 |
cvsSelection:aSelection |
|
3105 |
"canvas changed its selection |
|
3106 |
" |
|
3107 |
|sel list rcLt| |
|
3108 |
||
3109 |
list := OrderedCollection new. |
|
3110 |
||
3111 |
aSelection isNil ifFalse:[ |
|
3112 |
aSelection isCollection ifTrue:[ |
|
3113 |
aSelection notNil ifTrue:[sel := aSelection] |
|
3114 |
] ifFalse:[ |
|
3115 |
sel := Array with:aSelection |
|
3116 |
] |
|
3117 |
]. |
|
3118 |
||
3119 |
sel notNil ifTrue:[ |
|
3120 |
rcLt := false. |
|
3121 |
||
3122 |
sel do:[:aView||item| |
|
3123 |
(item := self itemOfView:aView) notNil ifTrue:[ |
|
3124 |
list add:item. |
|
3125 |
||
3126 |
[(item := item parent) notNil] whileTrue:[ |
|
3127 |
item hidden ifTrue:[ |
|
3128 |
rcLt := true. |
|
3129 |
item expand. |
|
3130 |
] |
|
3131 |
] |
|
3132 |
] |
|
3133 |
]. |
|
3134 |
rcLt ifTrue:[model recomputeList]. |
|
3135 |
sel := list collect:[:anItem| listOfNodes findFirst:[:el| el == anItem]] |
|
3136 |
] ifFalse:[ |
|
3137 |
sel := list |
|
3138 |
]. |
|
3139 |
self cvsEventsDisabledDo:[ self selection:sel ]. |
|
3140 |
||
3141 |
||
3142 |
||
3143 |
||
3144 |
! |
|
3145 |
||
3146 |
cvsSelectionAdd:aView |
|
3147 |
"canvas adds a view to current selection |
|
3148 |
" |
|
3149 |
|parent item rcLt oldSel| |
|
3150 |
||
3151 |
item := self itemOfView:aView. |
|
3152 |
||
3153 |
item notNil ifTrue:[ |
|
3154 |
parent := item. |
|
3155 |
||
3156 |
[ (parent := parent parent) notNil ] whileTrue:[ |
|
3157 |
parent hidden ifTrue:[ |
|
3158 |
rcLt := true. |
|
3159 |
parent expand. |
|
3160 |
] |
|
3161 |
]. |
|
3162 |
rcLt == true ifTrue:[model recomputeList]. |
|
3163 |
||
3164 |
oldSel := selection copy. |
|
3165 |
self addToSelection:(listOfNodes findFirst:[:el| el == item]). |
|
3166 |
self selectionChangedFrom:oldSel |
|
3167 |
]. |
|
3168 |
||
3169 |
||
3170 |
||
3171 |
! |
|
3172 |
||
3173 |
cvsSelectionRemove:aView |
|
3174 |
"canvas removes a view from current selection |
|
3175 |
" |
|
3176 |
|parent item rcLt oldSel| |
|
3177 |
||
3178 |
item := self itemOfView:aView. |
|
3179 |
||
3180 |
item notNil ifTrue:[ |
|
3181 |
parent := item. |
|
3182 |
||
3183 |
[ (parent := parent parent) notNil ] whileTrue:[ |
|
3184 |
parent hidden ifTrue:[ |
|
3185 |
rcLt := true. |
|
3186 |
parent expand. |
|
3187 |
] |
|
3188 |
]. |
|
3189 |
rcLt == true ifTrue:[model recomputeList]. |
|
3190 |
||
3191 |
oldSel := selection copy. |
|
3192 |
self removeFromSelection:(listOfNodes findFirst:[:el| el == item]). |
|
3193 |
self selectionChangedFrom:oldSel |
|
3194 |
]. |
|
3195 |
||
3196 |
||
3197 |
||
3198 |
! ! |
|
3199 |
||
3200 |
!UIPainter::TreeView methodsFor:'change & update'! |
|
3201 |
||
281 | 3202 |
canvasNameChanged:aName |
3203 |
"called if identification name assigned to window (canvas) changed |
|
3204 |
" |
|
3205 |
|name node| |
|
3206 |
||
3207 |
node := listOfNodes at:1. |
|
3208 |
||
3209 |
( aName size ~~ 0 |
|
3210 |
and:[(name := aName string withoutSeparators) size ~~ 0 |
|
3211 |
and:[(self propertyDetect:[:p| p name = name]) isNil |
|
3212 |
and:[node name ~= name]]] |
|
3213 |
) ifTrue:[ |
|
3214 |
node name:name. |
|
3215 |
self redrawLine:1. |
|
3216 |
]. |
|
3217 |
! |
|
3218 |
||
222 | 3219 |
layoutChanged |
3220 |
"layout of any component changed; in case of single selection, the |
|
3221 |
application will be informed to update its layout |
|
3222 |
" |
|
3223 |
selection size == 1 ifTrue:[ |
|
3224 |
self application layoutChanged |
|
3225 |
] |
|
3226 |
||
3227 |
||
3228 |
! |
|
3229 |
||
3230 |
propertyChanged:aProperty |
|
3231 |
"property of view derived from argument a property changed |
|
3232 |
" |
|
3233 |
|item idx end| |
|
3234 |
||
3235 |
item := self itemOfView:(aProperty view). |
|
3236 |
||
3237 |
item notNil ifTrue:[ |
|
3238 |
item contents:aProperty. |
|
3239 |
||
3240 |
item name = aProperty name ifFalse:[ |
|
3241 |
idx := self firstLineShown. |
|
3242 |
||
3243 |
(end := self lastLineShown) > listOfNodes size ifTrue:[ |
|
3244 |
end := listOfNodes size |
|
3245 |
]. |
|
3246 |
item name:aProperty name. |
|
3247 |
||
3248 |
[idx <= end] whileTrue:[ |
|
3249 |
(listOfNodes at:idx) == item ifTrue:[ |
|
3250 |
self redrawLine:idx. "/ is visible; redraw line |
|
3251 |
end := 0 |
|
3252 |
] ifFalse:[ |
|
3253 |
idx := idx + 1 |
|
3254 |
] |
|
3255 |
] |
|
3256 |
]. |
|
3257 |
||
3258 |
self selectedNode == item ifTrue:[ "/ inform application |
|
272
99de6af43afa
confirm/cancel changes before switching a section or widget
ca
parents:
271
diff
changeset
|
3259 |
self application propertyChanged |
222 | 3260 |
] |
3261 |
]. |
|
3262 |
||
3263 |
||
3264 |
! ! |
|
3265 |
||
3266 |
!UIPainter::TreeView methodsFor:'drag & drop'! |
|
3267 |
||
3268 |
canDrop:anObjectOrCollection |
|
3269 |
"can drop ? delegate to canvas |
|
3270 |
" |
|
3271 |
^ self canvas canDrop:anObjectOrCollection |
|
3272 |
! |
|
3273 |
||
3274 |
drop:anObjectOrCollection at:aPoint |
|
3275 |
"drop objects ? delegate to canvas |
|
3276 |
" |
|
3277 |
self canvas drop:anObjectOrCollection at:aPoint |
|
3278 |
! ! |
|
3279 |
||
282 | 3280 |
!UIPainter::TreeView methodsFor:'enumerating'! |
3281 |
||
3282 |
allItemsDo:aOneArgBlock |
|
3283 |
"evaluate the argument a block on each item other than the canvas |
|
3284 |
" |
|
3285 |
model root allChildrenDo:aOneArgBlock |
|
3286 |
||
3287 |
||
3288 |
! ! |
|
3289 |
||
222 | 3290 |
!UIPainter::TreeView methodsFor:'event processing'! |
3291 |
||
3292 |
cvsEventsDisabledDo:aBlock |
|
3293 |
"evaluate the block without raising selection changed notifications |
|
3294 |
to canvas |
|
3295 |
" |
|
3296 |
|restoreCvsEvents| |
|
3297 |
||
3298 |
restoreCvsEvents := cvsEventsDisabled. |
|
3299 |
cvsEventsDisabled := true. |
|
3300 |
aBlock value. |
|
3301 |
cvsEventsDisabled := restoreCvsEvents. |
|
3302 |
||
3303 |
||
3304 |
! |
|
3305 |
||
3306 |
cvsSetupListDo:aBlock |
|
3307 |
"evaluate block without handling notifications from model; after evaluation |
|
3308 |
the new list will be recomputed |
|
3309 |
" |
|
3310 |
model removeDependent:self. |
|
3311 |
||
3312 |
self cvsEventsDisabledDo:[ |
|
3313 |
self selection:nil. |
|
3314 |
aBlock value |
|
3315 |
]. |
|
3316 |
model addDependent:self. |
|
3317 |
model recomputeList. |
|
3318 |
||
3319 |
! |
|
3320 |
||
3321 |
doubleClicked |
|
3322 |
"disable collapse of canvas item |
|
3323 |
" |
|
3324 |
self selectedNode == model root ifFalse:[ |
|
3325 |
super doubleClicked |
|
3326 |
] |
|
3327 |
||
3328 |
||
3329 |
! ! |
|
3330 |
||
3331 |
!UIPainter::TreeView methodsFor:'initialization'! |
|
3332 |
||
321
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3333 |
fetchImageResources |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3334 |
"get special images for UIPainter, |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3335 |
returns the maximum extent of all images" |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3336 |
|
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3337 |
|extent| |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3338 |
|
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3339 |
extent := super fetchImageResources. |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3340 |
|
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3341 |
imageMasterChild := self class imageMasterChild. |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3342 |
imageMasterChild notNil ifTrue:[ |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3343 |
imageMasterChild := imageMasterChild onDevice:device. |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3344 |
extent := extent max:(imageMasterChild extent). |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3345 |
]. |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3346 |
imageMasterParent := self class imageMasterParent. |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3347 |
imageMasterParent notNil ifTrue:[ |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3348 |
imageMasterParent := imageMasterParent onDevice:device. |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3349 |
extent := extent max:(imageMasterParent extent). |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3350 |
]. |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3351 |
imageEmptyParent := self class imageEmptyParent. |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3352 |
imageEmptyParent notNil ifTrue:[ |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3353 |
imageEmptyParent := imageEmptyParent onDevice:device. |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3354 |
extent := extent max:(imageEmptyParent extent). |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3355 |
]. |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3356 |
|
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3357 |
^ extent. |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3358 |
|
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3359 |
"Modified: 19.9.1997 / 17:18:46 / stefan" |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3360 |
! |
9b6c937e218d
Move image fetching form #initialize to #fetchImageResources
Stefan Vogel <sv@exept.de>
parents:
319
diff
changeset
|
3361 |
|
222 | 3362 |
initialize |
3363 |
"initialization; set multiple select and model |
|
3364 |
" |
|
3365 |
super initialize. |
|
3366 |
self multipleSelectOk:true. |
|
368 | 3367 |
cvsEventsDisabled := false. |
3368 |
||
222 | 3369 |
! ! |
3370 |
||
3371 |
!UIPainter::TreeView methodsFor:'private'! |
|
3372 |
||
3373 |
figureFor:aNode |
|
3374 |
"returns image for an item; testing whether item is the first |
|
3375 |
entry into the selection |
|
3376 |
" |
|
282 | 3377 |
|master subComp| |
3378 |
||
3379 |
subComp := (aNode parent isNil or:[aNode contents spec class supportsSubComponents]). |
|
222 | 3380 |
|
3381 |
selection size == 0 ifFalse:[ |
|
3382 |
master := listOfNodes at:(selection first). |
|
3383 |
||
3384 |
aNode == master ifTrue:[ |
|
3385 |
lastDrawnMaster := master. |
|
282 | 3386 |
subComp ifFalse:[^ imageMasterChild] |
3387 |
ifTrue:[^ imageMasterParent]. |
|
222 | 3388 |
] |
3389 |
]. |
|
282 | 3390 |
subComp ifFalse:[ |
3391 |
^ imageItem |
|
222 | 3392 |
]. |
282 | 3393 |
aNode hasChildren ifTrue:[ |
3394 |
aNode isExpandable ifTrue:[ ^ imageClosed ] |
|
3395 |
ifFalse:[ ^ imageOpened ] |
|
3396 |
]. |
|
3397 |
^ imageEmptyParent |
|
222 | 3398 |
|
3399 |
! |
|
3400 |
||
3401 |
selectionChangedFrom:oldSelection |
|
3402 |
"selection has changed. update master selection and raise notification |
|
3403 |
to canvas in case of enabled cvs events |
|
3404 |
" |
|
282 | 3405 |
|sel size| |
222 | 3406 |
|
3407 |
super selectionChangedFrom:oldSelection. |
|
282 | 3408 |
size := selection size. |
222 | 3409 |
|
3410 |
cvsEventsDisabled ifFalse:[ |
|
282 | 3411 |
(size ~~ 0 and:[size ~~ 1 or:[selection first ~~ 1]]) ifTrue:[ |
3412 |
sel := OrderedCollection new. |
|
3413 |
||
3414 |
selection do:[:i| |
|
3415 |
i ~~ 1 ifTrue:[sel add:(listOfNodes at:i) contents view] |
|
3416 |
] |
|
222 | 3417 |
]. |
282 | 3418 |
self canvas updateSelectionFromModel:sel |
222 | 3419 |
]. |
3420 |
||
282 | 3421 |
size ~~ 0 ifTrue:[ |
222 | 3422 |
sel := selection first. |
3423 |
||
3424 |
(listOfNodes at:sel) == lastDrawnMaster ifFalse:[ |
|
3425 |
self redrawLine:sel |
|
3426 |
] |
|
3427 |
] |
|
3428 |
! ! |
|
3429 |
||
3430 |
!UIPainter::TreeView methodsFor:'queries'! |
|
3431 |
||
282 | 3432 |
canMoveOrAlignSelection |
3433 |
"returns true if any selection exists and all widgets in the selection |
|
3434 |
can change their layout through to a move or align operation. |
|
3435 |
" |
|
3436 |
|canvas| |
|
3437 |
||
3438 |
selection size == 0 ifTrue:[ |
|
3439 |
^ false |
|
3440 |
]. |
|
3441 |
canvas := self canvas. |
|
3442 |
||
3443 |
selection do:[:i| |
|
3444 |
i == 1 ifTrue:[^ false]. |
|
3445 |
||
3446 |
(canvas canChangeLayoutOfView:((listOfNodes at:i) contents view)) ifFalse:[ |
|
3447 |
^ false |
|
3448 |
] |
|
3449 |
]. |
|
3450 |
^ true |
|
3451 |
! |
|
3452 |
||
3453 |
canMoveSelectionIntoContainer |
|
3454 |
"returns true in case that one component is selected and can change its container |
|
3455 |
widget to the next element in the list which will have the same container. |
|
222 | 3456 |
" |
3457 |
|item prnt| |
|
3458 |
||
3459 |
( (item := self selectedNode) isNil |
|
3460 |
or:[(prnt := item parent) isNil |
|
3461 |
or:[(prnt := prnt childAt:((prnt indexOfChild:item) + 1)) isNil |
|
3462 |
or:[prnt contents spec class supportsSubComponents not]]] |
|
3463 |
) ifTrue:[ |
|
3464 |
^ false |
|
3465 |
]. |
|
3466 |
^ true |
|
3467 |
! |
|
3468 |
||
282 | 3469 |
canMoveSelectionOutOfContainer |
3470 |
"returns true in case that one component is selected which is contained within |
|
3471 |
another component. |
|
3472 |
" |
|
222 | 3473 |
|item prnt| |
3474 |
||
3475 |
( (item := self selectedNode) isNil |
|
3476 |
or:[(prnt := item parent) isNil |
|
3477 |
or:[prnt parent isNil]] |
|
3478 |
) ifTrue:[ |
|
3479 |
^ false |
|
3480 |
]. |
|
3481 |
^ true |
|
3482 |
! |
|
3483 |
||
301 | 3484 |
canResizeSelectedWidget |
3485 |
"returns true in case of one widget selected and is contained |
|
3486 |
within a widget which allows to resize sub components |
|
3487 |
" |
|
3488 |
|n| |
|
3489 |
||
3490 |
(n := self selectedNode) notNil ifTrue:[ |
|
3491 |
(n := n parent) notNil ifTrue:[ |
|
3492 |
^ (n parent isNil or:[n contents spec class canResizeSubComponents]) |
|
3493 |
] |
|
3494 |
]. |
|
3495 |
^ false |
|
3496 |
! |
|
3497 |
||
282 | 3498 |
hasOneSelectionOtherThanCanvas |
3499 |
"returns true in case that one selection exists other than the canvas |
|
222 | 3500 |
" |
282 | 3501 |
^ (selection size == 1 and:[selection first ~~ 1]) |
281 | 3502 |
! |
3503 |
||
3504 |
isCanvasSelected |
|
3505 |
"returns true in case of a single selection and the |
|
3506 |
selection is the canvas (index 1) |
|
3507 |
" |
|
3508 |
^ (selection size == 1 and:[self isInSelection:1]) |
|
222 | 3509 |
! ! |
3510 |
||
282 | 3511 |
!UIPainter::TreeView methodsFor:'seraching'! |
3512 |
||
3513 |
detectItemRespondsToView:aView |
|
3514 |
"detect the item responding to the view. The item of the view or the first |
|
3515 |
subview providing the item is returned. If no property is detected nil is |
|
3516 |
returned |
|
3517 |
" |
|
3518 |
|view item| |
|
3519 |
||
3520 |
(view := aView) notNil ifTrue:[ |
|
3521 |
[(item := self itemOfView:view) isNil] whileTrue:[ |
|
3522 |
(view := view superView) isNil ifTrue:[^ listOfNodes at:1] |
|
3523 |
]. |
|
3524 |
]. |
|
3525 |
^ item |
|
3526 |
||
3527 |
! ! |
|
3528 |
||
222 | 3529 |
!UIPainter::TreeView methodsFor:'user interactions'! |
3530 |
||
3531 |
doStepIn |
|
3532 |
|item prnt canvas| |
|
3533 |
||
3534 |
( (item := self selectedNode) isNil |
|
3535 |
or:[(prnt := item parent) isNil |
|
3536 |
or:[(prnt := prnt childAt:((prnt indexOfChild:item) + 1)) isNil |
|
3537 |
or:[prnt contents spec class supportsSubComponents not]]] |
|
3538 |
) ifFalse:[ |
|
3539 |
canvas := self canvas. |
|
3540 |
canvas deleteSelection. |
|
3541 |
canvas setSelection:(prnt contents view) withRedraw:false. |
|
3542 |
canvas pasteWithLayout. |
|
3543 |
] |
|
3544 |
! |
|
3545 |
||
3546 |
doStepOut |
|
250 | 3547 |
|item next prnt canvas| |
222 | 3548 |
|
3549 |
( (item := self selectedNode) isNil |
|
3550 |
or:[(prnt := item parent) isNil |
|
3551 |
or:[(next := prnt parent) isNil]] |
|
3552 |
) ifTrue:[ |
|
3553 |
^ self |
|
3554 |
]. |
|
3555 |
model removeDependent:self. |
|
3556 |
||
3557 |
canvas := self canvas. |
|
3558 |
canvas deleteSelection. |
|
3559 |
canvas setSelection:(next contents view) withRedraw:false. |
|
3560 |
canvas pasteWithLayout. |
|
3561 |
||
3562 |
! |
|
3563 |
||
3564 |
doStepOver:anIndex |
|
3565 |
"move child 'anOffset' forward or backward in list of children |
|
3566 |
" |
|
282 | 3567 |
|item idx size prnt spVw view canvas| |
222 | 3568 |
|
3569 |
( (item := self selectedNode) isNil |
|
3570 |
or:[(prnt := item parent) isNil |
|
282 | 3571 |
or:[(size := prnt children size) < 2 |
3572 |
or:[(idx := prnt indexOfChild:item) == 0]]] |
|
3573 |
) ifTrue:[ |
|
3574 |
^ self |
|
3575 |
]. |
|
3576 |
model removeDependent:self. |
|
3577 |
model removeSelection. |
|
3578 |
selection := nil. |
|
3579 |
model addDependent:self. |
|
3580 |
idx := idx + anIndex. |
|
3581 |
||
3582 |
idx < 1 ifTrue:[idx := size] |
|
3583 |
ifFalse:[idx > size ifTrue:[idx := 1]]. |
|
3584 |
||
3585 |
model add:item beforeIndex:idx below:prnt. |
|
3586 |
idx := prnt indexOfChild:item. |
|
3587 |
view := item contents view. |
|
3588 |
spVw := prnt contents view. |
|
3589 |
canvas := self canvas. |
|
3590 |
||
3591 |
canvas hideSelection. |
|
3592 |
||
3593 |
"/ input view might by contained in sequence |
|
3594 |
((size := canvas findInputViewIn:spVw) ~~ 0 and:[idx >= size]) ifTrue:[ |
|
3595 |
idx := idx + 1 |
|
3596 |
]. |
|
3597 |
spVw changeSequenceOrderFor:view to:idx. |
|
3598 |
||
3599 |
spVw specClass isLayoutContainer ifFalse:[ |
|
3600 |
spVw subViews do:[:v| v raise ]. |
|
3601 |
canvas inputView raise |
|
3602 |
]. |
|
3603 |
canvas showSelection. |
|
3604 |
self selectNode:item. |
|
222 | 3605 |
! ! |
3606 |
||
60 | 3607 |
!UIPainter class methodsFor:'documentation'! |
3608 |
||
3609 |
version |
|
3610 |
^ '$Header$' |
|
3611 |
! ! |