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