199
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
|
|
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 |
|
|
14 |
|
|
15 |
ApplicationModel subclass:#MenuEditor
|
220
|
16 |
instanceVariableNames:'specClass tabSelection aspects slices activeHelpTool'
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'Interface-UIPainter'
|
199
|
20 |
!
|
|
21 |
|
|
22 |
Object subclass:#Item
|
220
|
23 |
instanceVariableNames:'activeHelpKey enabled label value nameKey indication shortcutKey
|
|
24 |
accessCharaterPos retriever icon iconAndLabel submenuChannel'
|
|
25 |
classVariableNames:''
|
|
26 |
poolDictionaries:''
|
|
27 |
privateIn:MenuEditor
|
199
|
28 |
!
|
|
29 |
|
|
30 |
SelectionInTreeView subclass:#Painter
|
220
|
31 |
instanceVariableNames:'imageMenuLink imageSeparator'
|
|
32 |
classVariableNames:'CopyBuffer ImageMenuLink ImageSeparator'
|
|
33 |
poolDictionaries:''
|
|
34 |
privateIn:MenuEditor
|
199
|
35 |
!
|
|
36 |
|
|
37 |
!MenuEditor class methodsFor:'documentation'!
|
|
38 |
|
|
39 |
copyright
|
|
40 |
"
|
|
41 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
|
|
42 |
All Rights Reserved
|
|
43 |
|
|
44 |
This software is furnished under a license and may be used
|
|
45 |
only in accordance with the terms of that license and with the
|
|
46 |
inclusion of the above copyright notice. This software may not
|
|
47 |
be provided or otherwise made available to, or used by, any
|
|
48 |
other person. No title to or ownership of the software is
|
|
49 |
hereby transferred.
|
|
50 |
"
|
|
51 |
|
|
52 |
|
|
53 |
!
|
|
54 |
|
|
55 |
documentation
|
|
56 |
"
|
|
57 |
create and modify or inspect popup and pullDown menus of the
|
|
58 |
new style( derives from Menu).
|
|
59 |
|
|
60 |
[start with:]
|
|
61 |
MenuEditor open
|
|
62 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuPullDown
|
|
63 |
|
|
64 |
[see also:]
|
|
65 |
UIPainter
|
|
66 |
UIHelpTool
|
|
67 |
UISpecificationTool
|
|
68 |
SelectionInTreeView
|
|
69 |
|
|
70 |
[author:]
|
|
71 |
Claus Atzkern
|
|
72 |
"
|
|
73 |
|
|
74 |
! !
|
|
75 |
|
218
|
76 |
!MenuEditor class methodsFor:'icons'!
|
|
77 |
|
220
|
78 |
iconCreateItem
|
|
79 |
^ Painter imageItem
|
|
80 |
|
|
81 |
!
|
|
82 |
|
|
83 |
iconCreateLink
|
|
84 |
^ Painter imageMenuLink
|
|
85 |
|
|
86 |
!
|
|
87 |
|
|
88 |
iconCreateMenu
|
|
89 |
^ Painter imageClosed
|
|
90 |
|
|
91 |
!
|
|
92 |
|
|
93 |
iconCreateSep
|
|
94 |
^ Painter imageSeparator
|
|
95 |
|
227
|
96 |
!
|
|
97 |
|
|
98 |
iconUnknown
|
|
99 |
"returns an image used for picked items containg an image
|
|
100 |
"
|
|
101 |
^ Image fromFile:'brokenImage.xpm'
|
218
|
102 |
! !
|
|
103 |
|
199
|
104 |
!MenuEditor class methodsFor:'interface specs'!
|
|
105 |
|
|
106 |
classAndMethodSpec
|
|
107 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
108 |
|
|
109 |
"do not manually edit this - the painter/builder may not be able to
|
|
110 |
handle the specification if its corrupted."
|
|
111 |
|
|
112 |
"
|
|
113 |
UIPainter new openOnClass:MenuEditor andSelector:#classAndMethodSpec
|
|
114 |
MenuEditor new openInterface:#classAndMethodSpec
|
|
115 |
"
|
|
116 |
|
|
117 |
<resource: #canvas>
|
|
118 |
|
|
119 |
^
|
|
120 |
|
|
121 |
#(#FullSpec
|
|
122 |
#'window:'
|
|
123 |
#(#WindowSpec
|
|
124 |
#'name:' 'uIPainterView'
|
|
125 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
126 |
#'label:' 'Painter'
|
|
127 |
#'bounds:' #(#Rectangle 0 0 391 170)
|
|
128 |
)
|
|
129 |
#'component:'
|
|
130 |
#(#SpecCollection
|
|
131 |
#'collection:'
|
|
132 |
#(
|
|
133 |
#(#LabelSpec
|
|
134 |
#'name:' 'classLabel'
|
|
135 |
#'layout:' #(#AlignmentOrigin 45 0.11 51 0 1 0.5)
|
|
136 |
#'label:' 'class:'
|
|
137 |
#'adjust:' #right
|
|
138 |
#'resizeForLabel:' true
|
|
139 |
)
|
|
140 |
#(#LabelSpec
|
|
141 |
#'name:' 'selectorLabel'
|
|
142 |
#'layout:' #(#AlignmentOrigin 45 0.11 74 0 1 0.5)
|
|
143 |
#'label:' 'selector:'
|
|
144 |
#'adjust:' #right
|
|
145 |
#'resizeForLabel:' true
|
|
146 |
)
|
|
147 |
#(#InputFieldSpec
|
|
148 |
#'name:' 'methodNameField'
|
|
149 |
#'layout:' #(#LayoutFrame 47 0.11 64 0 -5 1.0 86 0)
|
|
150 |
#'tabable:' true
|
|
151 |
#'model:' #methodNameChannel
|
|
152 |
)
|
|
153 |
#(#LabelSpec
|
|
154 |
#'name:' 'boxLabel'
|
|
155 |
#'layout:' #(#Point 5 10)
|
|
156 |
#'label:' 'class & selector for code:'
|
|
157 |
#'adjust:' #left
|
|
158 |
#'resizeForLabel:' true
|
|
159 |
)
|
|
160 |
#(#InputFieldSpec
|
|
161 |
#'name:' 'classNameField'
|
|
162 |
#'layout:' #(#LayoutFrame 47 0.11 39 0 -5 1.0 61 0)
|
|
163 |
#'tabable:' true
|
|
164 |
#'model:' #classNameChannel
|
|
165 |
)
|
|
166 |
#(#HorizontalPanelViewSpec
|
|
167 |
#'name:' 'commitPanel'
|
|
168 |
#'layout:' #(#LayoutFrame 0 0.0 -24 1.0 0 1.0 0 1.0)
|
|
169 |
#'component:'
|
|
170 |
#(#SpecCollection
|
|
171 |
#'collection:'
|
|
172 |
#(
|
|
173 |
#(#ActionButtonSpec
|
|
174 |
#'name:' 'button1'
|
|
175 |
#'label:' 'cancel'
|
|
176 |
#'tabable:' true
|
|
177 |
#'model:' #cancel
|
|
178 |
#'extent:' #(#Point 191 24)
|
|
179 |
)
|
|
180 |
#(#ActionButtonSpec
|
|
181 |
#'name:' 'button2'
|
|
182 |
#'label:' 'ok'
|
|
183 |
#'tabable:' true
|
|
184 |
#'isDefault:' true
|
|
185 |
#'model:' #accept
|
|
186 |
#'extent:' #(#Point 191 24)
|
|
187 |
)
|
|
188 |
)
|
|
189 |
)
|
|
190 |
#'horizontalLayout:' #fitSpace
|
|
191 |
#'verticalLayout:' #fit
|
|
192 |
#'horizontalSpace:' 3
|
|
193 |
#'verticalSpace:' 3
|
|
194 |
)
|
|
195 |
)
|
|
196 |
)
|
|
197 |
)
|
|
198 |
!
|
|
199 |
|
|
200 |
classDefineSpec
|
|
201 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
202 |
|
|
203 |
"do not manually edit this - the painter/builder may not be able to
|
|
204 |
handle the specification if its corrupted."
|
|
205 |
|
|
206 |
"
|
|
207 |
UIPainter new openOnClass:MenuEditor andSelector:#classDefineSpec
|
|
208 |
MenuEditor new openInterface:#classDefineSpec
|
|
209 |
"
|
|
210 |
|
|
211 |
<resource: #canvas>
|
|
212 |
|
|
213 |
^
|
|
214 |
|
|
215 |
#(#FullSpec
|
|
216 |
#'window:'
|
|
217 |
#(#WindowSpec
|
|
218 |
#'name:' 'uIPainterView'
|
|
219 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
220 |
#'label:' 'Painter'
|
|
221 |
#'bounds:' #(#Rectangle 0 0 383 128)
|
|
222 |
)
|
|
223 |
#'component:'
|
|
224 |
#(#SpecCollection
|
|
225 |
#'collection:'
|
|
226 |
#(
|
|
227 |
#(#LabelSpec
|
|
228 |
#'name:' 'classLabel'
|
|
229 |
#'layout:' #(#AlignmentOrigin 45 0.11 51 0 1 0.5)
|
|
230 |
#'label:' 'class:'
|
|
231 |
#'adjust:' #right
|
|
232 |
#'resizeForLabel:' true
|
|
233 |
)
|
|
234 |
#(#LabelSpec
|
|
235 |
#'name:' 'boxLabel'
|
|
236 |
#'layout:' #(#Point 5 10)
|
|
237 |
#'label:' 'class for code:'
|
|
238 |
#'adjust:' #left
|
|
239 |
#'resizeForLabel:' true
|
|
240 |
)
|
|
241 |
#(#InputFieldSpec
|
|
242 |
#'name:' 'classNameField'
|
|
243 |
#'layout:' #(#LayoutFrame 47 0.11 39 0 -5 1.0 61 0)
|
|
244 |
#'tabable:' true
|
|
245 |
#'model:' #classNameChannel
|
|
246 |
)
|
|
247 |
#(#HorizontalPanelViewSpec
|
|
248 |
#'name:' 'commitPanel'
|
|
249 |
#'layout:' #(#LayoutFrame 0 0.0 -24 1.0 0 1.0 0 1.0)
|
|
250 |
#'component:'
|
|
251 |
#(#SpecCollection
|
|
252 |
#'collection:'
|
|
253 |
#(
|
|
254 |
#(#ActionButtonSpec
|
|
255 |
#'name:' 'button1'
|
|
256 |
#'label:' 'cancel'
|
|
257 |
#'tabable:' true
|
|
258 |
#'model:' #cancel
|
|
259 |
#'extent:' #(#Point 187 24)
|
|
260 |
)
|
|
261 |
#(#ActionButtonSpec
|
|
262 |
#'name:' 'button2'
|
|
263 |
#'label:' 'ok'
|
|
264 |
#'tabable:' true
|
|
265 |
#'isDefault:' true
|
|
266 |
#'model:' #accept
|
|
267 |
#'extent:' #(#Point 187 24)
|
|
268 |
)
|
|
269 |
)
|
|
270 |
)
|
|
271 |
#'horizontalLayout:' #fitSpace
|
|
272 |
#'verticalLayout:' #fit
|
|
273 |
#'horizontalSpace:' 3
|
|
274 |
#'verticalSpace:' 3
|
|
275 |
)
|
|
276 |
)
|
|
277 |
)
|
|
278 |
)
|
|
279 |
!
|
|
280 |
|
220
|
281 |
menuButtons
|
|
282 |
"this window spec was automatically generated by the ST/X MenuEditor"
|
|
283 |
|
|
284 |
"do not manually edit this - the builder may not be able to
|
|
285 |
handle the specification if its corrupted."
|
|
286 |
|
|
287 |
"
|
|
288 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuButtons
|
|
289 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuButtons)) startUp
|
|
290 |
"
|
|
291 |
|
|
292 |
<resource: #menu>
|
|
293 |
|
|
294 |
^
|
|
295 |
|
|
296 |
#(#Menu
|
|
297 |
|
|
298 |
#(
|
|
299 |
#(#MenuItem
|
|
300 |
#'label:' 'createMenu'
|
|
301 |
#'value:' #doCreateMenu
|
|
302 |
#'enabled:' #hasAnySingleSelection
|
|
303 |
#'labelImage:'
|
|
304 |
#(#ResourceRetriever
|
|
305 |
#MenuEditor #iconCreateMenu
|
|
306 |
)
|
|
307 |
)
|
|
308 |
#(#MenuItem
|
|
309 |
#'label:' 'createLink'
|
|
310 |
#'value:' #doCreateLink
|
|
311 |
#'enabled:' #hasAnySingleSelection
|
|
312 |
#'labelImage:'
|
|
313 |
#(#ResourceRetriever
|
|
314 |
#MenuEditor #iconCreateLink
|
|
315 |
)
|
|
316 |
)
|
|
317 |
#(#MenuItem
|
|
318 |
#'label:' 'createItem'
|
|
319 |
#'value:' #doCreateItem
|
|
320 |
#'enabled:' #hasAnySingleSelection
|
|
321 |
#'labelImage:'
|
|
322 |
#(#ResourceRetriever
|
|
323 |
#MenuEditor #iconCreateItem
|
|
324 |
)
|
|
325 |
)
|
|
326 |
#(#MenuItem
|
|
327 |
#'label:' 'createSeparator'
|
|
328 |
#'value:' #doCreateSep
|
|
329 |
#'enabled:' #hasAnySingleSelection
|
|
330 |
#'labelImage:'
|
|
331 |
#(#ResourceRetriever
|
|
332 |
#MenuEditor #iconCreateSep
|
|
333 |
)
|
|
334 |
)
|
|
335 |
#(#MenuItem
|
|
336 |
#'label:' ''
|
|
337 |
)
|
|
338 |
#(#MenuItem
|
|
339 |
#'label:' 'stepUp'
|
|
340 |
#'value:' #doStepUp
|
|
341 |
#'enabled:' #enabledStepOver
|
|
342 |
#'labelImage:'
|
|
343 |
#(#ResourceRetriever
|
224
|
344 |
#UIPainter #iconStepUp
|
220
|
345 |
)
|
|
346 |
)
|
|
347 |
#(#MenuItem
|
|
348 |
#'label:' 'stepDown'
|
|
349 |
#'value:' #doStepDown
|
|
350 |
#'enabled:' #enabledStepOver
|
|
351 |
#'labelImage:'
|
|
352 |
#(#ResourceRetriever
|
224
|
353 |
#UIPainter #iconStepDown
|
220
|
354 |
)
|
|
355 |
)
|
|
356 |
#(#MenuItem
|
|
357 |
#'label:' 'stepIn'
|
|
358 |
#'value:' #doStepIn
|
|
359 |
#'enabled:' #enabledStepIn
|
|
360 |
#'labelImage:'
|
|
361 |
#(#ResourceRetriever
|
224
|
362 |
#UIPainter #iconStepIn
|
220
|
363 |
)
|
|
364 |
)
|
|
365 |
#(#MenuItem
|
|
366 |
#'label:' 'stepOut'
|
|
367 |
#'value:' #doStepOut
|
|
368 |
#'enabled:' #enabledStepOut
|
|
369 |
#'labelImage:'
|
|
370 |
#(#ResourceRetriever
|
224
|
371 |
#UIPainter #iconStepOut
|
220
|
372 |
)
|
|
373 |
)
|
|
374 |
) nil
|
|
375 |
nil
|
|
376 |
)
|
|
377 |
!
|
|
378 |
|
218
|
379 |
menuDefaultLink
|
|
380 |
"this window spec was automatically generated by the ST/X MenuEditor"
|
|
381 |
|
|
382 |
"do not manually edit this - the builder may not be able to
|
|
383 |
handle the specification if its corrupted."
|
|
384 |
|
|
385 |
"
|
|
386 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuDefaultLink
|
|
387 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuDefaultLink)) startUp
|
|
388 |
"
|
|
389 |
|
|
390 |
<resource: #menu>
|
|
391 |
|
|
392 |
^
|
|
393 |
|
|
394 |
#(#Menu
|
|
395 |
|
|
396 |
#(
|
|
397 |
#(#MenuItem
|
|
398 |
#'label:' '!! derives from application !!'
|
|
399 |
)
|
|
400 |
) nil
|
|
401 |
nil
|
|
402 |
)
|
|
403 |
!
|
|
404 |
|
220
|
405 |
menuPainter
|
|
406 |
"this window spec was automatically generated by the ST/X MenuEditor"
|
|
407 |
|
|
408 |
"do not manually edit this - the builder may not be able to
|
|
409 |
handle the specification if its corrupted."
|
|
410 |
|
|
411 |
"
|
|
412 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuPainter
|
|
413 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuPainter)) startUp
|
|
414 |
"
|
|
415 |
|
|
416 |
<resource: #menu>
|
|
417 |
|
|
418 |
^
|
|
419 |
|
|
420 |
#(#Menu
|
|
421 |
|
|
422 |
#(
|
|
423 |
#(#MenuItem
|
|
424 |
#'label:' 'copy'
|
|
425 |
#'value:' #doCopy
|
|
426 |
#'enabled:' #hasValidSelection
|
|
427 |
)
|
|
428 |
#(#MenuItem
|
|
429 |
#'label:' 'cut'
|
|
430 |
#'value:' #doCut
|
|
431 |
#'enabled:' #hasValidSelection
|
|
432 |
)
|
|
433 |
#(#MenuItem
|
|
434 |
#'label:' 'paste'
|
|
435 |
#'value:' #doPaste
|
|
436 |
#'enabled:' #hasAnySingleSelection
|
|
437 |
)
|
|
438 |
#(#MenuItem
|
|
439 |
#'label:' '-'
|
|
440 |
)
|
|
441 |
#(#MenuItem
|
|
442 |
#'label:' 'create'
|
|
443 |
#'enabled:' #hasAnySingleSelection
|
|
444 |
#'submenu:'
|
|
445 |
#(#Menu
|
|
446 |
|
|
447 |
#(
|
|
448 |
#(#MenuItem
|
|
449 |
#'label:' 'submenu static'
|
|
450 |
#'value:' #doCreateMenu
|
|
451 |
#'labelImage:'
|
|
452 |
#(#ResourceRetriever
|
|
453 |
#MenuEditor #iconCreateMenu
|
|
454 |
'submenu static'
|
|
455 |
)
|
|
456 |
)
|
|
457 |
#(#MenuItem
|
|
458 |
#'label:' 'submenu dynamic'
|
|
459 |
#'value:' #doCreateLink
|
|
460 |
#'labelImage:'
|
|
461 |
#(#ResourceRetriever
|
|
462 |
#MenuEditor #iconCreateLink
|
|
463 |
'submenu dynamic'
|
|
464 |
)
|
|
465 |
)
|
|
466 |
#(#MenuItem
|
|
467 |
#'label:' '-'
|
|
468 |
)
|
|
469 |
#(#MenuItem
|
|
470 |
#'label:' 'item'
|
|
471 |
#'value:' #doCreateItem
|
|
472 |
#'labelImage:'
|
|
473 |
#(#ResourceRetriever
|
|
474 |
#MenuEditor #iconCreateItem
|
|
475 |
'item'
|
|
476 |
)
|
|
477 |
)
|
|
478 |
#(#MenuItem
|
|
479 |
#'label:' 'separator'
|
|
480 |
#'value:' #doCreateSep
|
|
481 |
#'labelImage:'
|
|
482 |
#(#ResourceRetriever
|
|
483 |
#MenuEditor #iconCreateSep
|
|
484 |
'separator'
|
|
485 |
)
|
|
486 |
)
|
|
487 |
) nil
|
|
488 |
nil
|
|
489 |
)
|
|
490 |
)
|
|
491 |
) nil
|
|
492 |
nil
|
|
493 |
)
|
|
494 |
!
|
|
495 |
|
199
|
496 |
menuPullDown
|
|
497 |
"this window spec was automatically generated by the ST/X MenuEditor"
|
|
498 |
|
|
499 |
"do not manually edit this - the builder may not be able to
|
|
500 |
handle the specification if its corrupted."
|
|
501 |
|
|
502 |
"
|
|
503 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuPullDown
|
|
504 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuPullDown)) startUp
|
|
505 |
"
|
|
506 |
|
|
507 |
<resource: #menu>
|
|
508 |
|
|
509 |
^
|
|
510 |
|
|
511 |
#(#Menu
|
|
512 |
|
|
513 |
#(
|
|
514 |
#(#MenuItem
|
|
515 |
#'label:' 'file'
|
|
516 |
#'value:' #file
|
|
517 |
#'submenu:'
|
|
518 |
#(#Menu
|
|
519 |
|
|
520 |
#(
|
|
521 |
#(#MenuItem
|
|
522 |
#'label:' 'new'
|
|
523 |
#'value:' #doNew
|
|
524 |
)
|
|
525 |
#(#MenuItem
|
|
526 |
#'label:' 'from class ...'
|
|
527 |
#'value:' #doFromClass
|
218
|
528 |
#'enabled:' #isOwnerOfHelpTool
|
199
|
529 |
)
|
|
530 |
#(#MenuItem
|
|
531 |
#'label:' 'pick a menu'
|
|
532 |
#'value:' #doPickAMenu
|
218
|
533 |
#'enabled:' #isOwnerOfHelpTool
|
199
|
534 |
)
|
|
535 |
#(#MenuItem
|
|
536 |
#'label:' '='
|
|
537 |
)
|
|
538 |
#(#MenuItem
|
|
539 |
#'label:' 'quit'
|
|
540 |
#'value:' #closeRequest
|
|
541 |
)
|
|
542 |
) nil
|
|
543 |
nil
|
|
544 |
)
|
|
545 |
)
|
|
546 |
#(#MenuItem
|
|
547 |
#'label:' 'code'
|
|
548 |
#'value:' #code
|
|
549 |
#'submenu:'
|
|
550 |
#(#Menu
|
|
551 |
|
|
552 |
#(
|
|
553 |
#(#MenuItem
|
|
554 |
#'label:' 'class'
|
|
555 |
#'value:' #doDefineClass
|
218
|
556 |
#'enabled:' #isOwnerOfHelpTool
|
199
|
557 |
)
|
|
558 |
#(#MenuItem
|
|
559 |
#'label:' '-'
|
|
560 |
)
|
|
561 |
#(#MenuItem
|
|
562 |
#'label:' 'install window spec.'
|
|
563 |
#'value:' #doInstallSpec
|
|
564 |
)
|
|
565 |
#(#MenuItem
|
|
566 |
#'label:' 'install help spec.'
|
|
567 |
#'value:' #doInstallHelp
|
218
|
568 |
#'enabled:' #isOwnerOfHelpTool
|
199
|
569 |
)
|
|
570 |
#(#MenuItem
|
|
571 |
#'label:' '='
|
|
572 |
)
|
|
573 |
#(#MenuItem
|
|
574 |
#'label:' 'browse application'
|
|
575 |
#'value:' #doBrowseAppClass
|
|
576 |
)
|
|
577 |
) nil
|
|
578 |
nil
|
|
579 |
)
|
|
580 |
)
|
|
581 |
#(#MenuItem
|
|
582 |
#'label:' 'test'
|
218
|
583 |
#'submenuChannel:' #submenuTest
|
|
584 |
)
|
199
|
585 |
) nil
|
|
586 |
nil
|
|
587 |
)
|
|
588 |
!
|
|
589 |
|
|
590 |
windowSpec
|
|
591 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
592 |
|
|
593 |
"do not manually edit this - the painter/builder may not be able to
|
|
594 |
handle the specification if its corrupted."
|
|
595 |
|
|
596 |
"
|
|
597 |
UIPainter new openOnClass:MenuEditor andSelector:#windowSpec
|
|
598 |
MenuEditor new openInterface:#windowSpec
|
|
599 |
"
|
|
600 |
"MenuEditor open"
|
|
601 |
|
|
602 |
<resource: #canvas>
|
|
603 |
|
|
604 |
^
|
|
605 |
|
|
606 |
#(#FullSpec
|
|
607 |
#'window:'
|
|
608 |
#(#WindowSpec
|
|
609 |
#'name:' 'uIPainterView'
|
|
610 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
611 |
#'label:' 'Menu Builder'
|
|
612 |
#'bounds:' #(#Rectangle 0 0 580 384)
|
|
613 |
)
|
|
614 |
#'component:'
|
|
615 |
#(#SpecCollection
|
|
616 |
#'collection:'
|
|
617 |
#(
|
|
618 |
#(#ArbitraryComponentSpec
|
|
619 |
#'name:' 'painterView'
|
220
|
620 |
#'layout:' #(#LayoutFrame 0 0.0 57 0 0 0.5 0 1.0)
|
|
621 |
#'menu:' #menuPainter
|
199
|
622 |
#'hasHorizontalScrollBar:' true
|
|
623 |
#'hasVerticalScrollBar:' true
|
220
|
624 |
#'component:' #painter
|
199
|
625 |
#'hasBorder:' false
|
|
626 |
)
|
|
627 |
#(#NoteBookViewSpec
|
|
628 |
#'name:' 'specificationView'
|
220
|
629 |
#'layout:' #(#LayoutFrame 0 0.5 0 0.0 0 1.0 -25 1.0)
|
|
630 |
#'tabable:' true
|
199
|
631 |
#'menu:' #tabList
|
|
632 |
#'model:' #tabModel
|
|
633 |
#'tabWidget:' #Window
|
|
634 |
#'useIndex:' true
|
|
635 |
#'canvas:' #tabCanvas
|
|
636 |
)
|
|
637 |
#(#HorizontalPanelViewSpec
|
|
638 |
#'name:' 'confirmationPanel'
|
|
639 |
#'layout:' #(#LayoutFrame 0 0.5 -24 1.0 0 1.0 0 1.0)
|
|
640 |
#'component:'
|
|
641 |
#(#SpecCollection
|
|
642 |
#'collection:'
|
|
643 |
#(
|
|
644 |
#(#ActionButtonSpec
|
|
645 |
#'name:' 'cancelButton'
|
|
646 |
#'label:' 'cancel'
|
|
647 |
#'model:' #cancel
|
|
648 |
#'enableChannel:' #modifiedChannel
|
|
649 |
#'extent:' #(#Point 140 24)
|
|
650 |
)
|
|
651 |
#(#ActionButtonSpec
|
|
652 |
#'name:' 'acceptButton'
|
|
653 |
#'label:' 'ok'
|
|
654 |
#'model:' #accept
|
|
655 |
#'enableChannel:' #modifiedChannel
|
|
656 |
#'extent:' #(#Point 141 24)
|
|
657 |
)
|
|
658 |
)
|
|
659 |
)
|
|
660 |
#'horizontalLayout:' #fitSpace
|
|
661 |
#'verticalLayout:' #fit
|
|
662 |
#'horizontalSpace:' 3
|
|
663 |
#'verticalSpace:' 3
|
|
664 |
)
|
|
665 |
#(#MenuPanelSpec
|
|
666 |
#'name:' 'pullDownMenu'
|
220
|
667 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 0.5 24 0)
|
|
668 |
#'tabable:' true
|
199
|
669 |
#'menu:' #menuPullDown
|
|
670 |
)
|
220
|
671 |
#(#MenuPanelSpec
|
|
672 |
#'name:' 'menuPanel1'
|
|
673 |
#'layout:' #(#LayoutFrame 0 0 28 0 0 0.5 53 0)
|
|
674 |
#'menu:' #menuButtons
|
|
675 |
#'showSeparatingLines:' true
|
|
676 |
)
|
199
|
677 |
)
|
|
678 |
)
|
|
679 |
)
|
|
680 |
! !
|
|
681 |
|
|
682 |
!MenuEditor class methodsFor:'slices'!
|
|
683 |
|
|
684 |
slicesItem
|
|
685 |
^#(
|
|
686 |
(Basics basicsItemSpec)
|
|
687 |
(Details detailsEditSpec)
|
|
688 |
(Misc miscEditSpec)
|
|
689 |
(Help help)
|
|
690 |
)
|
|
691 |
|
|
692 |
!
|
|
693 |
|
218
|
694 |
slicesLink
|
|
695 |
^#(
|
|
696 |
(Basics basicsLinkSpec)
|
|
697 |
(Details detailsEditSpec)
|
|
698 |
(Misc miscEditSpec)
|
|
699 |
(Help help)
|
|
700 |
)
|
|
701 |
|
|
702 |
!
|
|
703 |
|
199
|
704 |
slicesMenu
|
|
705 |
^#(
|
|
706 |
(Basics basicsMenuSpec)
|
|
707 |
(Details detailsEditSpec)
|
|
708 |
(Misc miscEditSpec)
|
|
709 |
(Help help)
|
|
710 |
)
|
|
711 |
|
|
712 |
!
|
|
713 |
|
|
714 |
slicesRootMenu
|
|
715 |
^#(
|
|
716 |
(Basics basicsRootSpec)
|
|
717 |
)
|
|
718 |
|
|
719 |
!
|
|
720 |
|
218
|
721 |
slicesSeparatorMenu
|
199
|
722 |
^#(
|
218
|
723 |
(Basics basicsSeparatorSpec)
|
199
|
724 |
)
|
|
725 |
|
|
726 |
! !
|
|
727 |
|
|
728 |
!MenuEditor class methodsFor:'specs'!
|
|
729 |
|
|
730 |
basicsItemSpec
|
|
731 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
732 |
|
|
733 |
"do not manually edit this - the painter/builder may not be able to
|
|
734 |
handle the specification if its corrupted."
|
|
735 |
|
|
736 |
"
|
|
737 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsItemSpec
|
|
738 |
MenuEditor new openInterface:#basicsItemSpec
|
|
739 |
"
|
|
740 |
|
|
741 |
<resource: #canvas>
|
|
742 |
|
|
743 |
^
|
|
744 |
|
|
745 |
#(#FullSpec
|
|
746 |
#'window:'
|
|
747 |
#(#WindowSpec
|
|
748 |
#'name:' 'uIPainterView'
|
|
749 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
750 |
#'label:' 'unnamed canvas'
|
|
751 |
#'bounds:' #(#Rectangle 0 0 267 319)
|
|
752 |
)
|
|
753 |
#'component:'
|
|
754 |
#(#SpecCollection
|
|
755 |
#'collection:'
|
|
756 |
#(
|
|
757 |
#(#LabelSpec
|
|
758 |
#'name:' 'nameKeyLabel'
|
|
759 |
#'layout:' #(#AlignmentOrigin 87 0 26 0 1 0.5)
|
|
760 |
#'label:' 'NameKey:'
|
|
761 |
#'resizeForLabel:' true
|
|
762 |
)
|
|
763 |
#(#InputFieldSpec
|
|
764 |
#'name:' 'itemNameKey'
|
|
765 |
#'layout:' #(#LayoutFrame 91 0 15 0 -5 1.0 37 0)
|
|
766 |
#'tabable:' true
|
|
767 |
#'model:' #nameKey
|
|
768 |
#'type:' #symbolOrNil
|
|
769 |
)
|
|
770 |
#(#LabelSpec
|
|
771 |
#'name:' 'labelLabel'
|
|
772 |
#'layout:' #(#AlignmentOrigin 87 0 53 0 1 0.5)
|
|
773 |
#'label:' 'Label'
|
|
774 |
#'resizeForLabel:' true
|
|
775 |
)
|
|
776 |
#(#InputFieldSpec
|
|
777 |
#'name:' 'itemLabel'
|
|
778 |
#'layout:' #(#LayoutFrame 91 0 42 0 -5 1.0 64 0)
|
|
779 |
#'tabable:' true
|
|
780 |
#'model:' #label
|
|
781 |
)
|
|
782 |
#(#LabelSpec
|
|
783 |
#'name:' 'valueLabel'
|
|
784 |
#'layout:' #(#AlignmentOrigin 87 0 79 0 1 0.5)
|
|
785 |
#'label:' 'Value:'
|
|
786 |
#'resizeForLabel:' true
|
|
787 |
)
|
|
788 |
#(#InputFieldSpec
|
|
789 |
#'name:' 'itemValue'
|
|
790 |
#'layout:' #(#LayoutFrame 91 0 68 0 -5 1.0 90 0)
|
|
791 |
#'tabable:' true
|
|
792 |
#'model:' #value
|
|
793 |
#'type:' #symbolOrNil
|
|
794 |
)
|
|
795 |
#(#LabelSpec
|
|
796 |
#'name:' 'indicationLabel'
|
|
797 |
#'layout:' #(#AlignmentOrigin 87 0 139 0 1 0.5)
|
|
798 |
#'label:' 'Indication:'
|
|
799 |
#'resizeForLabel:' true
|
|
800 |
)
|
|
801 |
#(#InputFieldSpec
|
|
802 |
#'name:' 'indicationValue'
|
|
803 |
#'layout:' #(#LayoutFrame 91 0 128 0 -5 1.0 150 0)
|
|
804 |
#'tabable:' true
|
|
805 |
#'model:' #indication
|
|
806 |
#'type:' #symbolOrNil
|
|
807 |
)
|
|
808 |
)
|
|
809 |
)
|
|
810 |
)
|
|
811 |
!
|
|
812 |
|
218
|
813 |
basicsLinkSpec
|
|
814 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
815 |
|
|
816 |
"do not manually edit this - the painter/builder may not be able to
|
|
817 |
handle the specification if its corrupted."
|
|
818 |
|
|
819 |
"
|
|
820 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsLinkSpec
|
|
821 |
MenuEditor new openInterface:#basicsLinkSpec
|
|
822 |
"
|
|
823 |
|
|
824 |
<resource: #canvas>
|
|
825 |
|
|
826 |
^
|
|
827 |
|
|
828 |
#(#FullSpec
|
|
829 |
#'window:'
|
|
830 |
#(#WindowSpec
|
|
831 |
#'name:' 'uIPainterView'
|
|
832 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
833 |
#'label:' 'unnamed canvas'
|
|
834 |
#'bounds:' #(#Rectangle 0 0 267 319)
|
|
835 |
)
|
|
836 |
#'component:'
|
|
837 |
#(#SpecCollection
|
|
838 |
#'collection:'
|
|
839 |
#(
|
|
840 |
#(#LabelSpec
|
|
841 |
#'name:' 'nameKeyLabel'
|
|
842 |
#'layout:' #(#AlignmentOrigin 87 0 26 0 1 0.5)
|
|
843 |
#'label:' 'NameKey:'
|
|
844 |
#'resizeForLabel:' true
|
|
845 |
)
|
|
846 |
#(#InputFieldSpec
|
|
847 |
#'name:' 'itemNameKey'
|
|
848 |
#'layout:' #(#LayoutFrame 91 0 15 0 -5 1.0 37 0)
|
|
849 |
#'tabable:' true
|
|
850 |
#'model:' #nameKey
|
|
851 |
#'type:' #symbolOrNil
|
|
852 |
)
|
|
853 |
#(#LabelSpec
|
|
854 |
#'name:' 'labelLabel'
|
|
855 |
#'layout:' #(#AlignmentOrigin 87 0 53 0 1 0.5)
|
|
856 |
#'label:' 'Label'
|
|
857 |
#'resizeForLabel:' true
|
|
858 |
)
|
|
859 |
#(#InputFieldSpec
|
|
860 |
#'name:' 'itemLabel'
|
|
861 |
#'layout:' #(#LayoutFrame 91 0 42 0 -5 1.0 64 0)
|
|
862 |
#'tabable:' true
|
|
863 |
#'model:' #label
|
|
864 |
)
|
|
865 |
#(#InputFieldSpec
|
|
866 |
#'name:' 'submenuChannel'
|
|
867 |
#'layout:' #(#LayoutFrame 91 0 69 0 -5 1.0 91 0)
|
|
868 |
#'tabable:' true
|
|
869 |
#'model:' #submenuChannel
|
|
870 |
#'type:' #symbolOrNil
|
|
871 |
)
|
|
872 |
#(#LabelSpec
|
|
873 |
#'name:' 'menuLabel'
|
|
874 |
#'layout:' #(#AlignmentOrigin 87 0 80 0 1 0.5)
|
|
875 |
#'label:' 'Menu:'
|
|
876 |
#'resizeForLabel:' true
|
|
877 |
)
|
|
878 |
)
|
|
879 |
)
|
|
880 |
)
|
|
881 |
!
|
|
882 |
|
199
|
883 |
basicsMenuSpec
|
|
884 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
885 |
|
|
886 |
"do not manually edit this - the painter/builder may not be able to
|
|
887 |
handle the specification if its corrupted."
|
|
888 |
|
|
889 |
"
|
|
890 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsMenuSpec
|
|
891 |
MenuEditor new openInterface:#basicsMenuSpec
|
|
892 |
"
|
|
893 |
|
|
894 |
<resource: #canvas>
|
|
895 |
|
|
896 |
^
|
|
897 |
|
|
898 |
#(#FullSpec
|
|
899 |
#'window:'
|
|
900 |
#(#WindowSpec
|
|
901 |
#'name:' 'uIPainterView'
|
|
902 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
903 |
#'label:' 'unnamed canvas'
|
|
904 |
#'bounds:' #(#Rectangle 0 0 267 319)
|
|
905 |
)
|
|
906 |
#'component:'
|
|
907 |
#(#SpecCollection
|
|
908 |
#'collection:'
|
|
909 |
#(
|
|
910 |
#(#LabelSpec
|
|
911 |
#'name:' 'nameKeyLabel'
|
|
912 |
#'layout:' #(#AlignmentOrigin 87 0 26 0 1 0.5)
|
|
913 |
#'label:' 'NameKey:'
|
|
914 |
#'resizeForLabel:' true
|
|
915 |
)
|
|
916 |
#(#InputFieldSpec
|
|
917 |
#'name:' 'itemNameKey'
|
|
918 |
#'layout:' #(#LayoutFrame 91 0 15 0 -5 1.0 37 0)
|
|
919 |
#'tabable:' true
|
|
920 |
#'model:' #nameKey
|
|
921 |
#'type:' #symbolOrNil
|
|
922 |
)
|
|
923 |
#(#LabelSpec
|
|
924 |
#'name:' 'labelLabel'
|
|
925 |
#'layout:' #(#AlignmentOrigin 87 0 53 0 1 0.5)
|
|
926 |
#'label:' 'Label'
|
|
927 |
#'resizeForLabel:' true
|
|
928 |
)
|
|
929 |
#(#InputFieldSpec
|
|
930 |
#'name:' 'itemLabel'
|
|
931 |
#'layout:' #(#LayoutFrame 91 0 42 0 -5 1.0 64 0)
|
|
932 |
#'tabable:' true
|
|
933 |
#'model:' #label
|
|
934 |
)
|
|
935 |
)
|
|
936 |
)
|
|
937 |
)
|
|
938 |
!
|
|
939 |
|
|
940 |
basicsRootSpec
|
|
941 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
942 |
|
|
943 |
"do not manually edit this - the painter/builder may not be able to
|
|
944 |
handle the specification if its corrupted."
|
|
945 |
|
|
946 |
"
|
|
947 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsRootSpec
|
|
948 |
MenuEditor new openInterface:#basicsRootSpec
|
|
949 |
"
|
|
950 |
|
|
951 |
<resource: #canvas>
|
|
952 |
|
|
953 |
^
|
|
954 |
|
|
955 |
#(#FullSpec
|
|
956 |
#'window:'
|
|
957 |
#(#WindowSpec
|
|
958 |
#'name:' 'uIPainterView'
|
|
959 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
960 |
#'label:' 'unnamed canvas'
|
|
961 |
#'bounds:' #(#Rectangle 0 0 267 319)
|
|
962 |
)
|
|
963 |
#'component:'
|
|
964 |
#(#SpecCollection
|
|
965 |
#'collection:'
|
|
966 |
#(
|
|
967 |
#(#LabelSpec
|
|
968 |
#'name:' 'selectorLabel'
|
|
969 |
#'layout:' #(#AlignmentOrigin 78 0 53 0 1 0.5)
|
|
970 |
#'label:' 'Selector:'
|
|
971 |
#'resizeForLabel:' true
|
|
972 |
)
|
|
973 |
#(#InputFieldSpec
|
|
974 |
#'name:' 'selector'
|
|
975 |
#'layout:' #(#LayoutFrame 82 0 42 0 -14 1.0 64 0)
|
|
976 |
#'tabable:' true
|
|
977 |
#'model:' #label
|
|
978 |
)
|
|
979 |
)
|
|
980 |
)
|
|
981 |
)
|
|
982 |
!
|
|
983 |
|
218
|
984 |
basicsSeparatorSpec
|
199
|
985 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
986 |
|
|
987 |
"do not manually edit this - the painter/builder may not be able to
|
|
988 |
handle the specification if its corrupted."
|
|
989 |
|
|
990 |
"
|
218
|
991 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsSeparatorSpec
|
|
992 |
MenuEditor new openInterface:#basicsSeparatorSpec
|
199
|
993 |
"
|
|
994 |
|
|
995 |
<resource: #canvas>
|
|
996 |
|
|
997 |
^
|
|
998 |
|
|
999 |
#(#FullSpec
|
|
1000 |
#'window:'
|
|
1001 |
#(#WindowSpec
|
|
1002 |
#'name:' 'uIPainterView'
|
|
1003 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
1004 |
#'label:' 'unnamed canvas'
|
|
1005 |
#'bounds:' #(#Rectangle 0 0 267 319)
|
|
1006 |
)
|
|
1007 |
#'component:'
|
|
1008 |
#(#SpecCollection
|
|
1009 |
#'collection:'
|
|
1010 |
#(
|
218
|
1011 |
#(#LabelSpec
|
|
1012 |
#'name:' 'separatorLabel'
|
|
1013 |
#'layout:' #(#AlignmentOrigin 127 0 22 0 1 0.5)
|
|
1014 |
#'label:' 'Separator Type:'
|
|
1015 |
#'resizeForLabel:' true
|
|
1016 |
)
|
|
1017 |
#(#ComboListSpec
|
|
1018 |
#'name:' 'comboList1'
|
|
1019 |
#'layout:' #(#LayoutFrame 132 0 11 0 -6 1.0 33 0)
|
|
1020 |
#'model:' #seperatorSelection
|
|
1021 |
#'useIndex:' false
|
199
|
1022 |
)
|
|
1023 |
)
|
|
1024 |
)
|
|
1025 |
)
|
|
1026 |
!
|
|
1027 |
|
|
1028 |
detailsEditSpec
|
|
1029 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
1030 |
|
|
1031 |
"do not manually edit this - the painter/builder may not be able to
|
|
1032 |
handle the specification if its corrupted."
|
|
1033 |
|
|
1034 |
"
|
|
1035 |
UIPainter new openOnClass:MenuEditor andSelector:#detailsEditSpec
|
|
1036 |
MenuEditor new openInterface:#detailsEditSpec
|
|
1037 |
"
|
|
1038 |
|
|
1039 |
<resource: #canvas>
|
|
1040 |
|
|
1041 |
^
|
|
1042 |
|
|
1043 |
#(#FullSpec
|
|
1044 |
#'window:'
|
|
1045 |
#(#WindowSpec
|
|
1046 |
#'name:' 'uIPainterView'
|
|
1047 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
1048 |
#'label:' 'unnamed canvas'
|
|
1049 |
#'bounds:' #(#Rectangle 0 0 259 288)
|
|
1050 |
)
|
|
1051 |
#'component:'
|
|
1052 |
#(#SpecCollection
|
|
1053 |
#'collection:'
|
|
1054 |
#(
|
|
1055 |
#(#LabelSpec
|
|
1056 |
#'name:' 'enabledLabel'
|
|
1057 |
#'layout:' #(#AlignmentOrigin 87 0 59 0 1 0.5)
|
|
1058 |
#'label:' 'Enabled:'
|
|
1059 |
#'resizeForLabel:' true
|
|
1060 |
)
|
|
1061 |
#(#InputFieldSpec
|
|
1062 |
#'name:' 'enabled'
|
|
1063 |
#'layout:' #(#LayoutFrame 91 0 48 0 -5 1.0 70 0)
|
|
1064 |
#'tabable:' true
|
|
1065 |
#'model:' #enabled
|
|
1066 |
#'type:' #symbolOrNil
|
|
1067 |
)
|
|
1068 |
#(#LabelSpec
|
|
1069 |
#'name:' 'shortcutKeyLabel'
|
|
1070 |
#'layout:' #(#AlignmentOrigin 87 0 33 0 1 0.5)
|
|
1071 |
#'label:' 'Accelerator:'
|
|
1072 |
#'resizeForLabel:' true
|
|
1073 |
)
|
|
1074 |
#(#InputFieldSpec
|
|
1075 |
#'name:' 'accelerator'
|
|
1076 |
#'layout:' #(#LayoutFrame 91 0 22 0 -5 1.0 44 0)
|
|
1077 |
#'tabable:' true
|
|
1078 |
#'model:' #shortcutKey
|
|
1079 |
#'type:' #symbolOrNil
|
|
1080 |
)
|
|
1081 |
#(#LabelSpec
|
|
1082 |
#'name:' 'accessCharPosLabel'
|
|
1083 |
#'layout:' #(#AlignmentOrigin 181 0 127 0 1 0.5)
|
|
1084 |
#'label:' 'Access Character Position:'
|
|
1085 |
#'resizeForLabel:' true
|
|
1086 |
)
|
|
1087 |
#(#InputFieldSpec
|
|
1088 |
#'name:' 'accessCharaterPos'
|
|
1089 |
#'layout:' #(#LayoutFrame 184 0 116 0 -5 1.0 138 0)
|
|
1090 |
#'tabable:' true
|
|
1091 |
#'model:' #accessCharaterPos
|
|
1092 |
#'type:' #numberOrNil
|
|
1093 |
)
|
|
1094 |
)
|
|
1095 |
)
|
|
1096 |
)
|
|
1097 |
!
|
|
1098 |
|
|
1099 |
miscEditSpec
|
|
1100 |
"this window spec was automatically generated by the ST/X UIPainter"
|
|
1101 |
|
|
1102 |
"do not manually edit this - the painter/builder may not be able to
|
|
1103 |
handle the specification if its corrupted."
|
|
1104 |
|
|
1105 |
"
|
|
1106 |
UIPainter new openOnClass:MenuEditor andSelector:#miscEditSpec
|
|
1107 |
MenuEditor new openInterface:#miscEditSpec
|
|
1108 |
"
|
|
1109 |
|
|
1110 |
<resource: #canvas>
|
|
1111 |
|
|
1112 |
^
|
|
1113 |
|
|
1114 |
#(#FullSpec
|
|
1115 |
#'window:'
|
|
1116 |
#(#WindowSpec
|
|
1117 |
#'name:' 'uIPainterView'
|
|
1118 |
#'layout:' #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
|
|
1119 |
#'label:' 'unnamed canvas'
|
|
1120 |
#'bounds:' #(#Rectangle 0 0 245 142)
|
|
1121 |
)
|
|
1122 |
#'component:'
|
|
1123 |
#(#SpecCollection
|
|
1124 |
#'collection:'
|
|
1125 |
#(
|
|
1126 |
#(#LabelSpec
|
|
1127 |
#'name:' 'retrieverLabel'
|
|
1128 |
#'layout:' #(#AlignmentOrigin 77 0 26 0 1 0.5)
|
|
1129 |
#'label:' 'Retriever:'
|
|
1130 |
#'resizeForLabel:' true
|
|
1131 |
)
|
|
1132 |
#(#InputFieldSpec
|
|
1133 |
#'name:' 'retriever'
|
|
1134 |
#'layout:' #(#LayoutFrame 81 0 15 0 -8 1.0 37 0)
|
|
1135 |
#'tabable:' true
|
|
1136 |
#'model:' #retriever
|
|
1137 |
#'type:' #symbolOrNil
|
|
1138 |
)
|
|
1139 |
#(#LabelSpec
|
|
1140 |
#'name:' 'iconLabel'
|
|
1141 |
#'layout:' #(#AlignmentOrigin 77 0 50 0 1 0.5)
|
|
1142 |
#'label:' 'Icon:'
|
|
1143 |
#'resizeForLabel:' true
|
|
1144 |
)
|
|
1145 |
#(#InputFieldSpec
|
|
1146 |
#'name:' 'icon'
|
|
1147 |
#'layout:' #(#LayoutFrame 81 0 39 0 -8 1.0 61 0)
|
|
1148 |
#'tabable:' true
|
|
1149 |
#'model:' #icon
|
|
1150 |
#'type:' #symbolOrNil
|
|
1151 |
)
|
|
1152 |
#(#CheckBoxSpec
|
|
1153 |
#'name:' 'iconAndLabel'
|
|
1154 |
#'layout:' #(#AlignmentOrigin 15 0 100 0 0 0.5)
|
|
1155 |
#'tabable:' true
|
|
1156 |
#'model:' #iconAndLabel
|
|
1157 |
#'label:' 'Icon & Label'
|
|
1158 |
)
|
|
1159 |
)
|
|
1160 |
)
|
|
1161 |
)
|
|
1162 |
! !
|
|
1163 |
|
209
|
1164 |
!MenuEditor class methodsFor:'startup'!
|
|
1165 |
|
213
|
1166 |
openModalOnClass:aClass andSelector:aSelector
|
|
1167 |
^ self new openModalOnClass:aClass andSelector:aSelector
|
|
1168 |
|
|
1169 |
|
|
1170 |
!
|
|
1171 |
|
209
|
1172 |
openOnClass:aClass andSelector:aSelector
|
|
1173 |
^ self new openOnClass:aClass andSelector:aSelector
|
|
1174 |
|
|
1175 |
|
|
1176 |
! !
|
|
1177 |
|
199
|
1178 |
!MenuEditor methodsFor:'accessing'!
|
|
1179 |
|
218
|
1180 |
menuDefaultLink
|
|
1181 |
^ self class menuDefaultLink
|
|
1182 |
!
|
|
1183 |
|
199
|
1184 |
specClass
|
|
1185 |
^ specClass
|
|
1186 |
!
|
|
1187 |
|
|
1188 |
specClass:aClass
|
|
1189 |
aClass isBehavior ifTrue:[specClass := aClass name]
|
|
1190 |
ifFalse:[specClass := aClass].
|
218
|
1191 |
!
|
|
1192 |
|
|
1193 |
submenuTest
|
|
1194 |
"returns submenu assigned to item test
|
|
1195 |
"
|
|
1196 |
|menu|
|
|
1197 |
|
|
1198 |
menu := self painter asMenu.
|
|
1199 |
|
|
1200 |
menu allItemsDo:[:anItem|
|
|
1201 |
anItem value:nil.
|
|
1202 |
anItem enabled:true.
|
|
1203 |
].
|
|
1204 |
^ menu
|
199
|
1205 |
! !
|
|
1206 |
|
220
|
1207 |
!MenuEditor methodsFor:'accessing menu'!
|
|
1208 |
|
|
1209 |
menuButtons
|
|
1210 |
"this window spec was automatically generated by the ST/X MenuEditor"
|
|
1211 |
|
|
1212 |
^ self class menuButtons
|
|
1213 |
|
|
1214 |
|
|
1215 |
!
|
|
1216 |
|
|
1217 |
menuPainter
|
|
1218 |
"this window spec was automatically generated by the ST/X MenuEditor"
|
|
1219 |
|
|
1220 |
^ self class menuPainter
|
|
1221 |
|
|
1222 |
|
|
1223 |
! !
|
|
1224 |
|
199
|
1225 |
!MenuEditor methodsFor:'actions'!
|
|
1226 |
|
|
1227 |
accept
|
|
1228 |
"automatically generated by UIPainter ..."
|
|
1229 |
|
|
1230 |
|node cont|
|
|
1231 |
|
|
1232 |
node := self painter selectedNode.
|
|
1233 |
|
|
1234 |
node notNil ifTrue:[
|
|
1235 |
self isHelpToolSelected ifTrue:[
|
218
|
1236 |
self activeHelpTool accept
|
199
|
1237 |
].
|
|
1238 |
cont := node contents buildFromAspects:aspects.
|
|
1239 |
self painter selectedNodeChanged
|
|
1240 |
].
|
|
1241 |
self modifiedChannel value:false.
|
|
1242 |
!
|
|
1243 |
|
|
1244 |
cancel
|
|
1245 |
|node|
|
|
1246 |
|
|
1247 |
(node := self painter selectedNode) notNil ifTrue:[
|
|
1248 |
aspects do:[:anAspect| anAspect value:nil ].
|
|
1249 |
node contents toAspects:aspects.
|
|
1250 |
].
|
|
1251 |
self modifiedChannel value:false.
|
|
1252 |
|
|
1253 |
! !
|
|
1254 |
|
218
|
1255 |
!MenuEditor methodsFor:'active help'!
|
|
1256 |
|
|
1257 |
activeHelpTool
|
|
1258 |
"access current active help editor
|
|
1259 |
"
|
|
1260 |
activeHelpTool isNil ifTrue:[
|
|
1261 |
self activeHelpTool:(UIHelpTool new)
|
|
1262 |
].
|
|
1263 |
^ activeHelpTool
|
|
1264 |
!
|
|
1265 |
|
|
1266 |
activeHelpTool:anApplication
|
|
1267 |
"change current active help editor
|
|
1268 |
"
|
|
1269 |
activeHelpTool := anApplication.
|
|
1270 |
|
|
1271 |
activeHelpTool masterApplication isNil ifTrue:[
|
|
1272 |
activeHelpTool masterApplication:self.
|
|
1273 |
].
|
|
1274 |
!
|
|
1275 |
|
|
1276 |
isOwnerOfHelpTool
|
|
1277 |
"returns true in case of owner of the helptool
|
|
1278 |
"
|
|
1279 |
^ self activeHelpTool masterApplication == self
|
|
1280 |
! !
|
|
1281 |
|
199
|
1282 |
!MenuEditor methodsFor:'aspects'!
|
|
1283 |
|
|
1284 |
aspectFor:aKey
|
|
1285 |
"returns aspect for a key or nil
|
|
1286 |
"
|
|
1287 |
^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ]
|
|
1288 |
|
|
1289 |
|
|
1290 |
!
|
|
1291 |
|
218
|
1292 |
enabledStepIn
|
|
1293 |
|holder|
|
|
1294 |
|
|
1295 |
(holder := builder bindingAt:#enabledStepIn) isNil ifTrue:[
|
|
1296 |
builder aspectAt:#enabledStepIn put:(holder := false asValue).
|
|
1297 |
].
|
|
1298 |
^ holder
|
|
1299 |
|
|
1300 |
!
|
|
1301 |
|
|
1302 |
enabledStepOut
|
|
1303 |
|holder|
|
|
1304 |
|
|
1305 |
(holder := builder bindingAt:#enabledStepOut) isNil ifTrue:[
|
|
1306 |
builder aspectAt:#enabledStepOut put:(holder := false asValue).
|
|
1307 |
].
|
|
1308 |
^ holder
|
|
1309 |
|
|
1310 |
!
|
|
1311 |
|
|
1312 |
enabledStepOver
|
|
1313 |
|holder|
|
|
1314 |
|
|
1315 |
(holder := builder bindingAt:#enabledStepOver) isNil ifTrue:[
|
|
1316 |
builder aspectAt:#enabledStepOver put:(holder := false asValue).
|
|
1317 |
].
|
|
1318 |
^ holder
|
|
1319 |
!
|
|
1320 |
|
220
|
1321 |
hasAnySingleSelection
|
|
1322 |
|holder|
|
|
1323 |
|
|
1324 |
(holder := builder bindingAt:#hasAnySingleSelection) isNil ifTrue:[
|
|
1325 |
builder aspectAt:#hasAnySingleSelection put:(holder := false asValue).
|
|
1326 |
].
|
|
1327 |
^ holder
|
|
1328 |
|
|
1329 |
!
|
|
1330 |
|
|
1331 |
hasValidSelection
|
|
1332 |
|holder|
|
|
1333 |
|
|
1334 |
(holder := builder bindingAt:#hasValidSelection) isNil ifTrue:[
|
|
1335 |
builder aspectAt:#hasValidSelection put:(holder := false asValue).
|
|
1336 |
].
|
|
1337 |
^ holder
|
|
1338 |
|
|
1339 |
!
|
|
1340 |
|
|
1341 |
hasValidSingleSelection
|
|
1342 |
|holder|
|
|
1343 |
|
|
1344 |
(holder := builder bindingAt:#hasValidSingleSelection) isNil ifTrue:[
|
|
1345 |
builder aspectAt:#hasValidSingleSelection put:(holder := false asValue).
|
|
1346 |
].
|
|
1347 |
^ holder
|
|
1348 |
|
|
1349 |
!
|
|
1350 |
|
199
|
1351 |
menuPullDown
|
|
1352 |
|menu|
|
|
1353 |
|
|
1354 |
menu := Menu new.
|
|
1355 |
menu fromLiteralArrayEncoding:(self class menuPullDown).
|
|
1356 |
menu receiver:self.
|
|
1357 |
^ menu
|
|
1358 |
|
|
1359 |
|
|
1360 |
!
|
|
1361 |
|
|
1362 |
modifiedChannel
|
|
1363 |
"automatically generated by UIPainter ..."
|
|
1364 |
|
|
1365 |
|holder|
|
|
1366 |
|
|
1367 |
(holder := builder bindingAt:#modifiedChannel) isNil ifTrue:[
|
|
1368 |
builder aspectAt:#modifiedChannel put:(holder := false asValue).
|
|
1369 |
].
|
|
1370 |
^ holder
|
|
1371 |
!
|
|
1372 |
|
|
1373 |
tabCanvas
|
|
1374 |
"automatically generated by UIPainter ..."
|
|
1375 |
|
|
1376 |
|holder|
|
|
1377 |
|
|
1378 |
(holder := builder bindingAt:#tabCanvas) isNil ifTrue:[
|
|
1379 |
builder aspectAt:#tabCanvas put:(holder := SubCanvas new).
|
|
1380 |
].
|
|
1381 |
^ holder
|
|
1382 |
!
|
|
1383 |
|
|
1384 |
tabList
|
|
1385 |
"automatically generated by UIPainter ..."
|
|
1386 |
|
|
1387 |
|holder|
|
|
1388 |
|
|
1389 |
(holder := builder bindingAt:#tabList) isNil ifTrue:[
|
|
1390 |
builder aspectAt:#tabList put:(holder := ValueHolder new)
|
|
1391 |
].
|
|
1392 |
^ holder
|
|
1393 |
!
|
|
1394 |
|
|
1395 |
tabModel
|
|
1396 |
"automatically generated by UIPainter ..."
|
|
1397 |
|
|
1398 |
|holder|
|
|
1399 |
|
|
1400 |
(holder := builder bindingAt:#tabModel) isNil ifTrue:[
|
|
1401 |
holder := AspectAdaptor new subject:self; forAspect:#tabSelection.
|
|
1402 |
builder aspectAt:#tabModel put:holder.
|
|
1403 |
].
|
|
1404 |
^ holder
|
|
1405 |
|
|
1406 |
! !
|
|
1407 |
|
|
1408 |
!MenuEditor methodsFor:'change & update'!
|
|
1409 |
|
|
1410 |
update:something with:aParameter from:changedObject
|
|
1411 |
"one of my models changed its value
|
|
1412 |
"
|
|
1413 |
self modifiedChannel value:true
|
218
|
1414 |
!
|
|
1415 |
|
|
1416 |
updateEnabledChannels
|
|
1417 |
"update enabled channels
|
|
1418 |
"
|
220
|
1419 |
|node parent next painter state|
|
|
1420 |
|
|
1421 |
painter := self painter.
|
|
1422 |
node := painter selectedNode.
|
|
1423 |
state := false.
|
|
1424 |
|
|
1425 |
node notNil ifTrue:[
|
|
1426 |
self hasAnySingleSelection value:true.
|
|
1427 |
|
|
1428 |
(parent := node parent) notNil ifTrue:[
|
|
1429 |
next := parent childAt:((parent indexOfChild:node) + 1).
|
|
1430 |
self enabledStepIn value:(next notNil and:[next hasChildren]).
|
|
1431 |
self enabledStepOver value:(parent children size > 1).
|
|
1432 |
self enabledStepOut value:(parent parent notNil).
|
|
1433 |
self hasValidSingleSelection value:true.
|
|
1434 |
self hasValidSelection value:true.
|
|
1435 |
^ self
|
|
1436 |
]
|
218
|
1437 |
] ifFalse:[
|
220
|
1438 |
self hasAnySingleSelection value:false.
|
|
1439 |
|
|
1440 |
painter numberOfSelections ~~ 0 ifTrue:[
|
|
1441 |
state := (painter isInSelection:1) not
|
|
1442 |
]
|
|
1443 |
].
|
|
1444 |
self enabledStepOver value:false.
|
|
1445 |
self enabledStepIn value:false.
|
|
1446 |
self enabledStepOut value:false.
|
|
1447 |
self hasValidSingleSelection value:false.
|
|
1448 |
self hasValidSelection value:state.
|
|
1449 |
! !
|
|
1450 |
|
|
1451 |
!MenuEditor methodsFor:'event handling'!
|
|
1452 |
|
|
1453 |
doesNotUnderstand:aMessage
|
|
1454 |
|painter|
|
|
1455 |
|
|
1456 |
painter := self painter.
|
|
1457 |
|
|
1458 |
(painter respondsTo:(aMessage selector)) ifTrue:[
|
|
1459 |
^ aMessage sendTo:painter
|
|
1460 |
].
|
|
1461 |
super doesNotUnderstand:aMessage
|
|
1462 |
|
|
1463 |
|
199
|
1464 |
! !
|
|
1465 |
|
|
1466 |
!MenuEditor methodsFor:'queries'!
|
|
1467 |
|
|
1468 |
isHelpToolSelected
|
|
1469 |
"returns true if current selection is help tool
|
|
1470 |
"
|
|
1471 |
(slices notNil and:[tabSelection notNil]) ifTrue:[
|
|
1472 |
^ (slices at:tabSelection) last == #help
|
|
1473 |
].
|
|
1474 |
^ false
|
|
1475 |
! !
|
|
1476 |
|
|
1477 |
!MenuEditor methodsFor:'selection'!
|
|
1478 |
|
|
1479 |
menuChanged
|
|
1480 |
|node item slc sel|
|
|
1481 |
|
|
1482 |
(node := self painter selectedNode) notNil ifTrue:[
|
|
1483 |
aspects do:[:anAspect| anAspect value:nil ].
|
|
1484 |
item := node contents.
|
|
1485 |
item toAspects:aspects.
|
|
1486 |
|
218
|
1487 |
item isSeparator ifFalse:[
|
199
|
1488 |
node parent isNil ifFalse:[
|
218
|
1489 |
node hasChildren ifTrue:[
|
|
1490 |
slc := #slicesMenu
|
|
1491 |
] ifFalse:[
|
|
1492 |
item submenuChannel isNil ifTrue:[slc := #slicesItem]
|
|
1493 |
ifFalse:[slc := #slicesLink]
|
|
1494 |
].
|
199
|
1495 |
] ifTrue:[
|
|
1496 |
slc := #slicesRootMenu
|
|
1497 |
]
|
|
1498 |
] ifTrue:[
|
218
|
1499 |
slc := #slicesSeparatorMenu
|
199
|
1500 |
].
|
|
1501 |
slc := self class perform:slc.
|
|
1502 |
].
|
|
1503 |
self modifiedChannel value:false.
|
|
1504 |
|
|
1505 |
slc ~= slices ifTrue:[
|
|
1506 |
(slices := slc) notNil ifTrue:[
|
|
1507 |
tabSelection notNil ifTrue:[sel := tabSelection min:(slices size)]
|
|
1508 |
ifFalse:[sel := 1].
|
|
1509 |
|
|
1510 |
self tabList value:(slices collect:[:s| s first]).
|
|
1511 |
self tabModel setValue:nil.
|
|
1512 |
self tabModel value:sel.
|
|
1513 |
] ifFalse:[
|
|
1514 |
self tabList value:nil.
|
|
1515 |
self tabSelection:nil.
|
|
1516 |
]
|
|
1517 |
].
|
218
|
1518 |
self updateEnabledChannels
|
199
|
1519 |
!
|
|
1520 |
|
|
1521 |
tabSelection
|
|
1522 |
^ tabSelection
|
|
1523 |
!
|
|
1524 |
|
|
1525 |
tabSelection:aSelection
|
|
1526 |
|tool sel|
|
|
1527 |
|
|
1528 |
tabSelection == aSelection ifTrue:[
|
|
1529 |
^ self
|
|
1530 |
].
|
|
1531 |
|
|
1532 |
(tabSelection := aSelection) isNil ifTrue:[
|
|
1533 |
^ self tabCanvas client:nil
|
|
1534 |
].
|
|
1535 |
self isHelpToolSelected ifTrue:[
|
218
|
1536 |
self tabCanvas client:(tool := self activeHelpTool).
|
199
|
1537 |
tool model:(self aspectFor:#activeHelpKey)
|
|
1538 |
] ifFalse:[
|
|
1539 |
sel := (slices at:tabSelection) last.
|
|
1540 |
self tabCanvas client:self spec:(self class perform:sel) builder:builder
|
|
1541 |
]
|
|
1542 |
! !
|
|
1543 |
|
|
1544 |
!MenuEditor methodsFor:'startup / release'!
|
|
1545 |
|
|
1546 |
buildFrom:aClass andSelector:aSelector
|
218
|
1547 |
|oldClass newClass helpTool|
|
199
|
1548 |
|
|
1549 |
oldClass := self specClass.
|
|
1550 |
self specClass:aClass.
|
|
1551 |
newClass := self specClass.
|
|
1552 |
|
218
|
1553 |
(self isOwnerOfHelpTool and:[oldClass ~= newClass]) ifTrue:[
|
|
1554 |
self activeHelpTool helpSpecFrom:newClass
|
199
|
1555 |
].
|
|
1556 |
self painter buildFrom:newClass andSelector:aSelector.
|
|
1557 |
!
|
|
1558 |
|
|
1559 |
initialize
|
|
1560 |
"initialize channels
|
|
1561 |
"
|
218
|
1562 |
|holder|
|
|
1563 |
|
199
|
1564 |
super initialize.
|
|
1565 |
aspects := IdentityDictionary new.
|
|
1566 |
|
|
1567 |
#(
|
|
1568 |
label
|
|
1569 |
accessCharaterPos
|
218
|
1570 |
submenuChannel
|
199
|
1571 |
activeHelpKey
|
|
1572 |
enabled
|
|
1573 |
value
|
|
1574 |
nameKey
|
|
1575 |
indication
|
|
1576 |
shortcutKey
|
|
1577 |
retriever
|
|
1578 |
iconAndLabel
|
|
1579 |
icon
|
|
1580 |
|
218
|
1581 |
) do:[:aKey|
|
|
1582 |
aspects at:aKey put:(holder := ValueHolder new).
|
199
|
1583 |
holder addDependent:self.
|
|
1584 |
].
|
|
1585 |
|
218
|
1586 |
aspects at:#seperatorSelection put:(holder := SelectionInList new).
|
|
1587 |
holder list:(Item separatorList).
|
|
1588 |
holder addDependent:self.
|
199
|
1589 |
|
|
1590 |
|
|
1591 |
!
|
|
1592 |
|
213
|
1593 |
openModalOnClass:aClass andSelector:aSelector
|
|
1594 |
specClass := Association key:aClass value:aSelector.
|
|
1595 |
super openInterfaceModal.
|
|
1596 |
|
|
1597 |
!
|
|
1598 |
|
199
|
1599 |
openOnClass:aClass andSelector:aSelector
|
213
|
1600 |
specClass := Association key:aClass value:aSelector.
|
199
|
1601 |
super openInterface.
|
|
1602 |
self buildFrom:aClass andSelector:aSelector.
|
213
|
1603 |
|
209
|
1604 |
!
|
|
1605 |
|
|
1606 |
postBuildWith:builder
|
213
|
1607 |
|cls sel|
|
|
1608 |
|
|
1609 |
specClass isAssociation ifTrue:[
|
|
1610 |
cls := specClass key.
|
|
1611 |
sel := specClass value.
|
228
|
1612 |
|
|
1613 |
specClass := nil.
|
|
1614 |
|
|
1615 |
(sel isKindOf:Menu) ifTrue:[
|
|
1616 |
self buildFrom:cls andSelector:nil.
|
|
1617 |
^ self painter buildFromMenu:sel.
|
|
1618 |
]
|
|
1619 |
|
213
|
1620 |
].
|
|
1621 |
self buildFrom:cls andSelector:sel.
|
199
|
1622 |
! !
|
|
1623 |
|
|
1624 |
!MenuEditor methodsFor:'user interactions'!
|
|
1625 |
|
|
1626 |
doBrowseAppClass
|
|
1627 |
"open a browser on the class"
|
|
1628 |
|
|
1629 |
|cls|
|
|
1630 |
|
|
1631 |
(cls := self specClass) isNil ifTrue:[
|
|
1632 |
^ self information:'no class yet'.
|
|
1633 |
].
|
|
1634 |
|
|
1635 |
cls isBehavior ifFalse:[
|
|
1636 |
(cls := Smalltalk at:cls asSymbol) isNil ifTrue:[
|
|
1637 |
^ self information:'no valid class defined'.
|
|
1638 |
]
|
|
1639 |
].
|
224
|
1640 |
SystemBrowser openInClass:cls class selector:(self painter selectorName)
|
199
|
1641 |
|
|
1642 |
!
|
|
1643 |
|
|
1644 |
doDefineClass
|
|
1645 |
|
|
1646 |
aspects at:#classNameChannel put:(self specClass asValue).
|
|
1647 |
|
|
1648 |
(self openDialogInterface:#classDefineSpec) ifTrue:[
|
|
1649 |
self specClass:((aspects at:#classNameChannel) value)
|
|
1650 |
].
|
|
1651 |
|
|
1652 |
!
|
|
1653 |
|
|
1654 |
doFromClass
|
|
1655 |
|
|
1656 |
aspects at:#classNameChannel put:(self specClass asValue).
|
|
1657 |
aspects at:#methodNameChannel put:(self painter selectorName asValue).
|
|
1658 |
|
|
1659 |
(self openDialogInterface:#classAndMethodSpec) ifTrue:[
|
|
1660 |
self buildFrom:(aspects at:#classNameChannel) value
|
|
1661 |
andSelector:(aspects at:#methodNameChannel) value
|
|
1662 |
].
|
|
1663 |
!
|
|
1664 |
|
|
1665 |
doInstallHelp
|
|
1666 |
"install help text
|
|
1667 |
"
|
218
|
1668 |
self activeHelpTool installHelpSpecInto:(self specClass)
|
199
|
1669 |
!
|
|
1670 |
|
|
1671 |
doInstallSpec
|
|
1672 |
|cls selector painter menu spec mthd category code|
|
|
1673 |
|
|
1674 |
(cls := self specClass) isNil ifTrue:[
|
|
1675 |
^ self information:'no class yet'.
|
|
1676 |
].
|
|
1677 |
|
|
1678 |
cls isBehavior ifFalse:[
|
|
1679 |
(cls := Smalltalk at:cls asSymbol) isNil ifTrue:[
|
|
1680 |
^ self information:'no valid class defined'.
|
|
1681 |
]
|
|
1682 |
].
|
|
1683 |
painter := self painter.
|
|
1684 |
selector := painter selectorName.
|
|
1685 |
menu := painter asMenu.
|
|
1686 |
|
|
1687 |
menu isNil ifTrue:[
|
|
1688 |
^ self information:'no menu defined'
|
|
1689 |
].
|
|
1690 |
menu := menu literalArrayEncoding.
|
|
1691 |
spec := WriteStream on:String new.
|
|
1692 |
UISpecification prettyPrintSpecArray:menu on:spec indent:5.
|
|
1693 |
spec := spec contents.
|
|
1694 |
|
|
1695 |
"/ if that method already exists, do not overwrite the category
|
|
1696 |
|
|
1697 |
category := 'interface specs'.
|
|
1698 |
(mthd := cls class compiledMethodAt:selector) notNil ifTrue:[
|
|
1699 |
category := mthd category.
|
|
1700 |
].
|
|
1701 |
|
|
1702 |
code := Character excla asString
|
|
1703 |
, cls name , ' class methodsFor:' , category storeString
|
|
1704 |
, Character excla asString , '\\'
|
|
1705 |
|
|
1706 |
, selector , '\'
|
|
1707 |
, ' "this window spec was automatically generated by the ST/X MenuEditor"\\'
|
|
1708 |
, ' "do not manually edit this - the builder may not be able to\'
|
|
1709 |
, ' handle the specification if its corrupted."\\'
|
|
1710 |
, ' "\'
|
|
1711 |
, ' MenuEditor new openOnClass:' , cls name , ' andSelector:#' , selector , '\'
|
|
1712 |
, ' (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , selector , ')) startUp\'
|
|
1713 |
, ' "\'.
|
|
1714 |
|
|
1715 |
code := code
|
|
1716 |
, '\'
|
|
1717 |
, ' <resource: #menu>\\'
|
|
1718 |
, ' ^\'
|
|
1719 |
, ' ', spec
|
|
1720 |
, '\'
|
|
1721 |
, Character excla asString
|
|
1722 |
, ' '
|
|
1723 |
, Character excla asString
|
|
1724 |
, '\\'.
|
|
1725 |
|
|
1726 |
code := code withCRs.
|
|
1727 |
(ReadStream on:code) fileIn.
|
|
1728 |
|
218
|
1729 |
(cls compiledMethodAt:selector) isNil ifTrue:[
|
|
1730 |
category := 'accessing menu'.
|
|
1731 |
code := Character excla asString
|
|
1732 |
, cls name , ' methodsFor:' , category storeString
|
|
1733 |
, Character excla asString , '\\'
|
|
1734 |
|
|
1735 |
, selector , '\'
|
|
1736 |
, ' "this window spec was automatically generated by the ST/X MenuEditor"\\'
|
|
1737 |
, ' ^ self class ', selector, '\\'
|
|
1738 |
, '\'
|
|
1739 |
, Character excla asString
|
|
1740 |
, ' '
|
|
1741 |
, Character excla asString
|
|
1742 |
, '\\'.
|
|
1743 |
|
|
1744 |
code := code withCRs.
|
|
1745 |
(ReadStream on:code) fileIn.
|
|
1746 |
].
|
|
1747 |
|
|
1748 |
|
199
|
1749 |
!
|
|
1750 |
|
|
1751 |
doNew
|
|
1752 |
self buildFrom:nil andSelector:(self painter selectorName)
|
|
1753 |
!
|
|
1754 |
|
|
1755 |
doPickAMenu
|
|
1756 |
|
228
|
1757 |
|view|
|
199
|
1758 |
|
218
|
1759 |
view := Screen current viewFromUser.
|
199
|
1760 |
|
218
|
1761 |
(view isNil or:[view == Screen current rootView]) ifTrue:[
|
199
|
1762 |
^ self
|
|
1763 |
].
|
228
|
1764 |
view specClass == MenuPanelSpec ifTrue:[
|
218
|
1765 |
^ self painter buildFromMenu:(view asMenu)
|
|
1766 |
].
|
228
|
1767 |
^ nil
|
218
|
1768 |
!
|
199
|
1769 |
|
218
|
1770 |
doStepDown
|
|
1771 |
"move selected child after next child
|
|
1772 |
"
|
|
1773 |
self painter doStepOver:1
|
|
1774 |
!
|
|
1775 |
|
|
1776 |
doStepIn
|
|
1777 |
self painter doStepIn
|
199
|
1778 |
|
218
|
1779 |
!
|
199
|
1780 |
|
218
|
1781 |
doStepOut
|
|
1782 |
self painter doStepOut
|
|
1783 |
!
|
|
1784 |
|
|
1785 |
doStepUp
|
|
1786 |
"move selected child after next child
|
|
1787 |
"
|
|
1788 |
self painter doStepOver:-1
|
199
|
1789 |
! !
|
|
1790 |
|
|
1791 |
!MenuEditor methodsFor:'values'!
|
|
1792 |
|
|
1793 |
painter
|
|
1794 |
"automatically generated by UIPainter ..."
|
|
1795 |
|
|
1796 |
|painter|
|
|
1797 |
|
|
1798 |
(painter := builder bindingAt:#painter) isNil ifTrue:[
|
|
1799 |
painter := Painter new.
|
|
1800 |
painter action:[:dummy| self menuChanged ].
|
|
1801 |
builder aspectAt:#painter put:painter.
|
|
1802 |
].
|
|
1803 |
^ painter
|
|
1804 |
! !
|
|
1805 |
|
218
|
1806 |
!MenuEditor::Item class methodsFor:'constants'!
|
|
1807 |
|
|
1808 |
separatorList
|
|
1809 |
^ #( 'blank' 'single line' 'double line' )
|
|
1810 |
!
|
|
1811 |
|
|
1812 |
separatorSlices
|
|
1813 |
^ #(
|
|
1814 |
( #blank '' )
|
|
1815 |
( #single '-' )
|
|
1816 |
( #double '=' )
|
|
1817 |
)
|
|
1818 |
! !
|
|
1819 |
|
199
|
1820 |
!MenuEditor::Item class methodsFor:'documentation'!
|
|
1821 |
|
|
1822 |
documentation
|
|
1823 |
"
|
213
|
1824 |
implements the contents assigned to a TreeItem. An instance
|
199
|
1825 |
is associated with one item and keeps all its information
|
|
1826 |
|
|
1827 |
[see also:]
|
213
|
1828 |
TreeItem
|
199
|
1829 |
MenuEditor
|
|
1830 |
|
|
1831 |
[author:]
|
|
1832 |
Claus Atzkern
|
|
1833 |
"
|
|
1834 |
|
|
1835 |
|
|
1836 |
! !
|
|
1837 |
|
|
1838 |
!MenuEditor::Item methodsFor:'accessing'!
|
|
1839 |
|
|
1840 |
label
|
|
1841 |
"return the value of the instance variable 'label' (automatically generated)"
|
|
1842 |
|
|
1843 |
^ label!
|
|
1844 |
|
|
1845 |
label:something
|
|
1846 |
"set the value of the instance variable 'label' (automatically generated)"
|
|
1847 |
|
218
|
1848 |
label := something ? '-'.
|
|
1849 |
!
|
|
1850 |
|
|
1851 |
separatorType
|
|
1852 |
"returns separator type assigned to item or nil
|
|
1853 |
"
|
|
1854 |
|c|
|
|
1855 |
|
|
1856 |
label size > 1 ifFalse:[
|
|
1857 |
label size == 0 ifTrue:[
|
|
1858 |
^ #blank
|
|
1859 |
].
|
|
1860 |
c := label first.
|
|
1861 |
c == $- ifTrue:[^ #single].
|
|
1862 |
c == $= ifTrue:[^ #double].
|
|
1863 |
].
|
|
1864 |
^ nil
|
|
1865 |
|
|
1866 |
!
|
|
1867 |
|
|
1868 |
submenuChannel
|
|
1869 |
"return the value of the instance variable 'submenuChannel' (automatically generated)"
|
|
1870 |
|
|
1871 |
^ submenuChannel
|
|
1872 |
!
|
|
1873 |
|
|
1874 |
submenuChannel:aChannel
|
|
1875 |
"return the value of the instance variable 'submenuChannel' (automatically generated)"
|
|
1876 |
|
|
1877 |
submenuChannel := aChannel
|
|
1878 |
! !
|
199
|
1879 |
|
|
1880 |
!MenuEditor::Item methodsFor:'conversion'!
|
|
1881 |
|
|
1882 |
asMenuItem
|
|
1883 |
"converts self to a menu item
|
|
1884 |
"
|
|
1885 |
|item rcv|
|
|
1886 |
|
218
|
1887 |
item := MenuItem labeled:label.
|
199
|
1888 |
|
218
|
1889 |
self isSeparator ifFalse:[
|
199
|
1890 |
item activeHelpKey:activeHelpKey.
|
|
1891 |
item enabled:enabled.
|
|
1892 |
item accessCharacterPosition:accessCharaterPos.
|
218
|
1893 |
item submenuChannel:submenuChannel.
|
199
|
1894 |
item nameKey:nameKey.
|
|
1895 |
item shortcutKeyCharacter:shortcutKey.
|
|
1896 |
item value:value.
|
|
1897 |
item indication:indication.
|
|
1898 |
|
|
1899 |
icon notNil ifTrue:[
|
|
1900 |
rcv := ResourceRetriever new.
|
|
1901 |
rcv className:retriever.
|
|
1902 |
rcv selector:icon.
|
|
1903 |
iconAndLabel == true ifTrue:[
|
|
1904 |
rcv labelText:label
|
|
1905 |
].
|
|
1906 |
item labelImage:rcv
|
|
1907 |
]
|
|
1908 |
].
|
|
1909 |
^ item.
|
|
1910 |
!
|
|
1911 |
|
|
1912 |
buildFromAspects:aspects
|
218
|
1913 |
|name slice|
|
199
|
1914 |
|
218
|
1915 |
self isSeparator ifFalse:[
|
199
|
1916 |
name := label.
|
|
1917 |
label := (aspects at:#label) value.
|
|
1918 |
|
218
|
1919 |
(label isNil or:[self isSeparator]) ifTrue:[
|
199
|
1920 |
(aspects at:#label) value:(label := name)
|
|
1921 |
].
|
|
1922 |
|
|
1923 |
activeHelpKey := (aspects at:#activeHelpKey) value.
|
|
1924 |
enabled := (aspects at:#enabled) value.
|
|
1925 |
value := (aspects at:#value) value.
|
|
1926 |
nameKey := (aspects at:#nameKey) value.
|
|
1927 |
indication := (aspects at:#indication) value.
|
|
1928 |
shortcutKey := (aspects at:#shortcutKey) value.
|
|
1929 |
accessCharaterPos := (aspects at:#accessCharaterPos) value.
|
218
|
1930 |
submenuChannel := (aspects at:#submenuChannel) value.
|
199
|
1931 |
retriever := (aspects at:#retriever) value.
|
|
1932 |
icon := (aspects at:#icon) value.
|
|
1933 |
iconAndLabel := (aspects at:#iconAndLabel) value.
|
|
1934 |
] ifTrue:[
|
218
|
1935 |
name := (aspects at:#seperatorSelection) selectionIndex.
|
|
1936 |
label := (self class separatorSlices at:name) last.
|
199
|
1937 |
]
|
|
1938 |
!
|
|
1939 |
|
|
1940 |
buildFromMenuItem:anItem
|
|
1941 |
|rtv|
|
|
1942 |
|
218
|
1943 |
self label:(anItem label).
|
|
1944 |
activeHelpKey := anItem activeHelpKey.
|
199
|
1945 |
|
|
1946 |
(enabled := anItem enabled) isSymbol ifFalse:[
|
|
1947 |
enabled := nil
|
|
1948 |
].
|
|
1949 |
|
|
1950 |
(value := anItem value) isSymbol ifFalse:[
|
|
1951 |
value := nil.
|
|
1952 |
].
|
|
1953 |
|
|
1954 |
(indication := anItem indication) isSymbol ifFalse:[
|
|
1955 |
indication := nil
|
|
1956 |
].
|
|
1957 |
|
|
1958 |
nameKey := anItem nameKey.
|
|
1959 |
shortcutKey := anItem shortcutKeyCharacter.
|
|
1960 |
accessCharaterPos := anItem accessCharacterPosition.
|
218
|
1961 |
submenuChannel := anItem submenuChannel.
|
199
|
1962 |
|
|
1963 |
( ((rtv := anItem adornment) notNil)
|
|
1964 |
and:[(rtv := rtv labelImage) isKindOf:ResourceRetriever]
|
|
1965 |
) ifTrue:[
|
|
1966 |
retriever := rtv className.
|
|
1967 |
icon := rtv selector.
|
|
1968 |
|
|
1969 |
(iconAndLabel := rtv labelText notNil) ifTrue:[
|
|
1970 |
label := rtv labelText.
|
|
1971 |
]
|
|
1972 |
]
|
|
1973 |
!
|
|
1974 |
|
|
1975 |
toAspects:aspects
|
218
|
1976 |
|type idx slice|
|
199
|
1977 |
|
218
|
1978 |
(type := self separatorType) notNil ifTrue:[
|
|
1979 |
type := self class separatorSlices findFirst:[:el| el first == type ].
|
|
1980 |
(aspects at:#seperatorSelection) selectionIndex:type.
|
199
|
1981 |
] ifFalse:[
|
|
1982 |
(aspects at:#label) value:label.
|
|
1983 |
(aspects at:#activeHelpKey) value:activeHelpKey.
|
|
1984 |
(aspects at:#enabled) value:enabled.
|
|
1985 |
(aspects at:#value) value:value.
|
|
1986 |
(aspects at:#nameKey) value:nameKey.
|
|
1987 |
(aspects at:#indication) value:indication.
|
|
1988 |
(aspects at:#shortcutKey) value:shortcutKey.
|
|
1989 |
(aspects at:#accessCharaterPos) value:accessCharaterPos.
|
218
|
1990 |
(aspects at:#submenuChannel) value:submenuChannel.
|
199
|
1991 |
(aspects at:#retriever) value:retriever.
|
|
1992 |
(aspects at:#icon) value:icon.
|
|
1993 |
(aspects at:#iconAndLabel) value:iconAndLabel.
|
|
1994 |
]
|
|
1995 |
! !
|
|
1996 |
|
|
1997 |
!MenuEditor::Item methodsFor:'queries'!
|
|
1998 |
|
218
|
1999 |
isSeparator
|
|
2000 |
"returns true if item is a seperator
|
|
2001 |
"
|
|
2002 |
^ self separatorType notNil
|
199
|
2003 |
! !
|
|
2004 |
|
220
|
2005 |
!MenuEditor::Painter class methodsFor:'constants'!
|
|
2006 |
|
|
2007 |
imageMenuLink
|
|
2008 |
ImageMenuLink isNil ifTrue:[
|
|
2009 |
ImageMenuLink := Image fromFile:('xpmBitmaps/document_images/tiny_yellow_dir_link.xpm').
|
|
2010 |
].
|
|
2011 |
^ ImageMenuLink
|
|
2012 |
"
|
|
2013 |
ImageMenuLink := nil
|
|
2014 |
"
|
|
2015 |
|
|
2016 |
!
|
|
2017 |
|
|
2018 |
imageSeparator
|
|
2019 |
ImageSeparator isNil ifTrue:[
|
|
2020 |
ImageSeparator := Image fromFile:('xpmBitmaps/document_images/tiny_file_exec.xpm').
|
|
2021 |
].
|
|
2022 |
^ ImageSeparator
|
|
2023 |
"
|
|
2024 |
ImageSeparator := nil
|
|
2025 |
"
|
|
2026 |
|
|
2027 |
! !
|
|
2028 |
|
199
|
2029 |
!MenuEditor::Painter class methodsFor:'defaults'!
|
|
2030 |
|
|
2031 |
defaultMenuMessage
|
|
2032 |
"This message is the default yo be sent to the menuHolder to get a menu
|
|
2033 |
"
|
|
2034 |
^ #menu
|
|
2035 |
|
|
2036 |
|
|
2037 |
! !
|
|
2038 |
|
|
2039 |
!MenuEditor::Painter class methodsFor:'documentation'!
|
|
2040 |
|
|
2041 |
documentation
|
|
2042 |
"
|
|
2043 |
menu selection list
|
|
2044 |
|
|
2045 |
[see also:]
|
|
2046 |
SelectionInTreeView
|
213
|
2047 |
SelectionInTree
|
|
2048 |
TreeItem
|
199
|
2049 |
|
|
2050 |
[author:]
|
|
2051 |
Claus Atzkern
|
|
2052 |
"
|
|
2053 |
|
|
2054 |
|
|
2055 |
! !
|
|
2056 |
|
|
2057 |
!MenuEditor::Painter methodsFor:'accessing'!
|
|
2058 |
|
|
2059 |
root
|
|
2060 |
^ listOfNodes first
|
|
2061 |
!
|
|
2062 |
|
|
2063 |
selectorName
|
|
2064 |
^ (listOfNodes first contents label) asSymbol
|
|
2065 |
! !
|
|
2066 |
|
|
2067 |
!MenuEditor::Painter methodsFor:'building'!
|
|
2068 |
|
|
2069 |
buildFrom:aClass andSelector:aSelector
|
|
2070 |
|spec cls menu node|
|
|
2071 |
|
|
2072 |
(aClass notNil and:[aSelector notNil]) ifTrue:[
|
|
2073 |
aClass isBehavior ifFalse:[cls := Smalltalk at:aClass asSymbol]
|
|
2074 |
ifTrue:[cls := aClass].
|
|
2075 |
|
|
2076 |
(cls respondsTo:aSelector) ifTrue:[
|
|
2077 |
spec := cls perform:aSelector
|
|
2078 |
]
|
|
2079 |
].
|
|
2080 |
spec isNil ifFalse:[
|
|
2081 |
menu := Menu new fromLiteralArrayEncoding:spec.
|
213
|
2082 |
node := self nodeLabel:(aSelector asString).
|
199
|
2083 |
self subMenu:menu parent:node.
|
|
2084 |
] ifTrue:[
|
|
2085 |
aSelector notNil ifTrue:[cls := aSelector asString]
|
|
2086 |
ifFalse:[cls := 'menu'].
|
|
2087 |
|
213
|
2088 |
node := self nodeLabel:cls.
|
199
|
2089 |
].
|
|
2090 |
|
|
2091 |
node hasChildren ifFalse:[
|
213
|
2092 |
node add:(self nodeLabel:'undefined')
|
199
|
2093 |
].
|
213
|
2094 |
node expand.
|
199
|
2095 |
model root:node.
|
|
2096 |
|
|
2097 |
!
|
|
2098 |
|
|
2099 |
buildFromMenu:aMenu
|
|
2100 |
|
|
2101 |
|spec cls node|
|
|
2102 |
|
213
|
2103 |
node := self nodeLabel:'menu'.
|
199
|
2104 |
self subMenu:aMenu parent:node.
|
|
2105 |
|
|
2106 |
node hasChildren ifFalse:[
|
213
|
2107 |
node add:(self nodeLabel:'undefined')
|
199
|
2108 |
].
|
213
|
2109 |
node expand.
|
199
|
2110 |
model root:node.
|
|
2111 |
|
|
2112 |
!
|
|
2113 |
|
213
|
2114 |
menuItem:anItem
|
199
|
2115 |
|
|
2116 |
|level node submenu grp ctr sep|
|
|
2117 |
|
213
|
2118 |
node := self nodeLabel:(anItem label).
|
199
|
2119 |
node contents buildFromMenuItem:anItem.
|
|
2120 |
node name:(node contents label).
|
|
2121 |
self subMenu:(anItem submenu) parent:node.
|
|
2122 |
^ node.
|
|
2123 |
|
|
2124 |
|
|
2125 |
!
|
|
2126 |
|
|
2127 |
subMenu:aMenu parent:aParent
|
213
|
2128 |
|idx grp|
|
199
|
2129 |
|
|
2130 |
aMenu isNil ifFalse:[
|
|
2131 |
grp := aMenu groupSizes.
|
213
|
2132 |
aMenu itemsDo:[:i| aParent add:(self menuItem:i)].
|
199
|
2133 |
|
|
2134 |
grp notNil ifTrue:[
|
213
|
2135 |
idx := 0.
|
199
|
2136 |
|
|
2137 |
grp do:[:i|
|
213
|
2138 |
idx := idx + i + 1.
|
|
2139 |
aParent add:(self nodeLabel:nil) beforeIndex:idx.
|
199
|
2140 |
]
|
|
2141 |
]
|
|
2142 |
]
|
|
2143 |
! !
|
|
2144 |
|
|
2145 |
!MenuEditor::Painter methodsFor:'conversion'!
|
|
2146 |
|
|
2147 |
asMenu
|
|
2148 |
|menu root|
|
|
2149 |
|
|
2150 |
root := self root.
|
|
2151 |
|
|
2152 |
root hasChildren ifTrue:[
|
|
2153 |
menu := Menu new.
|
|
2154 |
root children do:[:aChild| menu addItem:(self asMenuItem:aChild)].
|
|
2155 |
].
|
|
2156 |
^ menu
|
|
2157 |
!
|
|
2158 |
|
|
2159 |
asMenuItem:aNode
|
|
2160 |
|
|
2161 |
|menu item|
|
|
2162 |
|
|
2163 |
item := aNode contents asMenuItem.
|
|
2164 |
|
|
2165 |
aNode hasChildren ifTrue:[
|
|
2166 |
menu := Menu new.
|
|
2167 |
aNode children do:[:aChild| menu addItem:(self asMenuItem:aChild)].
|
|
2168 |
item submenu:menu
|
|
2169 |
].
|
|
2170 |
^ item
|
|
2171 |
|
|
2172 |
! !
|
|
2173 |
|
|
2174 |
!MenuEditor::Painter methodsFor:'drawing basics'!
|
|
2175 |
|
|
2176 |
drawLabelIndex:anIndex atX:x y:yCenter
|
|
2177 |
"draw text label assigned to a node at x y( center)
|
|
2178 |
"
|
218
|
2179 |
|y type item|
|
199
|
2180 |
|
|
2181 |
item := (listOfNodes at:anIndex) contents.
|
218
|
2182 |
type := item separatorType.
|
199
|
2183 |
|
218
|
2184 |
type isNil ifTrue:[
|
|
2185 |
super drawLabelIndex:anIndex atX:x y:yCenter
|
|
2186 |
] ifFalse:[
|
|
2187 |
type == #blank ifFalse:[
|
|
2188 |
self displayLineFromX:x y:yCenter toX:(x + 80) y:yCenter.
|
|
2189 |
|
|
2190 |
type == #double ifTrue:[
|
|
2191 |
self displayLineFromX:x y:(yCenter + 2) toX:(x + 80) y:(yCenter + 2).
|
|
2192 |
]
|
|
2193 |
]
|
|
2194 |
]
|
|
2195 |
!
|
|
2196 |
|
|
2197 |
figureFor:aNode
|
|
2198 |
"access figure for a node
|
|
2199 |
"
|
220
|
2200 |
|item|
|
|
2201 |
|
|
2202 |
aNode hasChildren ifFalse:[
|
|
2203 |
item := aNode contents.
|
|
2204 |
|
|
2205 |
item submenuChannel notNil ifTrue:[
|
|
2206 |
imageMenuLink isNil ifTrue:[
|
|
2207 |
imageMenuLink := (self class imageMenuLink) onDevice:device.
|
|
2208 |
].
|
|
2209 |
^ imageMenuLink
|
|
2210 |
].
|
|
2211 |
|
|
2212 |
item isSeparator ifTrue:[
|
|
2213 |
imageSeparator isNil ifTrue:[
|
|
2214 |
imageSeparator := (self class imageSeparator) onDevice:device.
|
|
2215 |
].
|
|
2216 |
^ imageSeparator
|
|
2217 |
]
|
199
|
2218 |
].
|
220
|
2219 |
^ super figureFor:aNode
|
199
|
2220 |
! !
|
|
2221 |
|
|
2222 |
!MenuEditor::Painter methodsFor:'initialization'!
|
|
2223 |
|
|
2224 |
initialize
|
|
2225 |
super initialize.
|
213
|
2226 |
self multipleSelectOk:true.
|
|
2227 |
self model:(SelectionInTree new).
|
199
|
2228 |
! !
|
|
2229 |
|
|
2230 |
!MenuEditor::Painter methodsFor:'menus'!
|
|
2231 |
|
|
2232 |
doCopy
|
213
|
2233 |
self hasSelection ifTrue:[
|
|
2234 |
CopyBuffer := OrderedCollection new.
|
|
2235 |
self selectionDo:[:i| CopyBuffer add:((listOfNodes at:i) copy)]
|
|
2236 |
]
|
199
|
2237 |
!
|
|
2238 |
|
|
2239 |
doCreateItem
|
213
|
2240 |
self addElement:(self nodeLabel:'undefined')
|
199
|
2241 |
!
|
|
2242 |
|
218
|
2243 |
doCreateLink
|
|
2244 |
|node item|
|
|
2245 |
|
|
2246 |
node := self nodeLabel:'undefined'.
|
|
2247 |
item := node contents.
|
|
2248 |
item submenuChannel:#menuDefaultLink.
|
|
2249 |
self addElement:node
|
|
2250 |
|
|
2251 |
|
|
2252 |
|
|
2253 |
!
|
|
2254 |
|
199
|
2255 |
doCreateMenu
|
|
2256 |
|node|
|
|
2257 |
|
213
|
2258 |
node := self nodeLabel:'undefined'.
|
|
2259 |
node add:(self nodeLabel:'undefined').
|
|
2260 |
self addElement:node
|
199
|
2261 |
|
|
2262 |
!
|
|
2263 |
|
|
2264 |
doCreateSep
|
213
|
2265 |
self addElement:(self nodeLabel:nil)
|
199
|
2266 |
|
|
2267 |
!
|
|
2268 |
|
|
2269 |
doCut
|
|
2270 |
self doCopy.
|
213
|
2271 |
model removeSelection.
|
199
|
2272 |
self selection:nil.
|
|
2273 |
|
|
2274 |
|
|
2275 |
!
|
|
2276 |
|
|
2277 |
doPaste
|
213
|
2278 |
|
|
2279 |
(CopyBuffer notNil and:[self selectedNode notNil]) ifTrue:[
|
|
2280 |
self addElement:(CopyBuffer collect:[:el| el copy])
|
220
|
2281 |
].
|
199
|
2282 |
!
|
|
2283 |
|
218
|
2284 |
doStepIn
|
|
2285 |
|idx node cprt nprt|
|
|
2286 |
|
|
2287 |
( (node := self selectedNode) isNil
|
|
2288 |
or:[(cprt := node parent) isNil]
|
|
2289 |
) ifTrue:[
|
|
2290 |
^ self
|
|
2291 |
].
|
|
2292 |
|
|
2293 |
idx := cprt indexOfChild:node.
|
|
2294 |
|
|
2295 |
idx == cprt children size ifTrue:[
|
|
2296 |
^ self
|
|
2297 |
].
|
|
2298 |
nprt := cprt childAt:(idx + 1).
|
|
2299 |
|
|
2300 |
(nprt notNil and:[nprt hasChildren]) ifFalse:[
|
|
2301 |
^ self
|
|
2302 |
].
|
|
2303 |
|
|
2304 |
model removeDependent:self.
|
|
2305 |
model removeSelection.
|
|
2306 |
selection := nil.
|
|
2307 |
model expand:nprt.
|
|
2308 |
model addDependent:self.
|
|
2309 |
|
|
2310 |
model add:node beforeIndex:1 below:nprt.
|
|
2311 |
self selectNode:node.
|
|
2312 |
!
|
|
2313 |
|
|
2314 |
doStepOut
|
|
2315 |
|node cprt nprt|
|
|
2316 |
|
|
2317 |
( (node := self selectedNode) isNil
|
|
2318 |
or:[(cprt := node parent) isNil
|
|
2319 |
or:[(nprt := cprt parent) isNil]]
|
|
2320 |
) ifFalse:[
|
|
2321 |
model removeDependent:self.
|
|
2322 |
model removeSelection.
|
|
2323 |
selection := nil.
|
|
2324 |
model addDependent:self.
|
|
2325 |
|
|
2326 |
model add:node afterIndex:(nprt indexOfChild:cprt) below:nprt.
|
|
2327 |
self selectNode:node.
|
|
2328 |
]
|
|
2329 |
!
|
|
2330 |
|
|
2331 |
doStepOver:anOffset
|
|
2332 |
"move child 'anOffset' forward or backward in list of children
|
|
2333 |
"
|
|
2334 |
|idx node size parent|
|
|
2335 |
|
|
2336 |
( (node := self selectedNode) notNil
|
|
2337 |
and:[(parent := node parent) notNil
|
|
2338 |
and:[(size := parent children size) > 1]]
|
|
2339 |
) ifTrue:[
|
|
2340 |
idx := parent indexOfChild:node.
|
|
2341 |
|
|
2342 |
model removeDependent:self.
|
|
2343 |
model removeSelection.
|
|
2344 |
selection := nil.
|
|
2345 |
model addDependent:self.
|
|
2346 |
|
|
2347 |
(idx := idx + anOffset) < 1 ifTrue:[
|
|
2348 |
idx := size
|
|
2349 |
] ifFalse:[
|
|
2350 |
idx > size ifTrue:[idx := 1]
|
|
2351 |
].
|
|
2352 |
model add:node beforeIndex:idx below:parent.
|
|
2353 |
self selectNode:node.
|
|
2354 |
]
|
199
|
2355 |
! !
|
|
2356 |
|
|
2357 |
!MenuEditor::Painter methodsFor:'private'!
|
|
2358 |
|
213
|
2359 |
addElement:something
|
|
2360 |
"add something after selection
|
|
2361 |
"
|
|
2362 |
|node parent index|
|
199
|
2363 |
|
213
|
2364 |
(node := self selectedNode) notNil ifTrue:[
|
|
2365 |
node parent notNil ifTrue:[
|
|
2366 |
node isCollapsable ifTrue:[
|
|
2367 |
model add:something beforeIndex:1 below:node
|
|
2368 |
] ifFalse:[
|
|
2369 |
model add:something after:node
|
|
2370 |
]
|
|
2371 |
] ifFalse:[
|
|
2372 |
model add:something beforeIndex:1 below:(self root)
|
|
2373 |
]
|
199
|
2374 |
]
|
|
2375 |
!
|
|
2376 |
|
213
|
2377 |
nodeLabel:aLabel
|
|
2378 |
^ TreeItem name:aLabel contents:(MenuEditor::Item new label:aLabel).
|
199
|
2379 |
! !
|
|
2380 |
|
|
2381 |
!MenuEditor::Painter methodsFor:'selection'!
|
|
2382 |
|
218
|
2383 |
selectNode:aNode
|
|
2384 |
"change selection to a node
|
|
2385 |
"
|
|
2386 |
self selection:(listOfNodes findFirst:[:el| el == aNode])
|
|
2387 |
!
|
|
2388 |
|
199
|
2389 |
selectedNodeChanged
|
213
|
2390 |
|node name index|
|
199
|
2391 |
|
213
|
2392 |
(index := self selectedIndex) ~~ 0 ifTrue:[
|
|
2393 |
node := listOfNodes at:index.
|
|
2394 |
name := node contents label.
|
|
2395 |
list at:index put:name.
|
|
2396 |
node name:name.
|
|
2397 |
self redrawLine:index.
|
|
2398 |
]
|
199
|
2399 |
! !
|
|
2400 |
|
|
2401 |
!MenuEditor class methodsFor:'documentation'!
|
|
2402 |
|
|
2403 |
version
|
|
2404 |
^ '$Header$'
|
|
2405 |
! !
|