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