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