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