author | Claus Gittinger <cg@exept.de> |
Sat, 07 Feb 1998 23:27:57 +0100 | |
changeset 629 | f489f2d121bf |
parent 627 | e28ca0319230 |
child 633 | 11bbf4599843 |
permissions | -rw-r--r-- |
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 |
||
398 | 15 |
ToolApplicationModel subclass:#MenuEditor |
356 | 16 |
instanceVariableNames:'isModified specClass specCanvas helpCanvas tabSelection aspects |
17 |
slices didInstall' |
|
220 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-UIPainter' |
|
199 | 21 |
! |
22 |
||
23 |
Object subclass:#Item |
|
220 | 24 |
instanceVariableNames:'activeHelpKey enabled label value nameKey indication shortcutKey |
407 | 25 |
accessCharacterPos retriever icon iconAndLabel submenuChannel |
539 | 26 |
startGroup argument translateLabel isButton isVisible' |
220 | 27 |
classVariableNames:'' |
28 |
poolDictionaries:'' |
|
29 |
privateIn:MenuEditor |
|
199 | 30 |
! |
31 |
||
407 | 32 |
SelectionInTreeView subclass:#TreeView |
275 | 33 |
instanceVariableNames:'images' |
34 |
classVariableNames:'CopyBuffer Images' |
|
220 | 35 |
poolDictionaries:'' |
36 |
privateIn:MenuEditor |
|
199 | 37 |
! |
38 |
||
39 |
!MenuEditor class methodsFor:'documentation'! |
|
40 |
||
41 |
copyright |
|
42 |
" |
|
43 |
COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger |
|
44 |
All Rights Reserved |
|
45 |
||
46 |
This software is furnished under a license and may be used |
|
47 |
only in accordance with the terms of that license and with the |
|
48 |
inclusion of the above copyright notice. This software may not |
|
49 |
be provided or otherwise made available to, or used by, any |
|
50 |
other person. No title to or ownership of the software is |
|
51 |
hereby transferred. |
|
52 |
" |
|
53 |
||
54 |
||
55 |
! |
|
56 |
||
57 |
documentation |
|
58 |
" |
|
59 |
create and modify or inspect popup and pullDown menus of the |
|
60 |
new style( derives from Menu). |
|
61 |
||
62 |
[start with:] |
|
63 |
MenuEditor open |
|
64 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuPullDown |
|
65 |
||
66 |
[see also:] |
|
67 |
UIPainter |
|
68 |
UIHelpTool |
|
69 |
UISpecificationTool |
|
70 |
SelectionInTreeView |
|
71 |
||
72 |
[author:] |
|
541 | 73 |
Claus Atzkern, eXept Software AG |
74 |
Thomas Zwick, eXept Software AG |
|
199 | 75 |
" |
76 |
||
77 |
! ! |
|
78 |
||
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
79 |
!MenuEditor class methodsFor:'initialization'! |
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
80 |
|
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
81 |
initialize |
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
82 |
|
432
d35dccaa804c
commit buttons replaced by subSpec in ToolApplicationModel
tz
parents:
422
diff
changeset
|
83 |
super initialize. |
d35dccaa804c
commit buttons replaced by subSpec in ToolApplicationModel
tz
parents:
422
diff
changeset
|
84 |
|
407 | 85 |
TreeView initialize |
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
86 |
! ! |
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
87 |
|
508 | 88 |
!MenuEditor class methodsFor:'instance creation'! |
89 |
||
90 |
openModalOnClass:aClass andSelector:aSelector |
|
91 |
^ self new openModalOnClass:aClass andSelector:aSelector |
|
92 |
||
93 |
||
94 |
! |
|
95 |
||
96 |
openOnClass:aClass andSelector:aSelector |
|
97 |
^ self new openOnClass:aClass andSelector:aSelector |
|
98 |
||
99 |
||
100 |
! ! |
|
101 |
||
318 | 102 |
!MenuEditor class methodsFor:'code generation'! |
103 |
||
104 |
sourceCategory |
|
432
d35dccaa804c
commit buttons replaced by subSpec in ToolApplicationModel
tz
parents:
422
diff
changeset
|
105 |
"returns the category where to install the menu |
318 | 106 |
" |
107 |
^ 'accessing menu' |
|
108 |
! ! |
|
109 |
||
371 | 110 |
!MenuEditor class methodsFor:'help specs'! |
111 |
||
112 |
helpSpec |
|
113 |
"return a dictionary filled with helpKey -> helptext associations. |
|
114 |
These are used by the activeHelp tool." |
|
115 |
||
116 |
" |
|
117 |
UIHelpTool openOnClass:MenuEditor |
|
118 |
" |
|
119 |
||
120 |
^ super helpSpec addPairsFrom:#( |
|
121 |
||
548 | 122 |
#addMenuItem |
123 |
'Adds a new menu item.' |
|
124 |
||
125 |
#addMenuSeparator |
|
126 |
'Adds a new menu separator.' |
|
127 |
||
128 |
#addSubMenu |
|
613 | 129 |
'Adds a new sub menu.' |
548 | 130 |
|
131 |
#addSubMenuLink |
|
613 | 132 |
'Adds a new linked sub menu.' |
371 | 133 |
|
577 | 134 |
#basicsAction |
627 | 135 |
'An action selector with 0, 1 (the argument field), or 2 (the selected item) arguments.' |
577 | 136 |
|
137 |
#basicsArgument |
|
613 | 138 |
'An argument passed to above selector, if it is a 1 or a 2 argument selector.' |
577 | 139 |
|
140 |
#basicsIndication |
|
141 |
'A boolean value holder, a boolean evaluating block, or a boolean returning selector for specifying indication state.' |
|
142 |
||
143 |
#basicsIsButton |
|
603 | 144 |
'Turns on/off a button behavior.' |
577 | 145 |
|
146 |
#basicsLabel |
|
147 |
'Label of the item.' |
|
148 |
||
149 |
#basicsMenu |
|
613 | 150 |
'A value holder providing the sub menu to be opened if item is selected.' |
577 | 151 |
|
152 |
#basicsMenuArgument |
|
153 |
'An argument passes with menu selector.' |
|
154 |
||
155 |
#basicsNameKey |
|
156 |
'Unique identifier of the item (optional).' |
|
157 |
||
158 |
#basicsSelector |
|
613 | 159 |
'Selector under which the generated menu spec is saved.' |
577 | 160 |
|
161 |
#basicsSeparatorType |
|
162 |
'List of valid separators.' |
|
163 |
||
164 |
#basicsTranslateLabel |
|
603 | 165 |
'Turns on/off translation behavior of the label via class resource file.' |
577 | 166 |
|
167 |
#detailsAccelerator |
|
168 |
'Key to be pressed to select the menu item from the keyboard (accelerator key).' |
|
169 |
||
170 |
#detailsAccessCharaterPosition |
|
171 |
'Index of the access character position of the textual label (optional).' |
|
172 |
||
173 |
#detailsEnabled |
|
613 | 174 |
'A boolean value holder providing en- or disabling of the menu item.' |
577 | 175 |
|
176 |
#detailsVisibility |
|
177 |
'A boolean value holder providing visibility of the menu item.' |
|
178 |
||
548 | 179 |
#fileLoad |
612 | 180 |
'Opens a dialog for selecting and loading a menu spec from a class.' |
548 | 181 |
|
182 |
#fileNew |
|
183 |
'Creates a new menu spec.' |
|
184 |
||
577 | 185 |
#filePickAMenu |
186 |
'Changes the cursor for moving it over another menu view to load its menu spec.' |
|
187 |
||
548 | 188 |
#fileSave |
189 |
'Saves current menu spec and if modified the help spec.' |
|
455 | 190 |
|
577 | 191 |
#imageImageAndLabel |
603 | 192 |
'Turns on/off displaying both image and textual label.' |
577 | 193 |
|
194 |
#imageImageEditor |
|
195 |
'Opens an Image Editor on retriever and selector.' |
|
196 |
||
197 |
#imageRetriever |
|
198 |
'Class implementing the image resource method. If no class is given, the current application class will be taken.' |
|
199 |
||
200 |
#imageSelector |
|
613 | 201 |
'Selector returning an image.' |
371 | 202 |
|
203 |
) |
|
612 | 204 |
|
371 | 205 |
! ! |
206 |
||
199 | 207 |
!MenuEditor class methodsFor:'interface specs'! |
208 |
||
209 |
basicsItemSpec |
|
210 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
211 |
||
212 |
"do not manually edit this - the painter/builder may not be able to |
|
213 |
handle the specification if its corrupted." |
|
214 |
||
215 |
" |
|
216 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsItemSpec |
|
217 |
MenuEditor new openInterface:#basicsItemSpec |
|
218 |
" |
|
219 |
||
220 |
<resource: #canvas> |
|
221 |
||
222 |
^ |
|
223 |
||
224 |
#(#FullSpec |
|
225 |
#'window:' |
|
226 |
#(#WindowSpec |
|
290 | 227 |
#'name:' 'unnamed canvas' |
577 | 228 |
#'layout:' #(#LayoutFrame 73 0 152 0 339 0 470 0) |
199 | 229 |
#'label:' 'unnamed canvas' |
290 | 230 |
#'min:' #(#Point 10 10) |
231 |
#'max:' #(#Point 1160 870) |
|
577 | 232 |
#'bounds:' #(#Rectangle 73 152 340 471) |
371 | 233 |
#'usePreferredExtent:' false |
199 | 234 |
) |
235 |
#'component:' |
|
236 |
#(#SpecCollection |
|
237 |
#'collection:' |
|
238 |
#( |
|
239 |
#(#LabelSpec |
|
240 |
#'name:' 'nameKeyLabel' |
|
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
241 |
#'layout:' #(#AlignmentOrigin 107 0 26 0 1 0.5) |
577 | 242 |
#'label:' 'Name Key:' |
263 | 243 |
#'adjust:' #right |
199 | 244 |
#'resizeForLabel:' true |
245 |
) |
|
246 |
#(#InputFieldSpec |
|
371 | 247 |
#'name:' 'nameKeyField' |
411 | 248 |
#'layout:' #(#LayoutFrame 110 0 15 0 -5 1.0 37 0) |
577 | 249 |
#'activeHelpKey:' #basicsNameKey |
199 | 250 |
#'tabable:' true |
251 |
#'model:' #nameKey |
|
252 |
#'type:' #symbolOrNil |
|
407 | 253 |
#'acceptOnReturn:' false |
254 |
#'acceptOnTab:' false |
|
199 | 255 |
) |
256 |
#(#LabelSpec |
|
257 |
#'name:' 'labelLabel' |
|
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
258 |
#'layout:' #(#AlignmentOrigin 107 0 51 0 1 0.5) |
398 | 259 |
#'label:' 'Label:' |
263 | 260 |
#'adjust:' #right |
199 | 261 |
#'resizeForLabel:' true |
262 |
) |
|
263 |
#(#InputFieldSpec |
|
371 | 264 |
#'name:' 'labelField' |
411 | 265 |
#'layout:' #(#LayoutFrame 110 0 40 0 -5 1.0 62 0) |
577 | 266 |
#'activeHelpKey:' #basicsLabel |
199 | 267 |
#'tabable:' true |
268 |
#'model:' #label |
|
407 | 269 |
#'acceptOnReturn:' false |
270 |
#'acceptOnTab:' false |
|
199 | 271 |
) |
272 |
#(#LabelSpec |
|
273 |
#'name:' 'valueLabel' |
|
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
274 |
#'layout:' #(#AlignmentOrigin 107 0 90 0 1 0.5) |
577 | 275 |
#'label:' 'Action:' |
263 | 276 |
#'adjust:' #right |
199 | 277 |
#'resizeForLabel:' true |
278 |
) |
|
279 |
#(#InputFieldSpec |
|
371 | 280 |
#'name:' 'valueField' |
411 | 281 |
#'layout:' #(#LayoutFrame 110 0 79 0 -5 1.0 101 0) |
577 | 282 |
#'activeHelpKey:' #basicsAction |
199 | 283 |
#'tabable:' true |
284 |
#'model:' #value |
|
285 |
#'type:' #symbolOrNil |
|
407 | 286 |
#'acceptOnReturn:' false |
287 |
#'acceptOnTab:' false |
|
199 | 288 |
) |
289 |
#(#LabelSpec |
|
290 | 290 |
#'name:' 'argumentLabel' |
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
291 |
#'layout:' #(#AlignmentOrigin 107 0 115 0 1 0.5) |
290 | 292 |
#'label:' 'Argument:' |
293 |
#'adjust:' #right |
|
294 |
#'resizeForLabel:' true |
|
295 |
) |
|
296 |
#(#InputFieldSpec |
|
371 | 297 |
#'name:' 'argumentField' |
411 | 298 |
#'layout:' #(#LayoutFrame 110 0 104 0 -5 1.0 126 0) |
577 | 299 |
#'activeHelpKey:' #basicsArgument |
290 | 300 |
#'tabable:' true |
301 |
#'model:' #argument |
|
302 |
#'type:' #string |
|
407 | 303 |
#'acceptOnReturn:' false |
304 |
#'acceptOnTab:' false |
|
290 | 305 |
) |
371 | 306 |
#(#LabelSpec |
307 |
#'name:' 'indicationLabel' |
|
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
308 |
#'layout:' #(#AlignmentOrigin 107 0 155 0 1 0.5) |
371 | 309 |
#'label:' 'Indication:' |
310 |
#'adjust:' #right |
|
311 |
#'resizeForLabel:' true |
|
312 |
) |
|
313 |
#(#InputFieldSpec |
|
314 |
#'name:' 'indicationField' |
|
411 | 315 |
#'layout:' #(#LayoutFrame 110 0 144 0 -5 1.0 166 0) |
577 | 316 |
#'activeHelpKey:' #basicsIndication |
371 | 317 |
#'tabable:' true |
318 |
#'model:' #indication |
|
319 |
#'type:' #symbolOrNil |
|
407 | 320 |
#'acceptOnReturn:' false |
321 |
#'acceptOnTab:' false |
|
371 | 322 |
) |
398 | 323 |
#(#CheckBoxSpec |
324 |
#'name:' 'translateLabelCheckBox' |
|
325 |
#'layout:' #(#Point 20 192) |
|
577 | 326 |
#'activeHelpKey:' #basicsTranslateLabel |
469 | 327 |
#'tabable:' true |
398 | 328 |
#'model:' #translateLabel |
329 |
#'label:' 'Translate Label' |
|
330 |
) |
|
331 |
#(#CheckBoxSpec |
|
332 |
#'name:' 'isButtonCheckBox' |
|
333 |
#'layout:' #(#Point 20 221) |
|
577 | 334 |
#'activeHelpKey:' #basicsIsButton |
469 | 335 |
#'tabable:' true |
398 | 336 |
#'model:' #isButton |
337 |
#'label:' 'Is Button' |
|
338 |
) |
|
199 | 339 |
) |
340 |
) |
|
341 |
) |
|
342 |
! |
|
343 |
||
218 | 344 |
basicsLinkSpec |
345 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
346 |
||
347 |
"do not manually edit this - the painter/builder may not be able to |
|
348 |
handle the specification if its corrupted." |
|
349 |
||
350 |
" |
|
351 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsLinkSpec |
|
352 |
MenuEditor new openInterface:#basicsLinkSpec |
|
353 |
" |
|
354 |
||
355 |
<resource: #canvas> |
|
356 |
||
357 |
^ |
|
358 |
||
359 |
#(#FullSpec |
|
360 |
#'window:' |
|
361 |
#(#WindowSpec |
|
371 | 362 |
#'name:' 'unnamed canvas' |
577 | 363 |
#'layout:' #(#LayoutFrame 73 0 152 0 339 0 470 0) |
218 | 364 |
#'label:' 'unnamed canvas' |
371 | 365 |
#'min:' #(#Point 10 10) |
366 |
#'max:' #(#Point 1280 1024) |
|
577 | 367 |
#'bounds:' #(#Rectangle 73 152 340 471) |
371 | 368 |
#'usePreferredExtent:' false |
218 | 369 |
) |
370 |
#'component:' |
|
371 |
#(#SpecCollection |
|
372 |
#'collection:' |
|
373 |
#( |
|
374 |
#(#LabelSpec |
|
375 |
#'name:' 'nameKeyLabel' |
|
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
376 |
#'layout:' #(#AlignmentOrigin 107 0 26 0 1 0.5) |
371 | 377 |
#'activeHelpKey:' #nameKey |
577 | 378 |
#'label:' 'Name Key:' |
263 | 379 |
#'adjust:' #right |
218 | 380 |
#'resizeForLabel:' true |
381 |
) |
|
382 |
#(#InputFieldSpec |
|
371 | 383 |
#'name:' 'nameKeyField' |
411 | 384 |
#'layout:' #(#LayoutFrame 110 0 15 0 -5 1.0 37 0) |
577 | 385 |
#'activeHelpKey:' #basicsNameKey |
218 | 386 |
#'tabable:' true |
387 |
#'model:' #nameKey |
|
388 |
#'type:' #symbolOrNil |
|
407 | 389 |
#'acceptOnReturn:' false |
390 |
#'acceptOnTab:' false |
|
218 | 391 |
) |
392 |
#(#LabelSpec |
|
393 |
#'name:' 'labelLabel' |
|
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
394 |
#'layout:' #(#AlignmentOrigin 107 0 51 0 1 0.5) |
398 | 395 |
#'label:' 'Label:' |
218 | 396 |
#'resizeForLabel:' true |
397 |
) |
|
398 |
#(#InputFieldSpec |
|
371 | 399 |
#'name:' 'labelField' |
411 | 400 |
#'layout:' #(#LayoutFrame 110 0 40 0 -5 1.0 62 0) |
577 | 401 |
#'activeHelpKey:' #basicsLabel |
218 | 402 |
#'tabable:' true |
403 |
#'model:' #label |
|
407 | 404 |
#'acceptOnReturn:' false |
405 |
#'acceptOnTab:' false |
|
218 | 406 |
) |
469 | 407 |
#(#LabelSpec |
408 |
#'name:' 'menuLabel' |
|
409 |
#'layout:' #(#AlignmentOrigin 107 0 76 0 1 0.5) |
|
410 |
#'label:' 'Menu:' |
|
411 |
#'resizeForLabel:' true |
|
412 |
) |
|
218 | 413 |
#(#InputFieldSpec |
371 | 414 |
#'name:' 'menuField' |
411 | 415 |
#'layout:' #(#LayoutFrame 110 0 65 0 -5 1.0 87 0) |
577 | 416 |
#'activeHelpKey:' #basicsMenu |
218 | 417 |
#'tabable:' true |
418 |
#'model:' #submenuChannel |
|
419 |
#'type:' #symbolOrNil |
|
407 | 420 |
#'acceptOnReturn:' false |
421 |
#'acceptOnTab:' false |
|
218 | 422 |
) |
423 |
#(#LabelSpec |
|
469 | 424 |
#'name:' 'ArgumentLabel' |
425 |
#'layout:' #(#AlignmentOrigin 107 0 100 0 1 0.5) |
|
426 |
#'label:' 'Argument:' |
|
218 | 427 |
#'resizeForLabel:' true |
428 |
) |
|
411 | 429 |
#(#InputFieldSpec |
430 |
#'name:' 'argumentField' |
|
431 |
#'layout:' #(#LayoutFrame 110 0 90 0 -5 1.0 112 0) |
|
577 | 432 |
#'activeHelpKey:' #basicsMenuArgument |
411 | 433 |
#'tabable:' true |
537 | 434 |
#'model:' #argument |
411 | 435 |
#'acceptOnReturn:' false |
436 |
#'acceptOnTab:' false |
|
437 |
) |
|
469 | 438 |
#(#CheckBoxSpec |
439 |
#'name:' 'translateLabelCheckBox' |
|
440 |
#'layout:' #(#Point 20 128) |
|
577 | 441 |
#'activeHelpKey:' #basicsTranslateLabel |
469 | 442 |
#'tabable:' true |
443 |
#'model:' #translateLabel |
|
444 |
#'label:' 'Translate Label' |
|
411 | 445 |
) |
218 | 446 |
) |
447 |
) |
|
448 |
) |
|
449 |
! |
|
450 |
||
199 | 451 |
basicsMenuSpec |
452 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
453 |
||
454 |
"do not manually edit this - the painter/builder may not be able to |
|
455 |
handle the specification if its corrupted." |
|
456 |
||
457 |
" |
|
458 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsMenuSpec |
|
459 |
MenuEditor new openInterface:#basicsMenuSpec |
|
460 |
" |
|
461 |
||
462 |
<resource: #canvas> |
|
463 |
||
464 |
^ |
|
465 |
||
466 |
#(#FullSpec |
|
467 |
#'window:' |
|
468 |
#(#WindowSpec |
|
371 | 469 |
#'name:' 'unnamed canvas' |
577 | 470 |
#'layout:' #(#LayoutFrame 73 0 152 0 339 0 470 0) |
199 | 471 |
#'label:' 'unnamed canvas' |
371 | 472 |
#'min:' #(#Point 10 10) |
473 |
#'max:' #(#Point 1280 1024) |
|
577 | 474 |
#'bounds:' #(#Rectangle 73 152 340 471) |
371 | 475 |
#'usePreferredExtent:' false |
199 | 476 |
) |
477 |
#'component:' |
|
478 |
#(#SpecCollection |
|
479 |
#'collection:' |
|
480 |
#( |
|
481 |
#(#LabelSpec |
|
482 |
#'name:' 'nameKeyLabel' |
|
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
483 |
#'layout:' #(#AlignmentOrigin 107 0 26 0 1 0.5) |
577 | 484 |
#'label:' 'Name Key:' |
263 | 485 |
#'adjust:' #right |
199 | 486 |
#'resizeForLabel:' true |
487 |
) |
|
488 |
#(#InputFieldSpec |
|
371 | 489 |
#'name:' 'nameKeyField' |
411 | 490 |
#'layout:' #(#LayoutFrame 110 0 15 0 -5 1.0 37 0) |
577 | 491 |
#'activeHelpKey:' #basicsNameKey |
199 | 492 |
#'tabable:' true |
493 |
#'model:' #nameKey |
|
494 |
#'type:' #symbolOrNil |
|
407 | 495 |
#'acceptOnReturn:' false |
496 |
#'acceptOnTab:' false |
|
199 | 497 |
) |
498 |
#(#LabelSpec |
|
499 |
#'name:' 'labelLabel' |
|
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
500 |
#'layout:' #(#AlignmentOrigin 107 0 51 0 1 0.5) |
398 | 501 |
#'label:' 'Label:' |
263 | 502 |
#'adjust:' #right |
199 | 503 |
#'resizeForLabel:' true |
504 |
) |
|
505 |
#(#InputFieldSpec |
|
371 | 506 |
#'name:' 'labelField' |
411 | 507 |
#'layout:' #(#LayoutFrame 110 0 40 0 -5 1.0 62 0) |
577 | 508 |
#'activeHelpKey:' #basicsLabel |
199 | 509 |
#'tabable:' true |
510 |
#'model:' #label |
|
407 | 511 |
#'acceptOnReturn:' false |
512 |
#'acceptOnTab:' false |
|
199 | 513 |
) |
398 | 514 |
#(#CheckBoxSpec |
515 |
#'name:' 'translateLabelCheckBox' |
|
516 |
#'layout:' #(#Point 20 100) |
|
577 | 517 |
#'activeHelpKey:' #basicsTranslateLabel |
469 | 518 |
#'tabable:' true |
398 | 519 |
#'model:' #translateLabel |
520 |
#'label:' 'Translate Label' |
|
521 |
) |
|
199 | 522 |
) |
523 |
) |
|
524 |
) |
|
525 |
! |
|
526 |
||
527 |
basicsRootSpec |
|
528 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
529 |
||
530 |
"do not manually edit this - the painter/builder may not be able to |
|
531 |
handle the specification if its corrupted." |
|
532 |
||
533 |
" |
|
534 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsRootSpec |
|
535 |
MenuEditor new openInterface:#basicsRootSpec |
|
536 |
" |
|
537 |
||
538 |
<resource: #canvas> |
|
539 |
||
540 |
^ |
|
541 |
||
542 |
#(#FullSpec |
|
543 |
#'window:' |
|
544 |
#(#WindowSpec |
|
371 | 545 |
#'name:' 'unnamed canvas' |
577 | 546 |
#'layout:' #(#LayoutFrame 73 0 152 0 339 0 470 0) |
199 | 547 |
#'label:' 'unnamed canvas' |
371 | 548 |
#'min:' #(#Point 10 10) |
549 |
#'max:' #(#Point 1280 1024) |
|
577 | 550 |
#'bounds:' #(#Rectangle 73 152 340 471) |
371 | 551 |
#'usePreferredExtent:' false |
199 | 552 |
) |
553 |
#'component:' |
|
554 |
#(#SpecCollection |
|
555 |
#'collection:' |
|
556 |
#( |
|
557 |
#(#LabelSpec |
|
558 |
#'name:' 'selectorLabel' |
|
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
559 |
#'layout:' #(#AlignmentOrigin 107 0 26 0 1 0.5) |
199 | 560 |
#'label:' 'Selector:' |
263 | 561 |
#'adjust:' #right |
199 | 562 |
#'resizeForLabel:' true |
563 |
) |
|
564 |
#(#InputFieldSpec |
|
371 | 565 |
#'name:' 'selectorField' |
411 | 566 |
#'layout:' #(#LayoutFrame 110 0 15 0 -5 1.0 37 0) |
577 | 567 |
#'activeHelpKey:' #basicsSelector |
199 | 568 |
#'tabable:' true |
569 |
#'model:' #label |
|
407 | 570 |
#'acceptOnReturn:' false |
571 |
#'acceptOnTab:' false |
|
199 | 572 |
) |
573 |
) |
|
574 |
) |
|
575 |
) |
|
576 |
! |
|
577 |
||
218 | 578 |
basicsSeparatorSpec |
199 | 579 |
"this window spec was automatically generated by the ST/X UIPainter" |
580 |
||
581 |
"do not manually edit this - the painter/builder may not be able to |
|
582 |
handle the specification if its corrupted." |
|
583 |
||
584 |
" |
|
218 | 585 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsSeparatorSpec |
586 |
MenuEditor new openInterface:#basicsSeparatorSpec |
|
199 | 587 |
" |
588 |
||
589 |
<resource: #canvas> |
|
590 |
||
591 |
^ |
|
592 |
||
593 |
#(#FullSpec |
|
594 |
#'window:' |
|
595 |
#(#WindowSpec |
|
290 | 596 |
#'name:' 'unnamed canvas' |
606 | 597 |
#'layout:' #(#LayoutFrame 219 0 193 0 485 0 511 0) |
199 | 598 |
#'label:' 'unnamed canvas' |
290 | 599 |
#'min:' #(#Point 10 10) |
600 |
#'max:' #(#Point 1160 870) |
|
606 | 601 |
#'bounds:' #(#Rectangle 219 193 486 512) |
371 | 602 |
#'usePreferredExtent:' false |
199 | 603 |
) |
604 |
#'component:' |
|
605 |
#(#SpecCollection |
|
606 |
#'collection:' |
|
607 |
#( |
|
218 | 608 |
#(#LabelSpec |
609 |
#'name:' 'separatorLabel' |
|
398 | 610 |
#'layout:' #(#AlignmentOrigin 127 0 26 0 1 0.5) |
218 | 611 |
#'label:' 'Separator Type:' |
263 | 612 |
#'adjust:' #right |
218 | 613 |
#'resizeForLabel:' true |
614 |
) |
|
615 |
#(#ComboListSpec |
|
290 | 616 |
#'name:' 'seperatorList' |
411 | 617 |
#'layout:' #(#LayoutFrame 132 0 15 0 -5 1.0 37 0) |
577 | 618 |
#'activeHelpKey:' #basicsSeparatorType |
469 | 619 |
#'tabable:' true |
218 | 620 |
#'model:' #seperatorSelection |
290 | 621 |
#'useIndex:' true |
199 | 622 |
) |
606 | 623 |
#(#LabelSpec |
624 |
#'name:' 'visibilityLabel' |
|
625 |
#'layout:' #(#AlignmentOrigin 127 0 76 0 1 0.5) |
|
626 |
#'label:' 'Visibility:' |
|
627 |
#'adjust:' #right |
|
628 |
#'resizeForLabel:' true |
|
629 |
) |
|
630 |
#(#InputFieldSpec |
|
631 |
#'name:' 'isVisibleInputField' |
|
632 |
#'layout:' #(#LayoutFrame 132 0 65 0 -5 1.0 87 0) |
|
633 |
#'activeHelpKey:' #detailsVisibility |
|
634 |
#'tabable:' true |
|
635 |
#'model:' #isVisible |
|
636 |
#'type:' #symbolOrNil |
|
637 |
#'acceptOnReturn:' false |
|
638 |
#'acceptOnTab:' false |
|
639 |
) |
|
199 | 640 |
) |
641 |
) |
|
642 |
) |
|
643 |
! |
|
644 |
||
525 | 645 |
classDefineSpec |
646 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
647 |
||
648 |
"do not manually edit this - the painter/builder may not be able to |
|
649 |
handle the specification if its corrupted." |
|
650 |
||
651 |
" |
|
652 |
UIPainter new openOnClass:MenuEditor andSelector:#classDefineSpec |
|
653 |
MenuEditor new openInterface:#classDefineSpec |
|
654 |
" |
|
655 |
||
656 |
<resource: #canvas> |
|
657 |
||
658 |
^ |
|
659 |
||
660 |
#(#FullSpec |
|
661 |
#'window:' |
|
662 |
#(#WindowSpec |
|
663 |
#'name:' 'Menu Editor' |
|
664 |
#'layout:' #(#LayoutFrame 262 0 426 0 508 0 519 0) |
|
665 |
#'label:' 'Menu Editor' |
|
666 |
#'min:' #(#Point 10 10) |
|
667 |
#'max:' #(#Point 1152 900) |
|
668 |
#'bounds:' #(#Rectangle 262 426 509 520) |
|
669 |
#'usePreferredExtent:' false |
|
670 |
) |
|
671 |
#'component:' |
|
672 |
#(#SpecCollection |
|
673 |
#'collection:' |
|
674 |
#( |
|
675 |
#(#LabelSpec |
|
676 |
#'name:' 'boxLabel' |
|
677 |
#'layout:' #(#LayoutFrame 2 0.0 4 0 -2 1.0 24 0) |
|
678 |
#'label:' 'Class for code:' |
|
679 |
#'adjust:' #left |
|
680 |
#'resizeForLabel:' true |
|
681 |
) |
|
682 |
#(#InputFieldSpec |
|
683 |
#'name:' 'classNameField' |
|
684 |
#'layout:' #(#LayoutFrame 2 0.0 27 0 -2 1.0 49 0) |
|
685 |
#'tabable:' true |
|
686 |
#'model:' #classNameChannel |
|
687 |
#'acceptOnReturn:' false |
|
688 |
#'acceptOnTab:' false |
|
689 |
) |
|
690 |
#(#UISubSpecification |
|
691 |
#'name:' 'SubSpecification' |
|
692 |
#'layout:' #(#LayoutFrame 0 0 -29 1 0 1 -5 1) |
|
693 |
#'majorKey:' #ToolApplicationModel |
|
694 |
#'minorKey:' #windowSpecForCommitWithoutChannels |
|
695 |
) |
|
696 |
) |
|
697 |
) |
|
698 |
) |
|
699 |
! |
|
700 |
||
199 | 701 |
detailsEditSpec |
702 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
703 |
||
704 |
"do not manually edit this - the painter/builder may not be able to |
|
705 |
handle the specification if its corrupted." |
|
706 |
||
707 |
" |
|
708 |
UIPainter new openOnClass:MenuEditor andSelector:#detailsEditSpec |
|
709 |
MenuEditor new openInterface:#detailsEditSpec |
|
710 |
" |
|
711 |
||
712 |
<resource: #canvas> |
|
713 |
||
714 |
^ |
|
715 |
||
716 |
#(#FullSpec |
|
717 |
#'window:' |
|
718 |
#(#WindowSpec |
|
371 | 719 |
#'name:' 'unnamed canvas' |
577 | 720 |
#'layout:' #(#LayoutFrame 73 0 152 0 331 0 439 0) |
199 | 721 |
#'label:' 'unnamed canvas' |
371 | 722 |
#'min:' #(#Point 10 10) |
723 |
#'max:' #(#Point 1280 1024) |
|
577 | 724 |
#'bounds:' #(#Rectangle 73 152 332 440) |
371 | 725 |
#'usePreferredExtent:' false |
199 | 726 |
) |
727 |
#'component:' |
|
728 |
#(#SpecCollection |
|
729 |
#'collection:' |
|
730 |
#( |
|
731 |
#(#LabelSpec |
|
371 | 732 |
#'name:' 'shortcutKeyLabel' |
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
733 |
#'layout:' #(#AlignmentOrigin 107 0 26 0 1 0.5) |
371 | 734 |
#'label:' 'Accelerator:' |
735 |
#'adjust:' #right |
|
736 |
#'resizeForLabel:' true |
|
737 |
) |
|
738 |
#(#InputFieldSpec |
|
739 |
#'name:' 'shortcutKeyField' |
|
411 | 740 |
#'layout:' #(#LayoutFrame 110 0 15 0 -5 1.0 37 0) |
577 | 741 |
#'activeHelpKey:' #detailsAccelerator |
371 | 742 |
#'tabable:' true |
743 |
#'model:' #shortcutKey |
|
744 |
#'type:' #symbolOrNil |
|
407 | 745 |
#'acceptOnReturn:' false |
746 |
#'acceptOnTab:' false |
|
371 | 747 |
) |
748 |
#(#LabelSpec |
|
199 | 749 |
#'name:' 'enabledLabel' |
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
750 |
#'layout:' #(#AlignmentOrigin 107 0 51 0 1 0.5) |
199 | 751 |
#'label:' 'Enabled:' |
263 | 752 |
#'adjust:' #right |
199 | 753 |
#'resizeForLabel:' true |
754 |
) |
|
755 |
#(#InputFieldSpec |
|
371 | 756 |
#'name:' 'enabledField' |
411 | 757 |
#'layout:' #(#LayoutFrame 110 0 40 0 -5 1.0 62 0) |
577 | 758 |
#'activeHelpKey:' #detailsEnabled |
199 | 759 |
#'tabable:' true |
760 |
#'model:' #enabled |
|
761 |
#'type:' #symbolOrNil |
|
407 | 762 |
#'acceptOnReturn:' false |
763 |
#'acceptOnTab:' false |
|
199 | 764 |
) |
765 |
#(#LabelSpec |
|
539 | 766 |
#'name:' 'visibilityLabel' |
767 |
#'layout:' #(#AlignmentOrigin 107 0 76 0 1 0.5) |
|
768 |
#'label:' 'Visibility:' |
|
263 | 769 |
#'adjust:' #right |
199 | 770 |
#'resizeForLabel:' true |
771 |
) |
|
772 |
#(#InputFieldSpec |
|
539 | 773 |
#'name:' 'isVisibleInputField' |
774 |
#'layout:' #(#LayoutFrame 110 0 65 0 -5 1.0 87 0) |
|
577 | 775 |
#'activeHelpKey:' #detailsVisibility |
199 | 776 |
#'tabable:' true |
539 | 777 |
#'model:' #isVisible |
778 |
#'type:' #symbolOrNil |
|
407 | 779 |
#'acceptOnReturn:' false |
780 |
#'acceptOnTab:' false |
|
199 | 781 |
) |
532 | 782 |
#(#LabelSpec |
783 |
#'name:' 'StartGroupLabel' |
|
539 | 784 |
#'layout:' #(#AlignmentOrigin 107 0 111 0 1 0.5) |
532 | 785 |
#'label:' 'Start Group:' |
786 |
#'adjust:' #right |
|
787 |
#'resizeForLabel:' true |
|
788 |
) |
|
789 |
#(#PopUpListSpec |
|
790 |
#'name:' 'StartGroupPopUp' |
|
539 | 791 |
#'layout:' #(#LayoutFrame 110 0 100 0 -5 1.0 122 0) |
532 | 792 |
#'label:' 'PopUpList' |
793 |
#'model:' #startGroup |
|
794 |
#'menu:' |
|
795 |
#(nil |
|
796 |
#right |
|
797 |
) |
|
798 |
#'useIndex:' false |
|
799 |
) |
|
539 | 800 |
#(#LabelSpec |
801 |
#'name:' 'accessCharLabel' |
|
802 |
#'layout:' #(#AlignmentOrigin 217 0 142 0 1 0.5) |
|
803 |
#'label:' 'Access Character Position:' |
|
804 |
#'adjust:' #right |
|
805 |
#'resizeForLabel:' true |
|
806 |
) |
|
807 |
#(#InputFieldSpec |
|
808 |
#'name:' 'accessCharField' |
|
809 |
#'layout:' #(#LayoutFrame 220 0 131 0 -5 1.0 153 0) |
|
577 | 810 |
#'activeHelpKey:' #detailsAccessCharaterPosition |
539 | 811 |
#'tabable:' true |
812 |
#'model:' #accessCharacterPos |
|
813 |
#'type:' #numberOrNil |
|
814 |
#'acceptOnReturn:' false |
|
815 |
#'acceptOnTab:' false |
|
816 |
) |
|
199 | 817 |
) |
818 |
) |
|
819 |
) |
|
820 |
! |
|
821 |
||
398 | 822 |
imageEditSpec |
199 | 823 |
"this window spec was automatically generated by the ST/X UIPainter" |
824 |
||
825 |
"do not manually edit this - the painter/builder may not be able to |
|
826 |
handle the specification if its corrupted." |
|
827 |
||
828 |
" |
|
398 | 829 |
UIPainter new openOnClass:MenuEditor andSelector:#imageEditSpec |
830 |
MenuEditor new openInterface:#imageEditSpec |
|
199 | 831 |
" |
832 |
||
833 |
<resource: #canvas> |
|
834 |
||
835 |
^ |
|
836 |
||
837 |
#(#FullSpec |
|
838 |
#'window:' |
|
839 |
#(#WindowSpec |
|
371 | 840 |
#'name:' 'unnamed canvas' |
577 | 841 |
#'layout:' #(#LayoutFrame 238 0 321 0 482 0 462 0) |
199 | 842 |
#'label:' 'unnamed canvas' |
371 | 843 |
#'min:' #(#Point 10 10) |
844 |
#'max:' #(#Point 1280 1024) |
|
577 | 845 |
#'bounds:' #(#Rectangle 238 321 483 463) |
371 | 846 |
#'usePreferredExtent:' false |
199 | 847 |
) |
848 |
#'component:' |
|
849 |
#(#SpecCollection |
|
850 |
#'collection:' |
|
851 |
#( |
|
852 |
#(#LabelSpec |
|
853 |
#'name:' 'retrieverLabel' |
|
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
854 |
#'layout:' #(#AlignmentOrigin 107 0 26 0 1 0.5) |
199 | 855 |
#'label:' 'Retriever:' |
263 | 856 |
#'adjust:' #right |
199 | 857 |
#'resizeForLabel:' true |
858 |
) |
|
859 |
#(#InputFieldSpec |
|
371 | 860 |
#'name:' 'retrieverField' |
411 | 861 |
#'layout:' #(#LayoutFrame 110 0 15 0 -5 1.0 37 0) |
577 | 862 |
#'activeHelpKey:' #imageRetriever |
199 | 863 |
#'tabable:' true |
864 |
#'model:' #retriever |
|
865 |
#'type:' #symbolOrNil |
|
407 | 866 |
#'acceptOnReturn:' false |
867 |
#'acceptOnTab:' false |
|
199 | 868 |
) |
869 |
#(#LabelSpec |
|
870 |
#'name:' 'iconLabel' |
|
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
871 |
#'layout:' #(#AlignmentOrigin 107 0 51 0 1 0.5) |
398 | 872 |
#'label:' 'Selector:' |
263 | 873 |
#'adjust:' #right |
199 | 874 |
#'resizeForLabel:' true |
875 |
) |
|
876 |
#(#InputFieldSpec |
|
371 | 877 |
#'name:' 'iconField' |
411 | 878 |
#'layout:' #(#LayoutFrame 110 0 40 0 -5 1.0 62 0) |
577 | 879 |
#'activeHelpKey:' #imageSelector |
199 | 880 |
#'tabable:' true |
881 |
#'model:' #icon |
|
882 |
#'type:' #symbolOrNil |
|
407 | 883 |
#'acceptOnReturn:' false |
884 |
#'acceptOnTab:' false |
|
199 | 885 |
) |
469 | 886 |
#(#ActionButtonSpec |
887 |
#'name:' 'imageEditorButton' |
|
888 |
#'layout:' #(#LayoutFrame 110 0 66 0 -5 1 90 0) |
|
577 | 889 |
#'activeHelpKey:' #imageImageEditor |
469 | 890 |
#'label:' 'Image Editor' |
891 |
#'tabable:' true |
|
892 |
#'model:' #doEditImage |
|
893 |
) |
|
199 | 894 |
#(#CheckBoxSpec |
895 |
#'name:' 'iconAndLabel' |
|
398 | 896 |
#'layout:' #(#LayoutOrigin 20 0 104 0) |
577 | 897 |
#'activeHelpKey:' #imageImageAndLabel |
199 | 898 |
#'tabable:' true |
899 |
#'model:' #iconAndLabel |
|
398 | 900 |
#'label:' 'Image & Label' |
199 | 901 |
) |
902 |
) |
|
903 |
) |
|
904 |
) |
|
525 | 905 |
! |
906 |
||
907 |
windowSpec |
|
908 |
"this window spec was automatically generated by the ST/X UIPainter" |
|
909 |
||
910 |
"do not manually edit this - the painter/builder may not be able to |
|
911 |
handle the specification if its corrupted." |
|
912 |
||
913 |
" |
|
914 |
UIPainter new openOnClass:MenuEditor andSelector:#windowSpec |
|
915 |
MenuEditor new openInterface:#windowSpec |
|
916 |
" |
|
917 |
"MenuEditor open" |
|
918 |
||
919 |
<resource: #canvas> |
|
920 |
||
921 |
^ |
|
922 |
||
923 |
#(#FullSpec |
|
924 |
#'window:' |
|
925 |
#(#WindowSpec |
|
926 |
#'name:' 'Menu Builder' |
|
571 | 927 |
#'layout:' #(#LayoutFrame 324 0 233 0 903 0 616 0) |
525 | 928 |
#'label:' 'Menu Builder' |
929 |
#'min:' #(#Point 10 10) |
|
930 |
#'max:' #(#Point 1152 900) |
|
571 | 931 |
#'bounds:' #(#Rectangle 324 233 904 617) |
525 | 932 |
#'menu:' #menu |
933 |
#'usePreferredExtent:' false |
|
934 |
) |
|
935 |
#'component:' |
|
936 |
#(#SpecCollection |
|
937 |
#'collection:' |
|
938 |
#( |
|
939 |
#(#MenuPanelSpec |
|
940 |
#'name:' 'menuToolbarView' |
|
941 |
#'layout:' #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
942 |
#'menu:' #menuToolbar |
|
943 |
#'showSeparatingLines:' true |
|
944 |
) |
|
945 |
#(#VariableHorizontalPanelSpec |
|
946 |
#'name:' 'variableHorizontalPanel1' |
|
571 | 947 |
#'layout:' #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
525 | 948 |
#'component:' |
949 |
#(#SpecCollection |
|
950 |
#'collection:' |
|
951 |
#( |
|
952 |
#(#ArbitraryComponentSpec |
|
953 |
#'name:' 'painterView' |
|
954 |
#'menu:' #menuEdit |
|
955 |
#'hasHorizontalScrollBar:' true |
|
956 |
#'hasVerticalScrollBar:' true |
|
957 |
#'component:' #treeView |
|
958 |
#'hasBorder:' false |
|
959 |
) |
|
960 |
#(#ViewSpec |
|
961 |
#'name:' 'view1' |
|
962 |
#'component:' |
|
963 |
#(#SpecCollection |
|
964 |
#'collection:' |
|
965 |
#( |
|
966 |
#(#NoteBookViewSpec |
|
967 |
#'name:' 'specificationView' |
|
968 |
#'layout:' #(#LayoutFrame 1 0.0 0 0.0 1 1.0 -26 1.0) |
|
969 |
#'tabable:' true |
|
970 |
#'model:' #tabModel |
|
971 |
#'menu:' #tabList |
|
972 |
#'useIndex:' true |
|
973 |
#'canvas:' #noteBookView |
|
974 |
) |
|
975 |
#(#UISubSpecification |
|
976 |
#'name:' 'SubSpecification' |
|
977 |
#'layout:' #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0) |
|
978 |
#'majorKey:' #ToolApplicationModel |
|
979 |
#'minorKey:' #windowSpecForCommit |
|
980 |
) |
|
981 |
) |
|
982 |
) |
|
983 |
#'level:' -1 |
|
984 |
) |
|
985 |
) |
|
986 |
) |
|
987 |
#'handles:' #(#Any 0.384483 1.0) |
|
988 |
) |
|
989 |
#(#UISubSpecification |
|
990 |
#'name:' 'infoBarSubSpec' |
|
571 | 991 |
#'layout:' #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
525 | 992 |
#'majorKey:' #ToolApplicationModel |
535 | 993 |
#'minorKey:' #windowSpecForInfoBarWithClock |
525 | 994 |
) |
995 |
) |
|
996 |
) |
|
997 |
) |
|
998 |
! ! |
|
999 |
||
1000 |
!MenuEditor class methodsFor:'menu specs'! |
|
1001 |
||
1002 |
menu |
|
1003 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
1004 |
||
1005 |
"do not manually edit this - the builder may not be able to |
|
1006 |
handle the specification if its corrupted." |
|
1007 |
||
1008 |
" |
|
1009 |
MenuEditor new openOnClass:MenuEditor andSelector:#menu |
|
1010 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menu)) startUp |
|
1011 |
" |
|
1012 |
||
1013 |
<resource: #menu> |
|
1014 |
||
1015 |
^ |
|
1016 |
||
1017 |
#(#Menu |
|
1018 |
||
1019 |
#( |
|
1020 |
#(#MenuItem |
|
1021 |
#'label:' 'About' |
|
577 | 1022 |
#'activeHelpKey:' #about |
525 | 1023 |
#'accessCharacterPosition:' 1 |
546 | 1024 |
#'labelImage:' #(#ResourceRetriever nil #menuIcon) |
525 | 1025 |
#'submenuChannel:' #menuAbout |
1026 |
) |
|
1027 |
#(#MenuItem |
|
1028 |
#'label:' 'File' |
|
1029 |
#'translateLabel:' true |
|
1030 |
#'value:' #file |
|
577 | 1031 |
#'activeHelpKey:' #file |
525 | 1032 |
#'submenu:' |
1033 |
#(#Menu |
|
1034 |
||
1035 |
#( |
|
1036 |
#(#MenuItem |
|
1037 |
#'label:' 'New' |
|
1038 |
#'value:' #doNew |
|
548 | 1039 |
#'activeHelpKey:' #fileNew |
525 | 1040 |
) |
1041 |
#(#MenuItem |
|
1042 |
#'label:' '-' |
|
1043 |
) |
|
1044 |
#(#MenuItem |
|
1045 |
#'label:' 'Load...' |
|
1046 |
#'translateLabel:' true |
|
1047 |
#'value:' #doFromClass |
|
548 | 1048 |
#'activeHelpKey:' #fileLoad |
525 | 1049 |
#'enabled:' #isStandAlone |
1050 |
) |
|
1051 |
#(#MenuItem |
|
1052 |
#'label:' '-' |
|
1053 |
) |
|
1054 |
#(#MenuItem |
|
1055 |
#'label:' 'Save' |
|
1056 |
#'value:' #doInstallSpec |
|
548 | 1057 |
#'activeHelpKey:' #fileSave |
525 | 1058 |
) |
1059 |
#(#MenuItem |
|
1060 |
#'label:' '-' |
|
1061 |
) |
|
1062 |
#(#MenuItem |
|
1063 |
#'label:' 'Pick A Menu' |
|
1064 |
#'value:' #doPickAMenu |
|
577 | 1065 |
#'activeHelpKey:' #filePickAMenu |
525 | 1066 |
#'enabled:' #isStandAlone |
1067 |
) |
|
1068 |
#(#MenuItem |
|
603 | 1069 |
#'label:' 'Define Class...' |
525 | 1070 |
#'value:' #doDefineClass |
578 | 1071 |
#'activeHelpKey:' #fileDefineClass |
525 | 1072 |
#'enabled:' #isStandAlone |
1073 |
) |
|
1074 |
#(#MenuItem |
|
603 | 1075 |
#'label:' 'Browse Class' |
525 | 1076 |
#'value:' #doBrowseAppClass |
578 | 1077 |
#'activeHelpKey:' #fileBrowseClass |
525 | 1078 |
) |
1079 |
#(#MenuItem |
|
1080 |
#'label:' '-' |
|
1081 |
) |
|
1082 |
#(#MenuItem |
|
1083 |
#'label:' 'Exit' |
|
1084 |
#'translateLabel:' true |
|
1085 |
#'value:' #closeRequest |
|
548 | 1086 |
#'activeHelpKey:' #fileExit |
525 | 1087 |
) |
1088 |
) nil |
|
1089 |
nil |
|
1090 |
) |
|
1091 |
) |
|
1092 |
#(#MenuItem |
|
1093 |
#'label:' 'Edit' |
|
577 | 1094 |
#'activeHelpKey:' #edit |
525 | 1095 |
#'submenuChannel:' #menuEdit |
1096 |
) |
|
1097 |
#(#MenuItem |
|
1098 |
#'label:' 'Add' |
|
577 | 1099 |
#'activeHelpKey:' #add |
525 | 1100 |
#'submenuChannel:' #menuAdd |
1101 |
) |
|
1102 |
#(#MenuItem |
|
1103 |
#'label:' 'Test' |
|
577 | 1104 |
#'activeHelpKey:' #test |
525 | 1105 |
#'submenuChannel:' #submenuTest |
1106 |
) |
|
1107 |
#(#MenuItem |
|
1108 |
#'label:' 'History' |
|
577 | 1109 |
#'activeHelpKey:' #history |
525 | 1110 |
#'submenuChannel:' #menuHistory |
1111 |
) |
|
1112 |
#(#MenuItem |
|
1113 |
#'label:' 'Help' |
|
546 | 1114 |
#'startGroup:' #right |
577 | 1115 |
#'activeHelpKey:' #help |
525 | 1116 |
#'submenuChannel:' #menuHelp |
1117 |
) |
|
1118 |
) nil |
|
1119 |
nil |
|
1120 |
) |
|
1121 |
! |
|
1122 |
||
1123 |
menuAdd |
|
1124 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
1125 |
||
1126 |
"do not manually edit this - the builder may not be able to |
|
1127 |
handle the specification if its corrupted." |
|
1128 |
||
1129 |
" |
|
1130 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuAdd |
|
1131 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuAdd)) startUp |
|
1132 |
" |
|
1133 |
||
1134 |
<resource: #menu> |
|
1135 |
||
1136 |
^ |
|
1137 |
||
1138 |
#(#Menu |
|
1139 |
||
1140 |
#( |
|
1141 |
#(#MenuItem |
|
548 | 1142 |
#'label:' 'Menu Item' |
525 | 1143 |
#'value:' #doCreateItem |
548 | 1144 |
#'activeHelpKey:' #addMenuItem |
1145 |
#'labelImage:' #(#ResourceRetriever #MenuEditor #menuItemImage 'Menu Item') |
|
525 | 1146 |
) |
1147 |
#(#MenuItem |
|
548 | 1148 |
#'label:' 'Menu Separator' |
525 | 1149 |
#'value:' #doCreateSep |
548 | 1150 |
#'activeHelpKey:' #addMenuSeparator |
1151 |
#'labelImage:' #(#ResourceRetriever #MenuEditor #menuSeparatorImage 'Menu Separator') |
|
525 | 1152 |
) |
1153 |
#(#MenuItem |
|
1154 |
#'label:' '-' |
|
1155 |
) |
|
1156 |
#(#MenuItem |
|
1157 |
#'label:' 'Submenu' |
|
1158 |
#'value:' #doCreateMenu |
|
577 | 1159 |
#'activeHelpKey:' #addSubMenu |
525 | 1160 |
#'labelImage:' #(#ResourceRetriever #MenuEditor #submenuImage 'Submenu') |
1161 |
) |
|
1162 |
#(#MenuItem |
|
1163 |
#'label:' 'Submenu Link' |
|
1164 |
#'value:' #doCreateLink |
|
577 | 1165 |
#'activeHelpKey:' #addSubMenuLink |
525 | 1166 |
#'labelImage:' #(#ResourceRetriever #MenuEditor #linkSubmenuImage 'Submenu Link') |
1167 |
) |
|
1168 |
) nil |
|
1169 |
nil |
|
1170 |
) |
|
1171 |
! |
|
1172 |
||
1173 |
menuDefaultLink |
|
1174 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
1175 |
||
1176 |
"do not manually edit this - the builder may not be able to |
|
1177 |
handle the specification if its corrupted." |
|
1178 |
||
1179 |
" |
|
1180 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuDefaultLink |
|
1181 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuDefaultLink)) startUp |
|
1182 |
" |
|
1183 |
||
1184 |
<resource: #menu> |
|
1185 |
||
1186 |
^ |
|
1187 |
||
1188 |
#(#Menu |
|
1189 |
||
1190 |
#( |
|
1191 |
#(#MenuItem |
|
1192 |
#'label:' '!! derives from application !!' |
|
1193 |
) |
|
1194 |
) nil |
|
1195 |
nil |
|
1196 |
) |
|
1197 |
! |
|
1198 |
||
1199 |
menuEdit |
|
1200 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
1201 |
||
1202 |
"do not manually edit this - the builder may not be able to |
|
1203 |
handle the specification if its corrupted." |
|
1204 |
||
1205 |
" |
|
1206 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuEdit |
|
1207 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuEdit)) startUp |
|
1208 |
" |
|
1209 |
||
1210 |
<resource: #menu> |
|
1211 |
||
1212 |
^ |
|
1213 |
||
1214 |
#(#Menu |
|
1215 |
||
1216 |
#( |
|
1217 |
#(#MenuItem |
|
1218 |
#'label:' 'Cut' |
|
1219 |
#'value:' #doCut |
|
548 | 1220 |
#'activeHelpKey:' #editCut |
525 | 1221 |
#'enabled:' #hasValidSelection |
1222 |
#'shortcutKeyCharacter:' #Cut |
|
1223 |
) |
|
1224 |
#(#MenuItem |
|
1225 |
#'label:' 'Copy' |
|
1226 |
#'value:' #doCopy |
|
548 | 1227 |
#'activeHelpKey:' #editCopy |
525 | 1228 |
#'enabled:' #hasValidSelection |
1229 |
#'shortcutKeyCharacter:' #Copy |
|
1230 |
) |
|
1231 |
#(#MenuItem |
|
1232 |
#'label:' 'Paste' |
|
1233 |
#'value:' #doPaste |
|
548 | 1234 |
#'activeHelpKey:' #editPaste |
525 | 1235 |
#'enabled:' #hasAnySingleSelection |
1236 |
#'shortcutKeyCharacter:' #Paste |
|
1237 |
) |
|
1238 |
#(#MenuItem |
|
1239 |
#'label:' '-' |
|
1240 |
) |
|
1241 |
#(#MenuItem |
|
1242 |
#'label:' 'Move Up' |
|
1243 |
#'value:' #doStepUp |
|
548 | 1244 |
#'activeHelpKey:' #editMoveUp |
525 | 1245 |
#'enabled:' #enabledStepOver |
557 | 1246 |
#'labelImage:' #(#ResourceRetriever #ToolApplicationModel #upIcon 'Move Up') |
525 | 1247 |
) |
1248 |
#(#MenuItem |
|
1249 |
#'label:' 'Move Down' |
|
1250 |
#'value:' #doStepDown |
|
548 | 1251 |
#'activeHelpKey:' #editMoveDown |
525 | 1252 |
#'enabled:' #enabledStepOver |
557 | 1253 |
#'labelImage:' #(#ResourceRetriever #ToolApplicationModel #downIcon 'Move Down') |
525 | 1254 |
) |
1255 |
#(#MenuItem |
|
1256 |
#'label:' 'Move In' |
|
1257 |
#'value:' #doStepIn |
|
548 | 1258 |
#'activeHelpKey:' #editMoveIn |
525 | 1259 |
#'enabled:' #enabledStepIn |
557 | 1260 |
#'labelImage:' #(#ResourceRetriever #ToolApplicationModel #downRightIcon 'Move In') |
525 | 1261 |
) |
1262 |
#(#MenuItem |
|
1263 |
#'label:' 'Move Out' |
|
1264 |
#'value:' #doStepOut |
|
548 | 1265 |
#'activeHelpKey:' #editMoveOut |
525 | 1266 |
#'enabled:' #enabledStepOut |
557 | 1267 |
#'labelImage:' #(#ResourceRetriever #ToolApplicationModel #leftDownIcon 'Move Out') |
525 | 1268 |
) |
1269 |
) nil |
|
1270 |
nil |
|
1271 |
) |
|
1272 |
! |
|
1273 |
||
1274 |
menuToolbar |
|
1275 |
"this window spec was automatically generated by the ST/X MenuEditor" |
|
1276 |
||
1277 |
"do not manually edit this - the builder may not be able to |
|
1278 |
handle the specification if its corrupted." |
|
1279 |
||
1280 |
" |
|
1281 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuToolbar |
|
1282 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuToolbar)) startUp |
|
1283 |
" |
|
1284 |
||
1285 |
<resource: #menu> |
|
1286 |
||
1287 |
^ |
|
1288 |
||
1289 |
#(#Menu |
|
1290 |
||
1291 |
#( |
|
1292 |
#(#MenuItem |
|
1293 |
#'label:' 'New' |
|
1294 |
#'isButton:' true |
|
1295 |
#'value:' #doNew |
|
548 | 1296 |
#'activeHelpKey:' #fileNew |
525 | 1297 |
#'labelImage:' #(#ResourceRetriever nil #newIcon) |
1298 |
) |
|
1299 |
#(#MenuItem |
|
1300 |
#'label:' 'Load' |
|
1301 |
#'isButton:' true |
|
1302 |
#'value:' #doFromClass |
|
548 | 1303 |
#'activeHelpKey:' #fileLoad |
525 | 1304 |
#'labelImage:' #(#ResourceRetriever nil #loadIcon) |
1305 |
) |
|
1306 |
#(#MenuItem |
|
1307 |
#'label:' 'Save' |
|
1308 |
#'isButton:' true |
|
1309 |
#'value:' #doInstallSpec |
|
548 | 1310 |
#'activeHelpKey:' #fileSave |
525 | 1311 |
#'labelImage:' #(#ResourceRetriever nil #saveIcon) |
1312 |
) |
|
1313 |
#(#MenuItem |
|
1314 |
#'label:' '' |
|
1315 |
) |
|
1316 |
#(#MenuItem |
|
548 | 1317 |
#'label:' 'Add Item' |
525 | 1318 |
#'isButton:' true |
1319 |
#'value:' #doCreateItem |
|
548 | 1320 |
#'activeHelpKey:' #addMenuItem |
525 | 1321 |
#'enabled:' #hasAnySingleSelection |
1322 |
#'labelImage:' #(#ResourceRetriever nil #menuItemImage) |
|
1323 |
) |
|
1324 |
#(#MenuItem |
|
548 | 1325 |
#'label:' 'Add Separator' |
525 | 1326 |
#'isButton:' true |
1327 |
#'value:' #doCreateSep |
|
548 | 1328 |
#'activeHelpKey:' #addMenuSeparator |
525 | 1329 |
#'enabled:' #hasAnySingleSelection |
1330 |
#'labelImage:' #(#ResourceRetriever nil #menuSeparatorImage) |
|
1331 |
) |
|
1332 |
#(#MenuItem |
|
1333 |
#'label:' '' |
|
1334 |
) |
|
1335 |
#(#MenuItem |
|
548 | 1336 |
#'label:' 'Add Submenu' |
525 | 1337 |
#'isButton:' true |
1338 |
#'value:' #doCreateMenu |
|
548 | 1339 |
#'activeHelpKey:' #addSubMenu |
525 | 1340 |
#'enabled:' #hasAnySingleSelection |
1341 |
#'labelImage:' #(#ResourceRetriever nil #submenuImage) |
|
1342 |
) |
|
1343 |
#(#MenuItem |
|
548 | 1344 |
#'label:' 'Add Linked Submenu' |
525 | 1345 |
#'isButton:' true |
1346 |
#'value:' #doCreateLink |
|
548 | 1347 |
#'activeHelpKey:' #addSubMenuLink |
525 | 1348 |
#'enabled:' #hasAnySingleSelection |
1349 |
#'labelImage:' #(#ResourceRetriever nil #linkSubmenuImage) |
|
1350 |
) |
|
1351 |
#(#MenuItem |
|
1352 |
#'label:' '' |
|
1353 |
) |
|
1354 |
#(#MenuItem |
|
1355 |
#'label:' 'Move Up' |
|
1356 |
#'isButton:' true |
|
1357 |
#'value:' #doStepUp |
|
548 | 1358 |
#'activeHelpKey:' #editMoveUp |
525 | 1359 |
#'enabled:' #enabledStepOver |
1360 |
#'labelImage:' #(#ResourceRetriever nil #upIcon) |
|
1361 |
) |
|
1362 |
#(#MenuItem |
|
1363 |
#'label:' 'Move Down' |
|
1364 |
#'isButton:' true |
|
1365 |
#'value:' #doStepDown |
|
548 | 1366 |
#'activeHelpKey:' #editMoveDown |
525 | 1367 |
#'enabled:' #enabledStepOver |
1368 |
#'labelImage:' #(#ResourceRetriever nil #downIcon) |
|
1369 |
) |
|
1370 |
#(#MenuItem |
|
1371 |
#'label:' 'Move In' |
|
1372 |
#'isButton:' true |
|
1373 |
#'value:' #doStepIn |
|
548 | 1374 |
#'activeHelpKey:' #editMoveIn |
525 | 1375 |
#'enabled:' #enabledStepIn |
1376 |
#'labelImage:' #(#ResourceRetriever nil #downRightIcon) |
|
1377 |
) |
|
1378 |
#(#MenuItem |
|
1379 |
#'label:' 'Move Out' |
|
1380 |
#'isButton:' true |
|
1381 |
#'value:' #doStepOut |
|
548 | 1382 |
#'activeHelpKey:' #editMoveOut |
525 | 1383 |
#'enabled:' #enabledStepOut |
1384 |
#'labelImage:' #(#ResourceRetriever nil #leftDownIcon) |
|
1385 |
) |
|
1386 |
) nil |
|
1387 |
nil |
|
1388 |
) |
|
1389 |
! ! |
|
1390 |
||
1391 |
!MenuEditor class methodsFor:'resources'! |
|
1392 |
||
1393 |
linkSubmenuImage |
|
1394 |
"Generated by the Image Editor" |
|
1395 |
" |
|
1396 |
ImageEditor openOnClass:self andSelector:#linkSubmenuImage |
|
1397 |
" |
|
1398 |
||
1399 |
<resource: #image> |
|
1400 |
||
1401 |
^Icon |
|
1402 |
constantNamed:#'MenuEditor linkSubmenuImage' |
|
1403 |
ifAbsentPut:[(Depth4Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@ADQDQDQDQDQDQH@D"H"H"H"H"H"K0@RH"H"H"H"H"H/@A????????????<@D@@@@@@@@@@@C0@PL3L0DQDQDQD_@A@3L3LBH"H"H"<@DCL3L3@"H"H"K0@PL3L3L0??????@A@@@@L3L@@@@@<@DQDQDCL3@PLAG0@RH"H"@3L0@3@/@AH"H"H L3L3L0<@G?????<CL3L3L@@P@@@@@@@3L3LO@ADQDQDQDP@CLA<@D"H"H"H"H LBK0@RH"H"H"H"@BH/@B????????????<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b'); colorMap:((OrderedCollection new add:(Color black); add:(Color white); add:(Color grey:66.9978); add:(Color red:100.0 green:0.0 blue:0.0); add:(Color red:0.0 green:100.0 blue:0.0); add:(Color red:0.0 green:0.0 blue:100.0); add:(Color red:0.0 green:100.0 blue:100.0); add:(Color red:100.0 green:100.0 blue:0.0); add:(Color red:100.0 green:0.0 blue:100.0); add:(Color red:49.9962 green:0.0 blue:0.0); add:(Color red:0.0 green:49.9962 blue:0.0); add:(Color red:0.0 green:0.0 blue:49.9962); add:(Color red:0.0 green:49.9962 blue:49.9962); add:(Color red:49.9962 green:49.9962 blue:0.0); add:(Color red:49.9962 green:0.0 blue:49.9962); add:(Color grey:49.9962); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); yourself); yourself]! |
|
1404 |
||
1405 |
menuItemImage |
|
1406 |
"Generated by the Image Editor" |
|
1407 |
" |
|
1408 |
ImageEditor openOnClass:self andSelector:#menuItemImage |
|
1409 |
" |
|
1410 |
||
1411 |
<resource: #image> |
|
1412 |
||
1413 |
^Icon |
|
1414 |
constantNamed:#'MenuEditor menuItemImage' |
|
1415 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUQUUUUUUUPUUUUUUU_UUUUUUUPUUUUUUUP@@@@@@@@EUUUUUVAF*****+HF:?+::;@F:.+*?;@F:.+::;@F:.+*:;@F:.+::;@F*****+DK??????A@@@@@@@@UUUUUUUPUUUUUUUXUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUX'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color grey:66.9978)); at:4 put:((Color grey:49.9962)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@???<???<???<???<???<???<???<???<???<???<???<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); yourself); yourself]! |
|
1416 |
||
1417 |
menuSeparatorImage |
|
1418 |
"Generated by the Image Editor" |
|
1419 |
" |
|
1420 |
ImageEditor openOnClass:self andSelector:#menuSeparatorImage |
|
1421 |
" |
|
1422 |
||
1423 |
<resource: #image> |
|
1424 |
||
1425 |
^Icon |
|
1426 |
constantNamed:#'MenuEditor menuSeparatorImage' |
|
1427 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUURUUUUUUUPUUUUUUUPUUUUUUUPUUUUUUUP@@@@@@@@EUUUUUV@F*****+DF*****+CF?????+@F0@@@@[@F%UUUU[HF*****+@F*****+@K??????N@@@@@@@HUUUUUUUPUUUUUUUPUUUUUUUWUUUUUUUXUUUUUUUPUUUUUUUP'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color grey:66.9978)); at:4 put:((Color grey:49.9962)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@???<???<???<???<???<???<???<???<???<???<???<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); yourself); yourself]! |
|
1428 |
||
1429 |
submenuImage |
|
1430 |
"Generated by the Image Editor" |
|
1431 |
" |
|
1432 |
ImageEditor openOnClass:self andSelector:#submenuImage |
|
1433 |
" |
|
1434 |
||
1435 |
<resource: #image> |
|
1436 |
||
1437 |
^Icon |
|
1438 |
constantNamed:#'MenuEditor submenuImage' |
|
1439 |
ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@EUUUUUV@F*****+@F*****+@G??????GD@@@@@C@EUUUUUWLF*****+@F*****+@G??????HD@@@@@C@EUUUUUW@F*****+@F*****+OG??????@D@@@@@C@EUUUUUW@F*****+@F*****+@K??????@@@@@@@@@@@@@@@@@'); colorMap:(((Array new:4) at:1 put:((Color black)); at:2 put:((Color white)); at:3 put:((Color grey:66.9978)); at:4 put:((Color grey:49.9962)); yourself)); mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<???<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); yourself); yourself]! ! |
|
1440 |
||
1441 |
!MenuEditor class methodsFor:'slices'! |
|
1442 |
||
1443 |
slicesItem |
|
1444 |
^#( |
|
1445 |
(Basics basicsItemSpec) |
|
1446 |
(Details detailsEditSpec) |
|
1447 |
(Image imageEditSpec) |
|
1448 |
) |
|
1449 |
||
1450 |
! |
|
1451 |
||
1452 |
slicesLink |
|
1453 |
^#( |
|
1454 |
(Basics basicsLinkSpec) |
|
1455 |
(Details detailsEditSpec) |
|
1456 |
(Image imageEditSpec) |
|
1457 |
) |
|
1458 |
||
1459 |
! |
|
1460 |
||
1461 |
slicesMenu |
|
1462 |
^#( |
|
1463 |
(Basics basicsMenuSpec) |
|
1464 |
(Details detailsEditSpec) |
|
1465 |
(Image imageEditSpec) |
|
1466 |
) |
|
1467 |
||
1468 |
! |
|
1469 |
||
1470 |
slicesRootMenu |
|
1471 |
^#( |
|
1472 |
(Basics basicsRootSpec) |
|
1473 |
) |
|
1474 |
||
1475 |
! |
|
1476 |
||
1477 |
slicesSeparatorMenu |
|
1478 |
^#( |
|
1479 |
(Basics basicsSeparatorSpec) |
|
1480 |
) |
|
1481 |
||
199 | 1482 |
! ! |
1483 |
||
1484 |
!MenuEditor methodsFor:'accessing'! |
|
1485 |
||
398 | 1486 |
isModified: aBoolean |
407 | 1487 |
"sets menu tree modifications; invoked by the painter." |
398 | 1488 |
|
1489 |
isModified := aBoolean |
|
1490 |
! |
|
1491 |
||
199 | 1492 |
specClass |
407 | 1493 |
|
1494 |
^specClass |
|
199 | 1495 |
! |
1496 |
||
1497 |
specClass:aClass |
|
407 | 1498 |
|
199 | 1499 |
aClass isBehavior ifTrue:[specClass := aClass name] |
407 | 1500 |
ifFalse:[specClass := aClass] |
218 | 1501 |
! |
1502 |
||
1503 |
submenuTest |
|
407 | 1504 |
"returns submenu assigned to item test" |
1505 |
||
218 | 1506 |
|menu| |
1507 |
||
407 | 1508 |
(menu := self treeView asMenu) allItemsDo: |
1509 |
[:anItem| |
|
218 | 1510 |
anItem value:nil. |
1511 |
anItem enabled:true. |
|
1512 |
]. |
|
407 | 1513 |
^menu |
287 | 1514 |
! |
1515 |
||
1516 |
useHelpDictionary:aDictionary |
|
407 | 1517 |
|
287 | 1518 |
self noteBookView. |
407 | 1519 |
self helpTool dictionary:aDictionary |
199 | 1520 |
! ! |
1521 |
||
1522 |
!MenuEditor methodsFor:'aspects'! |
|
1523 |
||
1524 |
aspectFor:aKey |
|
407 | 1525 |
"returns aspect for a key or nil" |
1526 |
||
1527 |
^aspects at: aKey ifAbsent: [super aspectFor:aKey] |
|
199 | 1528 |
|
1529 |
||
1530 |
! |
|
1531 |
||
218 | 1532 |
enabledStepIn |
407 | 1533 |
"returns whether user can put selected item in next submenu" |
1534 |
||
1535 |
^builder booleanValueAspectFor: #enabledStepIn |
|
218 | 1536 |
! |
1537 |
||
1538 |
enabledStepOut |
|
407 | 1539 |
"returns whether user can put selected item out of current parent submenu" |
1540 |
||
1541 |
^builder booleanValueAspectFor: #enabledStepOut |
|
1542 |
||
218 | 1543 |
! |
1544 |
||
1545 |
enabledStepOver |
|
407 | 1546 |
"returns whether user can shift selected item up or down" |
1547 |
||
1548 |
^builder booleanValueAspectFor:#enabledStepOver |
|
218 | 1549 |
! |
1550 |
||
220 | 1551 |
hasAnySingleSelection |
407 | 1552 |
|
1553 |
^builder booleanValueAspectFor: #hasAnySingleSelection |
|
220 | 1554 |
! |
1555 |
||
1556 |
hasValidSelection |
|
407 | 1557 |
|
1558 |
^builder booleanValueAspectFor: #hasValidSelection |
|
220 | 1559 |
! |
1560 |
||
1561 |
hasValidSingleSelection |
|
407 | 1562 |
|
1563 |
^builder booleanValueAspectFor: #hasValidSingleSelection |
|
220 | 1564 |
! |
1565 |
||
287 | 1566 |
noteBookView |
199 | 1567 |
|
287 | 1568 |
|noteBook helpTool| |
1569 |
||
1570 |
(noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[ |
|
1571 |
noteBook := View new. |
|
1572 |
helpTool := UIHelpTool new. |
|
1573 |
||
1574 |
helpTool masterApplication:self. |
|
1575 |
helpCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
1576 |
specCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook. |
|
1577 |
||
1578 |
helpCanvas client:helpTool. |
|
432
d35dccaa804c
commit buttons replaced by subSpec in ToolApplicationModel
tz
parents:
422
diff
changeset
|
1579 |
helpTool masterApplication:self. |
422 | 1580 |
helpTool modifiedHolder: self valueOfEnablingCommitButtons. |
287 | 1581 |
|
1582 |
builder aspectAt:#noteBookView put:noteBook. |
|
199 | 1583 |
]. |
287 | 1584 |
^ noteBook |
199 | 1585 |
! |
1586 |
||
1587 |
tabList |
|
1588 |
||
298 | 1589 |
|holder| |
1590 |
(holder := builder bindingAt:#tabList) isNil ifTrue:[ |
|
1591 |
builder aspectAt:#tabList put:(holder := #('Properties') asValue). |
|
1592 |
]. |
|
1593 |
^ holder |
|
1594 |
||
1595 |
||
199 | 1596 |
! |
1597 |
||
1598 |
tabModel |
|
1599 |
||
1600 |
|holder| |
|
1601 |
(holder := builder bindingAt:#tabModel) isNil ifTrue:[ |
|
1602 |
holder := AspectAdaptor new subject:self; forAspect:#tabSelection. |
|
1603 |
builder aspectAt:#tabModel put:holder. |
|
1604 |
]. |
|
1605 |
^ holder |
|
1606 |
||
407 | 1607 |
! |
1608 |
||
1609 |
treeView |
|
1610 |
"returns the tree view representing hierarchically all the menu items" |
|
1611 |
||
1612 |
|treeView| |
|
1613 |
(treeView := builder bindingAt:#treeView) isNil ifTrue:[ |
|
1614 |
treeView := TreeView new. |
|
1615 |
treeView action:[:dummy|self menuChanged]. |
|
1616 |
builder aspectAt: #treeView put: treeView |
|
1617 |
]. |
|
1618 |
^treeView |
|
199 | 1619 |
! ! |
1620 |
||
1621 |
!MenuEditor methodsFor:'change & update'! |
|
1622 |
||
1623 |
update:something with:aParameter from:changedObject |
|
407 | 1624 |
"one of my value holders has changed its value, so let me set the editing menu as modified" |
1625 |
||
422 | 1626 |
self valueOfEnablingCommitButtons value: true |
218 | 1627 |
! |
1628 |
||
1629 |
updateEnabledChannels |
|
407 | 1630 |
"update enabled channels" |
1631 |
||
1632 |
|node parent next state| |
|
1633 |
||
412 | 1634 |
state := false. |
407 | 1635 |
|
1636 |
(node := self treeView selectedNode) notNil |
|
1637 |
ifTrue: |
|
1638 |
[ |
|
220 | 1639 |
self hasAnySingleSelection value:true. |
407 | 1640 |
(parent := node parent) notNil |
1641 |
ifTrue: |
|
1642 |
[ |
|
220 | 1643 |
next := parent childAt:((parent indexOfChild:node) + 1). |
1644 |
self enabledStepIn value:(next notNil and:[next hasChildren]). |
|
1645 |
self enabledStepOver value:(parent children size > 1). |
|
1646 |
self enabledStepOut value:(parent parent notNil). |
|
1647 |
self hasValidSingleSelection value:true. |
|
1648 |
self hasValidSelection value:true. |
|
1649 |
^ self |
|
1650 |
] |
|
407 | 1651 |
] |
1652 |
ifFalse: |
|
1653 |
[ |
|
220 | 1654 |
self hasAnySingleSelection value:false. |
407 | 1655 |
self treeView numberOfSelections ~~ 0 ifTrue:[ |
1656 |
state := (self treeView isInSelection:1) not |
|
220 | 1657 |
] |
407 | 1658 |
]. |
220 | 1659 |
self enabledStepOver value:false. |
1660 |
self enabledStepIn value:false. |
|
1661 |
self enabledStepOut value:false. |
|
1662 |
self hasValidSingleSelection value:false. |
|
1663 |
self hasValidSelection value:state. |
|
1664 |
! ! |
|
1665 |
||
1666 |
!MenuEditor methodsFor:'event handling'! |
|
1667 |
||
407 | 1668 |
doesNotUnderstand: aMessage |
1669 |
"detour incoming messages to the tree view" |
|
1670 |
||
1671 |
(self treeView respondsTo: aMessage selector) |
|
1672 |
ifTrue: |
|
1673 |
[ |
|
1674 |
^aMessage sendTo: self treeView |
|
1675 |
]. |
|
1676 |
super doesNotUnderstand:aMessage |
|
220 | 1677 |
|
1678 |
||
199 | 1679 |
! ! |
1680 |
||
571 | 1681 |
!MenuEditor methodsFor:'help'! |
1682 |
||
1683 |
defaultInfoLabel |
|
1684 |
||
1685 |
specClass isNil ifTrue: [^'No menu class defined']. |
|
1686 |
^specClass printString, ' >> ', self treeView selectorName |
|
1687 |
||
1688 |
! |
|
1689 |
||
1690 |
openTutorial |
|
1691 |
||
621 | 1692 |
self openTutorial: 'tools/MenuEditor/TOP.html'. |
571 | 1693 |
|
1694 |
! ! |
|
1695 |
||
287 | 1696 |
!MenuEditor methodsFor:'private'! |
1697 |
||
407 | 1698 |
checkMenuItemModified |
1699 |
"check menu item modification" |
|
1700 |
||
422 | 1701 |
self valueOfEnablingCommitButtons value |
407 | 1702 |
ifTrue: |
1703 |
[ |
|
1704 |
((YesNoBox title:'Menu item was modified!!\Save it?\' withCRs) |
|
1705 |
noText:'No'; |
|
1706 |
yesText:'Yes'; |
|
1707 |
showAtPointer; |
|
414
116cf2acebe3
before loading of a new menu do fire correct sequence of save requests
tz
parents:
412
diff
changeset
|
1708 |
accepted) |
116cf2acebe3
before loading of a new menu do fire correct sequence of save requests
tz
parents:
412
diff
changeset
|
1709 |
ifFalse: |
116cf2acebe3
before loading of a new menu do fire correct sequence of save requests
tz
parents:
412
diff
changeset
|
1710 |
[ |
422 | 1711 |
self valueOfEnablingCommitButtons value: false. |
414
116cf2acebe3
before loading of a new menu do fire correct sequence of save requests
tz
parents:
412
diff
changeset
|
1712 |
isModified := false. |
116cf2acebe3
before loading of a new menu do fire correct sequence of save requests
tz
parents:
412
diff
changeset
|
1713 |
^true |
116cf2acebe3
before loading of a new menu do fire correct sequence of save requests
tz
parents:
412
diff
changeset
|
1714 |
]. |
407 | 1715 |
self accept |
1716 |
]. |
|
1717 |
^true |
|
1718 |
! |
|
1719 |
||
287 | 1720 |
helpKey |
407 | 1721 |
|
287 | 1722 |
|node| |
407 | 1723 |
(node := self treeView selectedNode) notNil ifTrue:[ |
287 | 1724 |
^ node contents activeHelpKey |
1725 |
]. |
|
1726 |
^ nil |
|
1727 |
! |
|
1728 |
||
1729 |
helpTool |
|
407 | 1730 |
|
1731 |
^helpCanvas application |
|
287 | 1732 |
! ! |
1733 |
||
199 | 1734 |
!MenuEditor methodsFor:'queries'! |
1735 |
||
270
1a68f7479932
provide access to the menus selector;
Claus Gittinger <cg@exept.de>
parents:
266
diff
changeset
|
1736 |
didInstall |
407 | 1737 |
"returns true if the menu was installed" |
1738 |
||
1739 |
^didInstall |
|
270
1a68f7479932
provide access to the menus selector;
Claus Gittinger <cg@exept.de>
parents:
266
diff
changeset
|
1740 |
! |
1a68f7479932
provide access to the menus selector;
Claus Gittinger <cg@exept.de>
parents:
266
diff
changeset
|
1741 |
|
199 | 1742 |
isHelpToolSelected |
407 | 1743 |
"returns true if current selection is help tool" |
1744 |
||
290 | 1745 |
(tabSelection ~~ 0 and:[slices notNil]) ifTrue:[ |
407 | 1746 |
^(slices at:tabSelection) first = UIHelpTool label |
199 | 1747 |
]. |
407 | 1748 |
^false |
287 | 1749 |
! |
1750 |
||
1751 |
isStandAlone |
|
407 | 1752 |
"returns true in case of owner of the helptool" |
1753 |
||
1754 |
^self masterApplication isNil |
|
535 | 1755 |
! |
1756 |
||
1757 |
preferredExtent |
|
1758 |
||
1759 |
^super preferredExtent max: (Screen current width//3)@(Screen current height//2.5) |
|
1760 |
||
1761 |
||
199 | 1762 |
! ! |
1763 |
||
1764 |
!MenuEditor methodsFor:'selection'! |
|
1765 |
||
1766 |
menuChanged |
|
407 | 1767 |
|
432
d35dccaa804c
commit buttons replaced by subSpec in ToolApplicationModel
tz
parents:
422
diff
changeset
|
1768 |
|node item slc sel old dep| |
199 | 1769 |
|
407 | 1770 |
aspects do: [:holder| holder removeDependent:self]. |
1771 |
(node := self treeView selectedNode) notNil ifTrue:[ |
|
199 | 1772 |
aspects do:[:anAspect| anAspect value:nil ]. |
1773 |
item := node contents. |
|
1774 |
item toAspects:aspects. |
|
1775 |
||
218 | 1776 |
item isSeparator ifFalse:[ |
199 | 1777 |
node parent isNil ifFalse:[ |
218 | 1778 |
node hasChildren ifTrue:[ |
1779 |
slc := #slicesMenu |
|
1780 |
] ifFalse:[ |
|
1781 |
item submenuChannel isNil ifTrue:[slc := #slicesItem] |
|
1782 |
ifFalse:[slc := #slicesLink] |
|
1783 |
]. |
|
287 | 1784 |
slc := (self class perform:slc) copyWith:#( 'Help' #dummy ). |
199 | 1785 |
] ifTrue:[ |
287 | 1786 |
slc := self class perform:#slicesRootMenu |
1787 |
]. |
|
199 | 1788 |
] ifTrue:[ |
287 | 1789 |
slc := self class perform:#slicesSeparatorMenu. |
1790 |
] |
|
199 | 1791 |
]. |
432
d35dccaa804c
commit buttons replaced by subSpec in ToolApplicationModel
tz
parents:
422
diff
changeset
|
1792 |
|
d35dccaa804c
commit buttons replaced by subSpec in ToolApplicationModel
tz
parents:
422
diff
changeset
|
1793 |
self helpTool helpKey: self helpKey. |
d35dccaa804c
commit buttons replaced by subSpec in ToolApplicationModel
tz
parents:
422
diff
changeset
|
1794 |
"Next line helps me to preserve myself against unnecessary settings of |
d35dccaa804c
commit buttons replaced by subSpec in ToolApplicationModel
tz
parents:
422
diff
changeset
|
1795 |
valueOfEnablingCommitButtons to true in the help tool." |
d35dccaa804c
commit buttons replaced by subSpec in ToolApplicationModel
tz
parents:
422
diff
changeset
|
1796 |
self valueOfEnablingCommitButtons value: false. |
199 | 1797 |
|
1798 |
slc ~= slices ifTrue:[ |
|
290 | 1799 |
tabSelection ~~ 0 ifTrue:[ |
287 | 1800 |
old := (slices at:tabSelection) first |
1801 |
]. |
|
1802 |
||
199 | 1803 |
(slices := slc) notNil ifTrue:[ |
287 | 1804 |
sel := slices collect:[:s| s first]. |
290 | 1805 |
tabSelection := 0. |
287 | 1806 |
self tabList value:sel. |
1807 |
||
1808 |
(old notNil and:[(sel := sel findFirst:[:n|n = old]) ~~ 0]) ifFalse:[ |
|
1809 |
sel := 1 |
|
1810 |
]. |
|
1811 |
self tabModel value:sel |
|
199 | 1812 |
] ifFalse:[ |
1813 |
self tabList value:nil. |
|
290 | 1814 |
self tabSelection:0. |
199 | 1815 |
] |
1816 |
]. |
|
407 | 1817 |
self updateEnabledChannels. |
1818 |
aspects do: [:holder| holder addDependent:self]. |
|
199 | 1819 |
! |
1820 |
||
1821 |
tabSelection |
|
407 | 1822 |
|
1823 |
^tabSelection ? 0 |
|
199 | 1824 |
! |
1825 |
||
407 | 1826 |
tabSelection: aSelection |
1827 |
||
412 | 1828 |
|sel| |
287 | 1829 |
tabSelection = aSelection ifTrue:[ |
199 | 1830 |
^ self |
1831 |
]. |
|
298 | 1832 |
(aSelection ~~ 0 and:[slices isNil]) ifTrue:[ |
1833 |
^ self |
|
1834 |
]. |
|
290 | 1835 |
(tabSelection := aSelection) == 0 ifTrue:[ |
287 | 1836 |
slices isNil ifTrue:[ |
1837 |
specCanvas client:nil. |
|
1838 |
^ specCanvas raise. |
|
1839 |
]. |
|
1840 |
tabSelection == 1 ifTrue:[^ self]. |
|
1841 |
tabSelection := 1 |
|
199 | 1842 |
]. |
287 | 1843 |
|
432
d35dccaa804c
commit buttons replaced by subSpec in ToolApplicationModel
tz
parents:
422
diff
changeset
|
1844 |
self isHelpToolSelected ifTrue:[ |
287 | 1845 |
self helpTool helpKey:(self helpKey). |
1846 |
helpCanvas raise. |
|
412 | 1847 |
] ifFalse:[ |
1848 |
sel := (slices at:tabSelection) last. |
|
407 | 1849 |
aspects do: [:holder| holder release]. |
287 | 1850 |
specCanvas client:self spec:(self class perform:sel) builder:builder. |
407 | 1851 |
aspects do: [:holder| holder addDependent:self]. |
1852 |
specCanvas raise. |
|
199 | 1853 |
] |
298 | 1854 |
|
199 | 1855 |
! ! |
1856 |
||
1857 |
!MenuEditor methodsFor:'startup / release'! |
|
1858 |
||
1859 |
buildFrom:aClass andSelector:aSelector |
|
407 | 1860 |
|
249 | 1861 |
|oldClass newClass| |
199 | 1862 |
|
422 | 1863 |
self valueOfEnablingCommitButtons value: false. |
199 | 1864 |
oldClass := self specClass. |
1865 |
self specClass:aClass. |
|
1866 |
newClass := self specClass. |
|
1867 |
||
287 | 1868 |
(self isStandAlone and:[oldClass ~= newClass]) ifTrue:[ |
1869 |
self helpTool helpSpecFrom:newClass |
|
199 | 1870 |
]. |
407 | 1871 |
self treeView buildFrom: newClass andSelector: aSelector. |
398 | 1872 |
|
1873 |
aClass notNil & aSelector notNil |
|
1874 |
ifTrue: |
|
1875 |
[ |
|
1876 |
|className message| |
|
1877 |
aClass isClass ifTrue: [className := aClass name]. |
|
1878 |
aClass isString ifTrue: [className := aClass]. |
|
1879 |
message := className, ' ', aSelector. |
|
507 | 1880 |
self addToHistory: message -> #loadFromMessage: |
398 | 1881 |
]. |
1882 |
||
571 | 1883 |
self updateInfoLabel. |
412 | 1884 |
self treeView selection: 2. |
1885 |
self menuChanged |
|
398 | 1886 |
|
1887 |
! |
|
1888 |
||
1889 |
checkModified |
|
1890 |
"check menu modification |
|
1891 |
" |
|
1892 |
isModified |
|
1893 |
ifTrue: |
|
1894 |
[ |
|
1895 |
((YesNoBox title:'Menu was modified!!') |
|
1896 |
noText:'Cancel'; |
|
1897 |
yesText:'Waste it and proceed'; |
|
1898 |
showAtPointer; |
|
1899 |
accepted) ifFalse: [^false]. |
|
1900 |
isModified := false |
|
1901 |
]. |
|
1902 |
^true |
|
1903 |
||
1904 |
||
199 | 1905 |
! |
1906 |
||
356 | 1907 |
closeRequest |
412 | 1908 |
"close request" |
1909 |
||
418 | 1910 |
(self checkMenuItemModified and: [self checkModified]) ifTrue: [super closeRequest] |
356 | 1911 |
|
1912 |
||
1913 |
||
1914 |
||
1915 |
||
1916 |
! |
|
1917 |
||
199 | 1918 |
initialize |
407 | 1919 |
"initialize value holders for the menu item properties" |
1920 |
||
218 | 1921 |
|holder| |
1922 |
||
199 | 1923 |
super initialize. |
1924 |
aspects := IdentityDictionary new. |
|
290 | 1925 |
tabSelection := 0. |
199 | 1926 |
|
1927 |
#( |
|
1928 |
label |
|
407 | 1929 |
accessCharacterPos |
290 | 1930 |
argument |
218 | 1931 |
submenuChannel |
199 | 1932 |
enabled |
1933 |
value |
|
1934 |
nameKey |
|
1935 |
indication |
|
398 | 1936 |
translateLabel |
1937 |
isButton |
|
199 | 1938 |
shortcutKey |
532 | 1939 |
startGroup |
199 | 1940 |
retriever |
1941 |
iconAndLabel |
|
1942 |
icon |
|
539 | 1943 |
isVisible |
199 | 1944 |
|
218 | 1945 |
) do:[:aKey| |
1946 |
aspects at:aKey put:(holder := ValueHolder new). |
|
407 | 1947 |
holder addDependent: self |
199 | 1948 |
]. |
1949 |
||
218 | 1950 |
aspects at:#seperatorSelection put:(holder := SelectionInList new). |
407 | 1951 |
holder list: Item separatorList. |
218 | 1952 |
holder addDependent:self. |
571 | 1953 |
|
199 | 1954 |
! |
1955 |
||
398 | 1956 |
loadFromMessage: aMessage |
1957 |
||
414
116cf2acebe3
before loading of a new menu do fire correct sequence of save requests
tz
parents:
412
diff
changeset
|
1958 |
(((aMessage size > 0) and: [self checkMenuItemModified]) and: [self checkModified]) |
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
1959 |
ifTrue: |
398 | 1960 |
[ |
1961 |
|readStream aClass aSelector| |
|
1962 |
readStream := aMessage readStream. |
|
1963 |
aClass := Smalltalk at: (readStream upTo: $ ) asSymbol. |
|
1964 |
aSelector := readStream upToEnd asSymbol. |
|
412 | 1965 |
self buildFrom: aClass andSelector: aSelector |
398 | 1966 |
] |
1967 |
! |
|
1968 |
||
213 | 1969 |
openModalOnClass:aClass andSelector:aSelector |
416 | 1970 |
|
213 | 1971 |
specClass := Association key:aClass value:aSelector. |
1972 |
super openInterfaceModal. |
|
1973 |
||
1974 |
! |
|
1975 |
||
199 | 1976 |
openOnClass:aClass andSelector:aSelector |
416 | 1977 |
|
213 | 1978 |
specClass := Association key:aClass value:aSelector. |
199 | 1979 |
super openInterface. |
1980 |
self buildFrom:aClass andSelector:aSelector. |
|
213 | 1981 |
|
209 | 1982 |
! |
1983 |
||
1984 |
postBuildWith:builder |
|
213 | 1985 |
|cls sel| |
1986 |
||
537 | 1987 |
super postBuildWith:builder. |
1988 |
||
356 | 1989 |
didInstall := false. |
1990 |
isModified := false. |
|
1991 |
||
213 | 1992 |
specClass isAssociation ifTrue:[ |
1993 |
cls := specClass key. |
|
1994 |
sel := specClass value. |
|
228 | 1995 |
|
1996 |
specClass := nil. |
|
1997 |
||
1998 |
(sel isKindOf:Menu) ifTrue:[ |
|
1999 |
self buildFrom:cls andSelector:nil. |
|
412 | 2000 |
^self treeView buildFromMenu:sel. |
228 | 2001 |
] |
2002 |
||
213 | 2003 |
]. |
412 | 2004 |
self buildFrom:cls andSelector:sel |
2005 |
! |
|
2006 |
||
2007 |
postOpenWith:aBuilder |
|
2008 |
||
537 | 2009 |
super postOpenWith:aBuilder. |
2010 |
||
412 | 2011 |
self isHelpToolSelected |
2012 |
ifTrue: [helpCanvas raise] |
|
2013 |
ifFalse: [specCanvas raise] |
|
199 | 2014 |
! ! |
2015 |
||
2016 |
!MenuEditor methodsFor:'user interactions'! |
|
2017 |
||
407 | 2018 |
accept |
2019 |
"invoked by button 'OK' and by save requests of menu item changes" |
|
2020 |
||
2021 |
|node| |
|
2022 |
node := self treeView selectedNode. |
|
2023 |
node notNil |
|
2024 |
ifTrue: |
|
2025 |
[ |
|
2026 |
self isHelpToolSelected |
|
2027 |
ifTrue: |
|
2028 |
[ |
|
2029 |
self helpTool accept. |
|
2030 |
node contents activeHelpKey: self helpTool helpKey |
|
2031 |
] |
|
2032 |
ifFalse: |
|
2033 |
[ |
|
2034 |
self treeView updateNode: (node contents buildFromAspects: aspects) |
|
2035 |
] |
|
2036 |
]. |
|
422 | 2037 |
self valueOfEnablingCommitButtons value:false. |
407 | 2038 |
isModified := true |
2039 |
! |
|
2040 |
||
2041 |
cancel |
|
2042 |
"invoked by button 'Cancel'" |
|
2043 |
||
2044 |
|node| |
|
2045 |
(node := self treeView selectedNode) notNil |
|
2046 |
ifTrue: |
|
432
d35dccaa804c
commit buttons replaced by subSpec in ToolApplicationModel
tz
parents:
422
diff
changeset
|
2047 |
[ |
407 | 2048 |
self helpTool helpKey:(self helpKey). |
2049 |
aspects do:[:anAspect| anAspect value:nil]. |
|
2050 |
node contents toAspects:aspects |
|
2051 |
]. |
|
422 | 2052 |
self valueOfEnablingCommitButtons value: false. |
414
116cf2acebe3
before loading of a new menu do fire correct sequence of save requests
tz
parents:
412
diff
changeset
|
2053 |
isModified := false |
407 | 2054 |
! |
2055 |
||
199 | 2056 |
doBrowseAppClass |
2057 |
"open a browser on the class" |
|
2058 |
||
2059 |
|cls| |
|
2060 |
||
407 | 2061 |
(cls := self resolveName: self specClass) notNil |
2062 |
ifTrue: |
|
2063 |
[ |
|
2064 |
SystemBrowser openInClass:cls class selector: self treeView selectorName |
|
2065 |
] |
|
2066 |
ifFalse: |
|
2067 |
[ |
|
398 | 2068 |
self information:'No valid class defined!!'. |
331 | 2069 |
] |
199 | 2070 |
! |
2071 |
||
2072 |
doDefineClass |
|
2073 |
||
2074 |
aspects at:#classNameChannel put:(self specClass asValue). |
|
2075 |
||
2076 |
(self openDialogInterface:#classDefineSpec) ifTrue:[ |
|
2077 |
self specClass:((aspects at:#classNameChannel) value) |
|
2078 |
]. |
|
2079 |
||
2080 |
! |
|
2081 |
||
381 | 2082 |
doEditImage |
2083 |
||
398 | 2084 |
|cls resourceClass resourceSelector imageResourceMessage readStream| |
2085 |
||
416 | 2086 |
cls := self resolveName: self specClass. |
398 | 2087 |
cls isNil ifTrue:[ |
2088 |
^ self information:'No valid class defined!!'. |
|
2089 |
]. |
|
2090 |
(aspects at:#icon) value size > 0 |
|
2091 |
ifTrue: [resourceSelector := (aspects at:#icon) value] |
|
2092 |
ifFalse: [resourceSelector := #stxIcon]. |
|
416 | 2093 |
(aspects at:#retriever) value size > 0 |
2094 |
ifTrue: [resourceClass := (aspects at:#retriever) value] |
|
2095 |
ifFalse: [resourceClass := cls withAllSuperclasses detect: [:cls| cls class implements: resourceSelector] ifNone: [cls]]. |
|
2096 |
||
2097 |
(imageResourceMessage := ImageEditor openModalOnClass: resourceClass andSelector: resourceSelector) notNil |
|
398 | 2098 |
ifTrue: |
2099 |
[ |
|
416 | 2100 |
readStream := imageResourceMessage readStream. |
2101 |
resourceClass := (readStream upTo: $ ) asSymbol. |
|
2102 |
resourceSelector := readStream upToEnd asSymbol. |
|
2103 |
resourceClass size > 0 ifTrue: [(aspects at:#retriever) value: resourceClass]. |
|
422 | 2104 |
resourceSelector size > 0 ifTrue: [(aspects at:#icon) value: resourceSelector. self valueOfEnablingCommitButtons value: true] |
398 | 2105 |
] |
381 | 2106 |
! |
2107 |
||
199 | 2108 |
doFromClass |
2109 |
||
548 | 2110 |
self loadFromMessage: |
2111 |
(ResourceSelectionBrowser |
|
2112 |
request: 'Load Menu From Class' |
|
2113 |
onSuperclass: nil |
|
2114 |
andClass: specClass |
|
2115 |
andSelector: self treeView selectorName |
|
2116 |
withResourceTypes: #(menu)) |
|
199 | 2117 |
! |
2118 |
||
2119 |
doInstallSpec |
|
407 | 2120 |
|cls selector treeView menu spec mthd category code| |
199 | 2121 |
|
331 | 2122 |
cls := self resolveName:(self specClass). |
2123 |
||
2124 |
cls isNil ifTrue:[ |
|
398 | 2125 |
^ self information:'No valid class defined!!'. |
199 | 2126 |
]. |
407 | 2127 |
treeView := self treeView. |
2128 |
selector := treeView selectorName. |
|
2129 |
menu := treeView asMenu. |
|
199 | 2130 |
|
2131 |
menu isNil ifTrue:[ |
|
576 | 2132 |
^ self information:'No menu defined!!' |
199 | 2133 |
]. |
2134 |
menu := menu literalArrayEncoding. |
|
2135 |
spec := WriteStream on:String new. |
|
2136 |
UISpecification prettyPrintSpecArray:menu on:spec indent:5. |
|
2137 |
spec := spec contents. |
|
2138 |
||
2139 |
"/ if that method already exists, do not overwrite the category |
|
2140 |
||
576 | 2141 |
category := 'menu specs'. |
199 | 2142 |
(mthd := cls class compiledMethodAt:selector) notNil ifTrue:[ |
2143 |
category := mthd category. |
|
2144 |
]. |
|
2145 |
||
2146 |
code := Character excla asString |
|
2147 |
, cls name , ' class methodsFor:' , category storeString |
|
2148 |
, Character excla asString , '\\' |
|
2149 |
||
2150 |
, selector , '\' |
|
2151 |
, ' "this window spec was automatically generated by the ST/X MenuEditor"\\' |
|
2152 |
, ' "do not manually edit this - the builder may not be able to\' |
|
2153 |
, ' handle the specification if its corrupted."\\' |
|
2154 |
, ' "\' |
|
2155 |
, ' MenuEditor new openOnClass:' , cls name , ' andSelector:#' , selector , '\' |
|
2156 |
, ' (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , selector , ')) startUp\' |
|
2157 |
, ' "\'. |
|
2158 |
||
2159 |
code := code |
|
2160 |
, '\' |
|
2161 |
, ' <resource: #menu>\\' |
|
2162 |
, ' ^\' |
|
2163 |
, ' ', spec |
|
2164 |
, '\' |
|
2165 |
, Character excla asString |
|
2166 |
, ' ' |
|
2167 |
, Character excla asString |
|
2168 |
, '\\'. |
|
2169 |
||
2170 |
code := code withCRs. |
|
2171 |
(ReadStream on:code) fileIn. |
|
2172 |
||
455 | 2173 |
self isStandAlone ifTrue:[ |
2174 |
self helpTool installHelpSpecInto:(self specClass) |
|
2175 |
]. |
|
356 | 2176 |
didInstall := true. |
2177 |
isModified := false. |
|
218 | 2178 |
|
199 | 2179 |
! |
2180 |
||
2181 |
doNew |
|
398 | 2182 |
|
407 | 2183 |
self buildFrom:nil andSelector: self treeView selectorName |
199 | 2184 |
! |
2185 |
||
2186 |
doPickAMenu |
|
2187 |
||
228 | 2188 |
|view| |
199 | 2189 |
|
218 | 2190 |
view := Screen current viewFromUser. |
199 | 2191 |
|
218 | 2192 |
(view isNil or:[view == Screen current rootView]) ifTrue:[ |
199 | 2193 |
^ self |
2194 |
]. |
|
228 | 2195 |
view specClass == MenuPanelSpec ifTrue:[ |
407 | 2196 |
^ self treeView buildFromMenu: view asMenu |
218 | 2197 |
]. |
228 | 2198 |
^ nil |
218 | 2199 |
! |
199 | 2200 |
|
218 | 2201 |
doStepDown |
407 | 2202 |
"shift selected menu item one step down" |
2203 |
||
2204 |
self treeView selectedNodeChangeSequenceOrder:1. |
|
398 | 2205 |
isModified := true. |
2206 |
||
2207 |
||
2208 |
||
2209 |
||
218 | 2210 |
! |
2211 |
||
2212 |
doStepIn |
|
407 | 2213 |
"move selected menu item into next submenu" |
2214 |
||
2215 |
self treeView selectedNodeBecomeChildOfNext. |
|
398 | 2216 |
isModified := true. |
2217 |
||
2218 |
||
2219 |
||
2220 |
||
199 | 2221 |
|
218 | 2222 |
! |
199 | 2223 |
|
218 | 2224 |
doStepOut |
407 | 2225 |
"move selected menu item out from parent submenu" |
2226 |
||
2227 |
self treeView selectedNodeBecomeSisterOfParent. |
|
398 | 2228 |
isModified := true. |
218 | 2229 |
! |
2230 |
||
2231 |
doStepUp |
|
407 | 2232 |
"shift selected menu item one step up" |
2233 |
||
2234 |
self treeView selectedNodeChangeSequenceOrder:-1. |
|
398 | 2235 |
isModified := true. |
199 | 2236 |
! ! |
2237 |
||
218 | 2238 |
!MenuEditor::Item class methodsFor:'constants'! |
2239 |
||
2240 |
separatorList |
|
407 | 2241 |
|
2242 |
^#('blank' 'single line' 'double line') |
|
218 | 2243 |
! |
2244 |
||
2245 |
separatorSlices |
|
2246 |
^ #( |
|
2247 |
( #blank '' ) |
|
2248 |
( #single '-' ) |
|
2249 |
( #double '=' ) |
|
2250 |
) |
|
2251 |
! ! |
|
2252 |
||
199 | 2253 |
!MenuEditor::Item class methodsFor:'documentation'! |
2254 |
||
2255 |
documentation |
|
2256 |
" |
|
213 | 2257 |
implements the contents assigned to a TreeItem. An instance |
199 | 2258 |
is associated with one item and keeps all its information |
2259 |
||
2260 |
[see also:] |
|
213 | 2261 |
TreeItem |
199 | 2262 |
MenuEditor |
2263 |
||
2264 |
[author:] |
|
2265 |
Claus Atzkern |
|
2266 |
" |
|
2267 |
||
2268 |
||
2269 |
! ! |
|
2270 |
||
2271 |
!MenuEditor::Item methodsFor:'accessing'! |
|
2272 |
||
287 | 2273 |
activeHelpKey |
407 | 2274 |
|
2275 |
^activeHelpKey |
|
287 | 2276 |
! |
2277 |
||
2278 |
activeHelpKey:aKey |
|
407 | 2279 |
|
287 | 2280 |
activeHelpKey := aKey |
2281 |
! |
|
2282 |
||
199 | 2283 |
label |
2284 |
"return the value of the instance variable 'label' (automatically generated)" |
|
2285 |
||
407 | 2286 |
^label |
2287 |
! |
|
199 | 2288 |
|
2289 |
label:something |
|
2290 |
"set the value of the instance variable 'label' (automatically generated)" |
|
2291 |
||
407 | 2292 |
label := something ? '-' |
218 | 2293 |
! |
2294 |
||
2295 |
separatorType |
|
407 | 2296 |
"returns separator type assigned to item or nil" |
2297 |
||
2298 |
label size > 1 |
|
2299 |
ifFalse: |
|
2300 |
[ |
|
2301 |
label size == 0 ifTrue:[^#blank]. |
|
2302 |
label first == $- ifTrue:[^#single]. |
|
2303 |
label first == $= ifTrue:[^#double]. |
|
218 | 2304 |
]. |
407 | 2305 |
^nil |
218 | 2306 |
|
2307 |
! |
|
2308 |
||
2309 |
submenuChannel |
|
2310 |
"return the value of the instance variable 'submenuChannel' (automatically generated)" |
|
2311 |
||
407 | 2312 |
^submenuChannel |
218 | 2313 |
! |
2314 |
||
2315 |
submenuChannel:aChannel |
|
2316 |
"return the value of the instance variable 'submenuChannel' (automatically generated)" |
|
2317 |
||
2318 |
submenuChannel := aChannel |
|
2319 |
! ! |
|
199 | 2320 |
|
2321 |
!MenuEditor::Item methodsFor:'conversion'! |
|
2322 |
||
2323 |
asMenuItem |
|
407 | 2324 |
"converts self to a menu item" |
2325 |
||
199 | 2326 |
|item rcv| |
2327 |
||
218 | 2328 |
item := MenuItem labeled:label. |
606 | 2329 |
item isVisible:isVisible. |
199 | 2330 |
|
398 | 2331 |
self isSeparator ifFalse:[ |
199 | 2332 |
item activeHelpKey:activeHelpKey. |
2333 |
item enabled:enabled. |
|
407 | 2334 |
item accessCharacterPosition:accessCharacterPos. |
290 | 2335 |
item argument:argument. |
218 | 2336 |
item submenuChannel:submenuChannel. |
199 | 2337 |
item nameKey:nameKey. |
2338 |
item shortcutKeyCharacter:shortcutKey. |
|
532 | 2339 |
item startGroup:startGroup. |
199 | 2340 |
item value:value. |
2341 |
item indication:indication. |
|
398 | 2342 |
item translateLabel: translateLabel. |
2343 |
item isButton: isButton. |
|
199 | 2344 |
|
2345 |
icon notNil ifTrue:[ |
|
2346 |
rcv := ResourceRetriever new. |
|
2347 |
rcv className:retriever. |
|
2348 |
rcv selector:icon. |
|
2349 |
iconAndLabel == true ifTrue:[ |
|
2350 |
rcv labelText:label |
|
2351 |
]. |
|
2352 |
item labelImage:rcv |
|
2353 |
] |
|
2354 |
]. |
|
407 | 2355 |
^item |
199 | 2356 |
! |
2357 |
||
2358 |
buildFromAspects:aspects |
|
407 | 2359 |
|
249 | 2360 |
|name| |
407 | 2361 |
self isSeparator |
2362 |
ifFalse: |
|
2363 |
[ |
|
199 | 2364 |
name := label. |
2365 |
label := (aspects at:#label) value. |
|
2366 |
||
218 | 2367 |
(label isNil or:[self isSeparator]) ifTrue:[ |
199 | 2368 |
(aspects at:#label) value:(label := name) |
2369 |
]. |
|
2370 |
||
407 | 2371 |
enabled := (aspects at:#enabled) value. |
2372 |
value := (aspects at:#value) value. |
|
2373 |
nameKey := (aspects at:#nameKey) value. |
|
2374 |
indication := (aspects at:#indication) value. |
|
2375 |
shortcutKey := (aspects at:#shortcutKey) value. |
|
532 | 2376 |
startGroup := (aspects at:#startGroup) value. |
407 | 2377 |
accessCharacterPos := (aspects at:#accessCharacterPos) value. |
2378 |
argument := (aspects at:#argument) value. |
|
2379 |
translateLabel := (aspects at:#translateLabel) value. |
|
2380 |
isButton := (aspects at:#isButton) value. |
|
298 | 2381 |
|
2382 |
argument isString ifTrue:[ |
|
2383 |
argument size > 1 ifTrue:[ |
|
2384 |
(argument at:1) == $# ifTrue:[ |
|
2385 |
argument := (argument copyFrom:2) asSymbol |
|
2386 |
] |
|
2387 |
] |
|
2388 |
]. |
|
407 | 2389 |
submenuChannel := (aspects at:#submenuChannel) value. |
2390 |
retriever := (aspects at:#retriever) value. |
|
2391 |
icon := (aspects at:#icon) value. |
|
2392 |
iconAndLabel := (aspects at:#iconAndLabel) value. |
|
2393 |
] |
|
2394 |
ifTrue: |
|
2395 |
[ |
|
218 | 2396 |
name := (aspects at:#seperatorSelection) selectionIndex. |
2397 |
label := (self class separatorSlices at:name) last. |
|
606 | 2398 |
]. |
2399 |
isVisible := (aspects at:#isVisible) value. |
|
2400 |
||
199 | 2401 |
! |
2402 |
||
2403 |
buildFromMenuItem:anItem |
|
407 | 2404 |
|
199 | 2405 |
|rtv| |
2406 |
||
218 | 2407 |
self label:(anItem label). |
2408 |
activeHelpKey := anItem activeHelpKey. |
|
199 | 2409 |
|
2410 |
(enabled := anItem enabled) isSymbol ifFalse:[ |
|
2411 |
enabled := nil |
|
2412 |
]. |
|
2413 |
||
2414 |
(value := anItem value) isSymbol ifFalse:[ |
|
2415 |
value := nil. |
|
2416 |
]. |
|
2417 |
||
2418 |
(indication := anItem indication) isSymbol ifFalse:[ |
|
2419 |
indication := nil |
|
2420 |
]. |
|
2421 |
||
407 | 2422 |
nameKey := anItem nameKey. |
2423 |
shortcutKey := anItem shortcutKeyCharacter. |
|
532 | 2424 |
startGroup := anItem startGroup. |
407 | 2425 |
accessCharacterPos := anItem accessCharacterPosition. |
2426 |
argument := anItem argument. |
|
537 | 2427 |
|
407 | 2428 |
submenuChannel := anItem submenuChannel. |
2429 |
translateLabel := anItem translateLabel. |
|
2430 |
isButton := anItem isButton. |
|
539 | 2431 |
isVisible := anItem isVisible. |
407 | 2432 |
|
2433 |
(((rtv := anItem adornment) notNil) |
|
2434 |
and:[(rtv := rtv labelImage) isKindOf:ResourceRetriever]) |
|
2435 |
ifTrue: |
|
2436 |
[ |
|
199 | 2437 |
retriever := rtv className. |
2438 |
icon := rtv selector. |
|
2439 |
(iconAndLabel := rtv labelText notNil) ifTrue:[ |
|
2440 |
label := rtv labelText. |
|
2441 |
] |
|
2442 |
] |
|
2443 |
! |
|
2444 |
||
2445 |
toAspects:aspects |
|
407 | 2446 |
|
249 | 2447 |
|type| |
407 | 2448 |
(type := self separatorType) notNil |
2449 |
ifTrue: |
|
2450 |
[ |
|
218 | 2451 |
type := self class separatorSlices findFirst:[:el| el first == type ]. |
2452 |
(aspects at:#seperatorSelection) selectionIndex:type. |
|
407 | 2453 |
] |
2454 |
ifFalse: |
|
2455 |
[ |
|
2456 |
(aspects at:#label) value:label. |
|
2457 |
(aspects at:#enabled) value:enabled. |
|
2458 |
(aspects at:#value) value:value. |
|
2459 |
(aspects at:#nameKey) value:nameKey. |
|
2460 |
(aspects at:#indication) value:indication. |
|
2461 |
(aspects at:#shortcutKey) value:shortcutKey. |
|
532 | 2462 |
(aspects at:#startGroup) value:startGroup. |
407 | 2463 |
(aspects at:#accessCharacterPos) value:accessCharacterPos. |
2464 |
(aspects at:#translateLabel) value:translateLabel. |
|
2465 |
(aspects at:#submenuChannel) value:submenuChannel. |
|
2466 |
(aspects at:#retriever) value:retriever. |
|
2467 |
(aspects at:#icon) value:icon. |
|
2468 |
(aspects at:#iconAndLabel) value:iconAndLabel. |
|
539 | 2469 |
(aspects at:#isButton) value:isButton. |
537 | 2470 |
|
407 | 2471 |
argument isSymbol |
2472 |
ifTrue: [(aspects at:#argument)value:'#', argument] |
|
2473 |
ifFalse:[(aspects at:#argument)value:argument]. |
|
606 | 2474 |
]. |
2475 |
(aspects at:#isVisible) value:isVisible. |
|
2476 |
||
199 | 2477 |
! ! |
2478 |
||
2479 |
!MenuEditor::Item methodsFor:'queries'! |
|
2480 |
||
218 | 2481 |
isSeparator |
407 | 2482 |
"returns true if item is a seperator" |
2483 |
||
2484 |
^self separatorType notNil |
|
199 | 2485 |
! ! |
2486 |
||
407 | 2487 |
!MenuEditor::TreeView class methodsFor:'defaults'! |
199 | 2488 |
|
2489 |
defaultMenuMessage |
|
407 | 2490 |
"this message is the default yo be sent to the menuHolder to get a menu" |
2491 |
||
2492 |
^#menu |
|
199 | 2493 |
|
2494 |
||
2495 |
! ! |
|
2496 |
||
407 | 2497 |
!MenuEditor::TreeView class methodsFor:'documentation'! |
199 | 2498 |
|
2499 |
documentation |
|
2500 |
" |
|
2501 |
menu selection list |
|
2502 |
||
2503 |
[see also:] |
|
2504 |
SelectionInTreeView |
|
213 | 2505 |
SelectionInTree |
2506 |
TreeItem |
|
199 | 2507 |
|
2508 |
[author:] |
|
2509 |
Claus Atzkern |
|
2510 |
" |
|
2511 |
||
2512 |
||
2513 |
! ! |
|
2514 |
||
407 | 2515 |
!MenuEditor::TreeView class methodsFor:'initialization'! |
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
2516 |
|
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
2517 |
initialize |
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
2518 |
|
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
2519 |
super initialize. |
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
2520 |
|
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
2521 |
Images := nil |
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
2522 |
! ! |
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
2523 |
|
407 | 2524 |
!MenuEditor::TreeView class methodsFor:'resources'! |
398 | 2525 |
|
2526 |
images |
|
2527 |
"returns an IdentityDictionary containing a list of images and keys used |
|
2528 |
" |
|
2529 |
^ Images ? |
|
2530 |
(Images := IdentityDictionary new |
|
407 | 2531 |
at: #menuItemImage put: MenuEditor menuItemImage; |
2532 |
at: #menuSeparatorImage put: MenuEditor menuSeparatorImage; |
|
2533 |
at: #submenuImage put: MenuEditor submenuImage; |
|
2534 |
at: #linkSubmenuImage put: MenuEditor linkSubmenuImage; |
|
398 | 2535 |
yourself) |
2536 |
||
2537 |
||
2538 |
||
407 | 2539 |
! ! |
2540 |
||
2541 |
!MenuEditor::TreeView methodsFor:'accessing'! |
|
199 | 2542 |
|
2543 |
selectorName |
|
2544 |
^ (listOfNodes first contents label) asSymbol |
|
2545 |
! ! |
|
2546 |
||
407 | 2547 |
!MenuEditor::TreeView methodsFor:'building'! |
199 | 2548 |
|
2549 |
buildFrom:aClass andSelector:aSelector |
|
407 | 2550 |
|
199 | 2551 |
|spec cls menu node| |
2552 |
||
2553 |
(aClass notNil and:[aSelector notNil]) ifTrue:[ |
|
340 | 2554 |
cls := self application resolveName:aClass. |
199 | 2555 |
|
2556 |
(cls respondsTo:aSelector) ifTrue:[ |
|
2557 |
spec := cls perform:aSelector |
|
2558 |
] |
|
2559 |
]. |
|
331 | 2560 |
|
199 | 2561 |
spec isNil ifFalse:[ |
298 | 2562 |
(spec isMemberOf:Menu) ifFalse:[ |
2563 |
menu := Menu new fromLiteralArrayEncoding:spec. |
|
2564 |
] ifTrue:[ |
|
2565 |
menu := spec. |
|
2566 |
]. |
|
213 | 2567 |
node := self nodeLabel:(aSelector asString). |
199 | 2568 |
self subMenu:menu parent:node. |
2569 |
] ifTrue:[ |
|
2570 |
aSelector notNil ifTrue:[cls := aSelector asString] |
|
2571 |
ifFalse:[cls := 'menu']. |
|
2572 |
||
213 | 2573 |
node := self nodeLabel:cls. |
199 | 2574 |
]. |
2575 |
||
2576 |
node hasChildren ifFalse:[ |
|
557 | 2577 |
node add:(self nodeLabel:'Item 1') |
199 | 2578 |
]. |
213 | 2579 |
node expand. |
199 | 2580 |
model root:node. |
2581 |
||
2582 |
! |
|
2583 |
||
2584 |
buildFromMenu:aMenu |
|
2585 |
||
249 | 2586 |
|node| |
199 | 2587 |
|
213 | 2588 |
node := self nodeLabel:'menu'. |
199 | 2589 |
self subMenu:aMenu parent:node. |
2590 |
||
2591 |
node hasChildren ifFalse:[ |
|
557 | 2592 |
node add:(self nodeLabel:'Item') |
199 | 2593 |
]. |
213 | 2594 |
node expand. |
199 | 2595 |
model root:node. |
2596 |
||
2597 |
! |
|
2598 |
||
213 | 2599 |
menuItem:anItem |
199 | 2600 |
|
249 | 2601 |
|node| |
199 | 2602 |
|
407 | 2603 |
node := self nodeLabel: anItem label. |
199 | 2604 |
node contents buildFromMenuItem:anItem. |
407 | 2605 |
node name: node contents label. |
2606 |
self subMenu: anItem submenu parent:node. |
|
2607 |
^node. |
|
199 | 2608 |
|
2609 |
||
2610 |
! |
|
2611 |
||
2612 |
subMenu:aMenu parent:aParent |
|
407 | 2613 |
|
213 | 2614 |
|idx grp| |
199 | 2615 |
|
2616 |
aMenu isNil ifFalse:[ |
|
2617 |
grp := aMenu groupSizes. |
|
213 | 2618 |
aMenu itemsDo:[:i| aParent add:(self menuItem:i)]. |
199 | 2619 |
|
2620 |
grp notNil ifTrue:[ |
|
213 | 2621 |
idx := 0. |
199 | 2622 |
|
2623 |
grp do:[:i| |
|
213 | 2624 |
idx := idx + i + 1. |
2625 |
aParent add:(self nodeLabel:nil) beforeIndex:idx. |
|
199 | 2626 |
] |
2627 |
] |
|
2628 |
] |
|
2629 |
! ! |
|
2630 |
||
407 | 2631 |
!MenuEditor::TreeView methodsFor:'conversion'! |
199 | 2632 |
|
2633 |
asMenu |
|
2634 |
|menu root| |
|
2635 |
||
2636 |
root := self root. |
|
2637 |
||
2638 |
root hasChildren ifTrue:[ |
|
2639 |
menu := Menu new. |
|
2640 |
root children do:[:aChild| menu addItem:(self asMenuItem:aChild)]. |
|
2641 |
]. |
|
2642 |
^ menu |
|
2643 |
! |
|
2644 |
||
2645 |
asMenuItem:aNode |
|
2646 |
||
2647 |
|menu item| |
|
2648 |
||
2649 |
item := aNode contents asMenuItem. |
|
2650 |
||
2651 |
aNode hasChildren ifTrue:[ |
|
2652 |
menu := Menu new. |
|
2653 |
aNode children do:[:aChild| menu addItem:(self asMenuItem:aChild)]. |
|
2654 |
item submenu:menu |
|
2655 |
]. |
|
2656 |
^ item |
|
2657 |
||
2658 |
! ! |
|
2659 |
||
407 | 2660 |
!MenuEditor::TreeView methodsFor:'drawing basics'! |
199 | 2661 |
|
2662 |
drawLabelIndex:anIndex atX:x y:yCenter |
|
407 | 2663 |
"draw text label assigned to a node at x y( center)" |
2664 |
||
258 | 2665 |
|y x2 type item| |
199 | 2666 |
|
2667 |
item := (listOfNodes at:anIndex) contents. |
|
218 | 2668 |
type := item separatorType. |
199 | 2669 |
|
218 | 2670 |
type isNil ifTrue:[ |
2671 |
super drawLabelIndex:anIndex atX:x y:yCenter |
|
2672 |
] ifFalse:[ |
|
2673 |
type == #blank ifFalse:[ |
|
258 | 2674 |
x2 := x + 80. |
2675 |
||
2676 |
self displayLineFromX:x y:yCenter toX:x2 y:yCenter. |
|
218 | 2677 |
|
2678 |
type == #double ifTrue:[ |
|
258 | 2679 |
y := yCenter + 2. |
2680 |
self displayLineFromX:x y:y toX:x2 y:y. |
|
218 | 2681 |
] |
2682 |
] |
|
2683 |
] |
|
2684 |
! |
|
2685 |
||
2686 |
figureFor:aNode |
|
407 | 2687 |
"access figure for a node" |
2688 |
||
2689 |
aNode hasChildren |
|
2690 |
ifFalse: |
|
2691 |
[ |
|
2692 |
|item| |
|
2693 |
(item := aNode contents) submenuChannel notNil ifTrue:[^images at: #linkSubmenuImage]. |
|
2694 |
item isSeparator ifTrue:[^images at: #menuSeparatorImage]. |
|
2695 |
^images at: #menuItemImage |
|
199 | 2696 |
]. |
407 | 2697 |
^images at: #submenuImage |
199 | 2698 |
! ! |
2699 |
||
407 | 2700 |
!MenuEditor::TreeView methodsFor:'event handling'! |
356 | 2701 |
|
2702 |
keyPress:key x:x y:y |
|
407 | 2703 |
"invoked if any key was pressed" |
2704 |
||
412 | 2705 |
<resource: #keyboard (#Delete #BackSpace #Cut #Copy #Paste)> |
2706 |
||
2707 |
(key == #Cut or:[key == #Delete or:[key == #BackSpace]]) ifTrue: [^self doCut]. |
|
356 | 2708 |
|
407 | 2709 |
key == #Copy ifTrue:[^self doCopy]. |
2710 |
key == #Paste ifTrue:[^self doPaste]. |
|
356 | 2711 |
|
412 | 2712 |
super keyPress:key x:x y:y |
356 | 2713 |
|
2714 |
! ! |
|
2715 |
||
407 | 2716 |
!MenuEditor::TreeView methodsFor:'initialization'! |
199 | 2717 |
|
275 | 2718 |
fetchImageResources |
2719 |
"initialize heavily used device resources - to avoid rendering |
|
407 | 2720 |
images again and again later; returns maximum extent of the images used." |
2721 |
||
2722 |
|defaultExtent imageWidth imageHeight maxWidth maxHeight| |
|
2723 |
||
2724 |
defaultExtent := super fetchImageResources. |
|
2725 |
maxHeight := defaultExtent y. |
|
2726 |
maxWidth := defaultExtent x. |
|
2727 |
||
2728 |
images do: |
|
2729 |
[:anIcon| |
|
2730 |
(imageWidth := anIcon widthOn:self) > maxWidth ifTrue:[maxWidth := imageWidth]. |
|
2731 |
(imageHeight := anIcon heightOn:self) > maxHeight ifTrue:[maxHeight := imageHeight]. |
|
275 | 2732 |
]. |
407 | 2733 |
^maxWidth@maxHeight |
275 | 2734 |
|
2735 |
! |
|
2736 |
||
199 | 2737 |
initialize |
407 | 2738 |
|
199 | 2739 |
super initialize. |
275 | 2740 |
|
2741 |
images := IdentityDictionary new. |
|
2742 |
||
407 | 2743 |
self class images associationsDo:[:imageAsso|images at: imageAsso key put:(imageAsso value onDevice:device)]. |
213 | 2744 |
self multipleSelectOk:true. |
407 | 2745 |
self showDirectoryIndicator: true. |
2746 |
self showDirectoryIndicatorForRoot: false. |
|
411 | 2747 |
self selectConditionBlock: [:i|self application checkMenuItemModified]. |
412 | 2748 |
self validateDoubleClickBlock: [:node| node ~~ listOfNodes first]. |
199 | 2749 |
! ! |
2750 |
||
407 | 2751 |
!MenuEditor::TreeView methodsFor:'menus'! |
199 | 2752 |
|
2753 |
doCopy |
|
398 | 2754 |
|
213 | 2755 |
self hasSelection ifTrue:[ |
2756 |
CopyBuffer := OrderedCollection new. |
|
2757 |
self selectionDo:[:i| CopyBuffer add:((listOfNodes at:i) copy)] |
|
2758 |
] |
|
199 | 2759 |
! |
2760 |
||
2761 |
doCreateItem |
|
398 | 2762 |
|
557 | 2763 |
self addElement: (self nodeLabel:'Item') |
199 | 2764 |
! |
2765 |
||
218 | 2766 |
doCreateLink |
407 | 2767 |
|
218 | 2768 |
|node item| |
2769 |
||
557 | 2770 |
node := self nodeLabel:'Submenu Link'. |
218 | 2771 |
item := node contents. |
2772 |
item submenuChannel:#menuDefaultLink. |
|
398 | 2773 |
self addElement:node. |
2774 |
self setModified. |
|
218 | 2775 |
|
2776 |
||
2777 |
! |
|
2778 |
||
199 | 2779 |
doCreateMenu |
398 | 2780 |
|
199 | 2781 |
|node| |
557 | 2782 |
node := self nodeLabel:'Submenu'. |
2783 |
node add:(self nodeLabel:'Item 1'). |
|
213 | 2784 |
self addElement:node |
199 | 2785 |
! |
2786 |
||
2787 |
doCreateSep |
|
398 | 2788 |
|
213 | 2789 |
self addElement:(self nodeLabel:nil) |
199 | 2790 |
! |
2791 |
||
2792 |
doCut |
|
398 | 2793 |
|
603 | 2794 |
self checkMenuItemModified |
2795 |
ifTrue: |
|
2796 |
[ |
|
2797 |
|selectedNodes| |
|
2798 |
self doCopy. |
|
2799 |
selectedNodes := self selection asSortedCollection. |
|
2800 |
self selectedNodesRemove. |
|
2801 |
self selection: selectedNodes first - 1. |
|
2802 |
self setModified. |
|
2803 |
] |
|
398 | 2804 |
|
199 | 2805 |
! |
2806 |
||
2807 |
doPaste |
|
213 | 2808 |
|
2809 |
(CopyBuffer notNil and:[self selectedNode notNil]) ifTrue:[ |
|
2810 |
self addElement:(CopyBuffer collect:[:el| el copy]) |
|
220 | 2811 |
]. |
199 | 2812 |
! ! |
2813 |
||
407 | 2814 |
!MenuEditor::TreeView methodsFor:'private'! |
199 | 2815 |
|
557 | 2816 |
addElement: aNode |
407 | 2817 |
"add something after selection" |
2818 |
||
603 | 2819 |
self checkMenuItemModified |
2820 |
ifTrue: |
|
557 | 2821 |
[ |
603 | 2822 |
(aNode isCollection not and: [aNode name = 'Item']) |
2823 |
ifTrue: |
|
2824 |
[ |
|
2825 |
|label| |
|
2826 |
label := aNode name, ' ', |
|
2827 |
(self selectedNode parent notNil ifTrue: |
|
2828 |
[(((self selectedNode children size = 0 ifTrue: [self selectedNode parent children] ifFalse: [self selectedNode children]) select: [:node| |
|
2829 |
|lab| lab := node contents label. ((node children size = 0) & node contents submenuChannel isNil & (lab ~= '-') & (lab ~= '=') & (lab ~= ''))]) size + 1) printString] ifFalse: ['1']). |
|
2830 |
aNode name: label. |
|
2831 |
aNode contents label: label. |
|
2832 |
]. |
|
2833 |
self selectedNodeAdd: aNode. |
|
2834 |
aNode isCollection ifFalse: [self selectNode: aNode] ifTrue: [self selection: (aNode collect: [:node| self indexOfNode: node])]. |
|
2835 |
self setModified. |
|
2836 |
] |
|
2837 |
! |
|
2838 |
||
2839 |
checkMenuItemModified |
|
2840 |
||
2841 |
^self topView application checkMenuItemModified |
|
199 | 2842 |
! |
2843 |
||
213 | 2844 |
nodeLabel:aLabel |
407 | 2845 |
|
2846 |
^TreeItem name:aLabel contents: (MenuEditor::Item new label:aLabel) |
|
398 | 2847 |
! |
2848 |
||
557 | 2849 |
selectedNodeAdd:something |
2850 |
||
2851 |
|node| |
|
2852 |
||
2853 |
something notNil ifTrue:[ |
|
2854 |
(node := self selectedNode) notNil ifTrue:[ |
|
2855 |
node parent notNil ifTrue:[ |
|
2856 |
node isCollapsable ifTrue:[ |
|
2857 |
model add:something afterIndex:node children size below:node |
|
2858 |
] ifFalse:[ |
|
2859 |
model add:something after:node |
|
2860 |
] |
|
2861 |
] ifFalse:[ |
|
2862 |
model add:something afterIndex:node children size below:(self root) |
|
2863 |
] |
|
2864 |
] |
|
2865 |
] |
|
2866 |
||
2867 |
||
2868 |
! |
|
2869 |
||
398 | 2870 |
setModified |
2871 |
||
508 | 2872 |
self topView application isModified: true. |
2873 |
||
2874 |
self topView application updateEnabledChannels |
|
199 | 2875 |
! ! |
2876 |
||
407 | 2877 |
!MenuEditor::TreeView methodsFor:'selection'! |
2878 |
||
2879 |
updateNode: aNode |
|
2880 |
||
2881 |
|name treeItem index| |
|
2882 |
||
2883 |
name := aNode label. |
|
2884 |
treeItem := listOfNodes detect: [:n| n contents = aNode] ifNone: [1]. |
|
2885 |
index := self indexOfNode: treeItem. |
|
2886 |
treeItem name: name. |
|
2887 |
self redrawLine: index. |
|
199 | 2888 |
! ! |
2889 |
||
441 | 2890 |
!MenuEditor::TreeView methodsFor:'startup / release'! |
2891 |
||
2892 |
destroy |
|
2893 |
"destroy images" |
|
2894 |
||
2895 |
super destroy. |
|
2896 |
||
2897 |
Images := nil |
|
2898 |
||
2899 |
||
2900 |
! ! |
|
2901 |
||
199 | 2902 |
!MenuEditor class methodsFor:'documentation'! |
2903 |
||
2904 |
version |
|
2905 |
^ '$Header$' |
|
2906 |
! ! |
|
406
a519e0d547f6
widgets rearranged for different fonts + comfortable menu load support
tz
parents:
398
diff
changeset
|
2907 |
MenuEditor initialize! |