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