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