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