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