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