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