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