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