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