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