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