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