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