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