author | Claus Gittinger <cg@exept.de> |
Mon, 07 Feb 2000 12:52:27 +0100 | |
changeset 1333 | d4012bd05057 |
parent 1330 | 45983bc2efe1 |
child 1335 | b80f8c8ec3d6 |
permissions | -rw-r--r-- |
199 | 1 |
" |
738 | 2 |
COPYRIGHT (c) 1997 by eXept Software AG |
199 | 3 |
All Rights Reserved |
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
738 | 7 |
inclusion of the above copyright notice. This software may not |
199 | 8 |
be provided or otherwise made available to, or used by, any |
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
14 |
||
738 | 15 |
ResourceSpecEditor subclass:#MenuEditor |
1244 | 16 |
instanceVariableNames:'treeView typeOfCanvas listOfCanvas listOfSlices |
17 |
lastImageRetriever slices' |
|
220 | 18 |
classVariableNames:'' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-UIPainter' |
|
199 | 21 |
! |
22 |
||
1330 | 23 |
SelectionInTreeView subclass:#TreeView |
24 |
instanceVariableNames:'' |
|
25 |
classVariableNames:'' |
|
26 |
poolDictionaries:'' |
|
27 |
privateIn:MenuEditor |
|
28 |
! |
|
29 |
||
199 | 30 |
Object subclass:#Item |
220 | 31 |
instanceVariableNames:'activeHelpKey enabled label value nameKey indication shortcutKey |
407 | 32 |
accessCharacterPos retriever icon iconAndLabel submenuChannel |
953
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
33 |
startGroup argument translateLabel isButton isVisible choice |
1321 | 34 |
choiceValue auxValue hideMenuOnActivated' |
220 | 35 |
classVariableNames:'' |
36 |
poolDictionaries:'' |
|
37 |
privateIn:MenuEditor |
|
199 | 38 |
! |
39 |
||
40 |
!MenuEditor class methodsFor:'documentation'! |
|
41 |
||
42 |
copyright |
|
43 |
" |
|
738 | 44 |
COPYRIGHT (c) 1997 by eXept Software AG |
199 | 45 |
All Rights Reserved |
46 |
||
47 |
This software is furnished under a license and may be used |
|
48 |
only in accordance with the terms of that license and with the |
|
738 | 49 |
inclusion of the above copyright notice. This software may not |
199 | 50 |
be provided or otherwise made available to, or used by, any |
51 |
other person. No title to or ownership of the software is |
|
52 |
hereby transferred. |
|
53 |
" |
|
54 |
||
55 |
||
56 |
! |
|
57 |
||
58 |
documentation |
|
59 |
" |
|
728 | 60 |
The MenuEditor allows you to create, modify or just inspect |
61 |
hierarchical menus of menu bars, popup menu, or tool bar menus. |
|
199 | 62 |
|
63 |
[start with:] |
|
64 |
MenuEditor open |
|
728 | 65 |
MenuEditor openOnClass:MenuEditor andSelector:#menu |
199 | 66 |
|
67 |
[see also:] |
|
68 |
UIPainter |
|
69 |
||
70 |
[author:] |
|
541 | 71 |
Claus Atzkern, eXept Software AG |
72 |
Thomas Zwick, eXept Software AG |
|
199 | 73 |
" |
74 |
||
75 |
! ! |
|
76 |
||
508 | 77 |
!MenuEditor class methodsFor:'instance creation'! |
78 |
||
728 | 79 |
openModalOnMenu: aMenu |
80 |
"Open a MenuEditor modal on aMenu" |
|
81 |
"self openModalOnMenu: (self perform: #menu) decodeAsLiteralArray" |
|
82 |
||
83 |
^self new openModalOnMenu: aMenu |
|
508 | 84 |
! ! |
85 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
86 |
!MenuEditor class methodsFor:'accessing'! |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
87 |
|
734 | 88 |
iconUnknown |
89 |
"returns an image used for picked items containing an image |
|
90 |
" |
|
91 |
||
92 |
<resource: #fileImage> |
|
93 |
||
804 | 94 |
"/ ^ Image fromFile:'brokenImage.xpm' |
95 |
^ Icon constantNamed:'brokenImage.xpm' |
|
96 |
||
97 |
"Modified: / 22.4.1998 / 22:15:11 / ca" |
|
734 | 98 |
! |
99 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
100 |
resourceType |
728 | 101 |
"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
|
102 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
103 |
^#menu |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
104 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
105 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
106 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
107 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
108 |
! ! |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
109 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
110 |
!MenuEditor class methodsFor:'aspects'! |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
111 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
112 |
aspects |
728 | 113 |
"get the aspects for the attributes of the menu components" |
114 |
||
115 |
^#( |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
116 |
label |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
117 |
accessCharacterPos |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
118 |
argument |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
119 |
submenuChannel |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
120 |
enabled |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
121 |
value |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
122 |
nameKey |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
123 |
indication |
953
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
124 |
choice |
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
125 |
choiceValue |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
126 |
translateLabel |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
127 |
isButton |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
128 |
shortcutKey |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
129 |
startGroup |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
130 |
retriever |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
131 |
iconAndLabel |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
132 |
icon |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
133 |
isVisible |
1321 | 134 |
hideMenuOnActivated |
1199 | 135 |
auxValue |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
136 |
) |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
137 |
|
953
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
138 |
"Modified: / 14.8.1998 / 14:46:36 / cg" |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
139 |
! ! |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
140 |
|
1020
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
141 |
!MenuEditor class methodsFor:'defaults'! |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
142 |
|
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
143 |
defaultRetrieverClassList |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
144 |
^ #(Icon NewLauncher BrowserView) |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
145 |
|
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
146 |
|
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
147 |
! ! |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
148 |
|
371 | 149 |
!MenuEditor class methodsFor:'help specs'! |
150 |
||
151 |
helpSpec |
|
738 | 152 |
"This resource specification was automatically generated |
153 |
by the UIHelpTool of ST/X." |
|
154 |
||
155 |
"Do not manually edit this!! If it is corrupted, |
|
156 |
the UIHelpTool may not be able to read the specification." |
|
371 | 157 |
|
158 |
" |
|
738 | 159 |
UIHelpTool openOnClass:MenuEditor |
371 | 160 |
" |
161 |
||
738 | 162 |
<resource: #help> |
163 |
||
164 |
^super helpSpec addPairsFrom:#( |
|
371 | 165 |
|
548 | 166 |
#addMenuItem |
167 |
'Adds a new menu item.' |
|
168 |
||
169 |
#addMenuSeparator |
|
170 |
'Adds a new menu separator.' |
|
171 |
||
172 |
#addSubMenu |
|
613 | 173 |
'Adds a new sub menu.' |
548 | 174 |
|
175 |
#addSubMenuLink |
|
613 | 176 |
'Adds a new linked sub menu.' |
371 | 177 |
|
577 | 178 |
#basicsAction |
627 | 179 |
'An action selector with 0, 1 (the argument field), or 2 (the selected item) arguments.' |
577 | 180 |
|
181 |
#basicsArgument |
|
1330 | 182 |
'An optional arg passed with above selector, if it is a 1 or 2 arg selector (enter a Smalltalk literal).' |
577 | 183 |
|
959 | 184 |
#basicsChoice |
1330 | 185 |
'Aspect for a boolean holder, block or method, specifying the choices state (RadioButton behavior).' |
959 | 186 |
|
187 |
#basicsChoiceValue |
|
188 |
'That choices value (typically number or symbol).' |
|
577 | 189 |
|
1020
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
190 |
#basicsIndication |
1330 | 191 |
'Aspect for boolean holder, block, or method, specifying the indication state (CheckToggle behavior).' |
1020
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
192 |
|
577 | 193 |
#basicsIsButton |
603 | 194 |
'Turns on/off a button behavior.' |
577 | 195 |
|
1020
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
196 |
#basicsKey |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
197 |
'Internal key of the item (optional, for programmed accesses).' |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
198 |
|
577 | 199 |
#basicsLabel |
200 |
'Label of the item.' |
|
201 |
||
202 |
#basicsMenu |
|
1330 | 203 |
'Aspect providing the sub menu to be opened if item is selected (provide spec or valueHolder).' |
577 | 204 |
|
205 |
#basicsMenuArgument |
|
943 | 206 |
'An argument passed with the menu selector.' |
577 | 207 |
|
208 |
#basicsNameKey |
|
209 |
'Unique identifier of the item (optional).' |
|
210 |
||
211 |
#basicsSelector |
|
613 | 212 |
'Selector under which the generated menu spec is saved.' |
577 | 213 |
|
214 |
#basicsSeparatorType |
|
215 |
'List of valid separators.' |
|
216 |
||
217 |
#basicsTranslateLabel |
|
943 | 218 |
'Translate the label via the classes resource file (internationalization).' |
577 | 219 |
|
1020
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
220 |
#browseResource |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
221 |
'Search for methods with image resource.' |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
222 |
|
577 | 223 |
#detailsAccelerator |
224 |
'Key to be pressed to select the menu item from the keyboard (accelerator key).' |
|
225 |
||
226 |
#detailsAccessCharaterPosition |
|
227 |
'Index of the access character position of the textual label (optional).' |
|
228 |
||
1199 | 229 |
#detailsAuxValue |
230 |
'Some additional value - for arbitrary use by the program' |
|
231 |
||
577 | 232 |
#detailsEnabled |
943 | 233 |
'Aspect or binding providing a boolean value holder for the enable-state of the menu item.' |
577 | 234 |
|
959 | 235 |
#detailsStartGroup |
236 |
'Specify start of a right-aligned item group.' |
|
237 |
||
577 | 238 |
#detailsVisibility |
943 | 239 |
'Aspect or binding providing a boolean value holder for the visibility-state of the menu item.' |
577 | 240 |
|
548 | 241 |
#fileLoad |
943 | 242 |
'Opens a dialog to select and load a menu spec from a class.' |
548 | 243 |
|
244 |
#fileNew |
|
245 |
'Creates a new menu spec.' |
|
246 |
||
577 | 247 |
#filePickAMenu |
836 | 248 |
'Select a menu from an open view and read its specification' |
577 | 249 |
|
548 | 250 |
#fileSave |
943 | 251 |
'Saves the menu spec (and the help spec, if modified).' |
455 | 252 |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
253 |
#fileSaveAs |
943 | 254 |
'Opens a dialog to save the menu spec (and the help spec, if modified).' |
255 |
||
1321 | 256 |
#hideMenuOnActivated |
1330 | 257 |
'Hide the menu after activation (turn off for checkToggles or radioButtons)' |
1321 | 258 |
|
577 | 259 |
#imageImageAndLabel |
943 | 260 |
'Toggles display of both image and textual label.' |
577 | 261 |
|
262 |
#imageImageEditor |
|
943 | 263 |
'Opens an Image Editor on the resource method defined by retriever and selector.' |
577 | 264 |
|
1020
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
265 |
#imageImageList |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
266 |
'Currently existing image resources.' |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
267 |
|
577 | 268 |
#imageRetriever |
269 |
'Class implementing the image resource method. If no class is given, the current application class will be taken.' |
|
270 |
||
271 |
#imageSelector |
|
959 | 272 |
'Selector returning an image (sent to above or the application).' |
273 |
||
371 | 274 |
) |
1330 | 275 |
|
276 |
"Modified: / 4.2.2000 / 12:24:53 / cg" |
|
371 | 277 |
! ! |
278 |
||
734 | 279 |
!MenuEditor class methodsFor:'image specs'! |
280 |
||
281 |
linkSubmenuImage |
|
738 | 282 |
"This resource specification was automatically generated |
283 |
by the ImageEditor of ST/X." |
|
284 |
||
285 |
"Do not manually edit this!!!! If it is corrupted, |
|
286 |
the ImageEditor may not be able to read the specification." |
|
287 |
||
734 | 288 |
" |
738 | 289 |
ImageEditor openOnClass:self andSelector:#linkSubmenuImage |
734 | 290 |
" |
291 |
||
292 |
<resource: #image> |
|
293 |
||
294 |
^Icon |
|
295 |
constantNamed:#'MenuEditor linkSubmenuImage' |
|
296 |
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]! |
|
297 |
||
298 |
menuItemImage |
|
738 | 299 |
"This resource specification was automatically generated |
300 |
by the ImageEditor of ST/X." |
|
301 |
||
302 |
"Do not manually edit this!!!! If it is corrupted, |
|
303 |
the ImageEditor may not be able to read the specification." |
|
304 |
||
734 | 305 |
" |
738 | 306 |
ImageEditor openOnClass:self andSelector:#menuItemImage |
734 | 307 |
" |
308 |
||
309 |
<resource: #image> |
|
310 |
||
311 |
^Icon |
|
312 |
constantNamed:#'MenuEditor menuItemImage' |
|
313 |
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]! |
|
314 |
||
315 |
menuSeparatorImage |
|
738 | 316 |
"This resource specification was automatically generated |
317 |
by the ImageEditor of ST/X." |
|
318 |
||
319 |
"Do not manually edit this!!!! If it is corrupted, |
|
320 |
the ImageEditor may not be able to read the specification." |
|
321 |
||
734 | 322 |
" |
738 | 323 |
ImageEditor openOnClass:self andSelector:#menuSeparatorImage |
734 | 324 |
" |
325 |
||
326 |
<resource: #image> |
|
327 |
||
328 |
^Icon |
|
329 |
constantNamed:#'MenuEditor menuSeparatorImage' |
|
330 |
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]! |
|
331 |
||
332 |
submenuImage |
|
738 | 333 |
"This resource specification was automatically generated |
334 |
by the ImageEditor of ST/X." |
|
335 |
||
336 |
"Do not manually edit this!!!! If it is corrupted, |
|
337 |
the ImageEditor may not be able to read the specification." |
|
338 |
||
734 | 339 |
" |
738 | 340 |
ImageEditor openOnClass:self andSelector:#submenuImage |
734 | 341 |
" |
342 |
||
343 |
<resource: #image> |
|
344 |
||
345 |
^Icon |
|
346 |
constantNamed:#'MenuEditor submenuImage' |
|
347 |
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]! ! |
|
348 |
||
199 | 349 |
!MenuEditor class methodsFor:'interface specs'! |
350 |
||
351 |
basicsItemSpec |
|
738 | 352 |
"This resource specification was automatically generated |
353 |
by the UIPainter of ST/X." |
|
354 |
||
355 |
"Do not manually edit this!! If it is corrupted, |
|
356 |
the UIPainter may not be able to read the specification." |
|
199 | 357 |
|
358 |
" |
|
359 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsItemSpec |
|
360 |
MenuEditor new openInterface:#basicsItemSpec |
|
361 |
" |
|
362 |
||
363 |
<resource: #canvas> |
|
364 |
||
1155 | 365 |
^ |
366 |
#(#FullSpec |
|
367 |
#name: #basicsItemSpec |
|
368 |
#window: |
|
369 |
#(#WindowSpec |
|
370 |
#label: 'Basics Item' |
|
371 |
#name: 'Basics Item' |
|
372 |
#min: #(#Point 10 10) |
|
373 |
#max: #(#Point 1160 870) |
|
1321 | 374 |
#bounds: #(#Rectangle 12 22 279 341) |
1155 | 375 |
) |
376 |
#component: |
|
377 |
#(#SpecCollection |
|
378 |
#collection: #( |
|
379 |
#(#LabelSpec |
|
380 |
#label: 'Name Key:' |
|
381 |
#name: 'nameKeyLabel' |
|
382 |
#layout: #(#AlignmentOrigin 107 0 26 0 1 0.5) |
|
383 |
#activeHelpKey: #basicsKey |
|
384 |
#resizeForLabel: true |
|
385 |
#adjust: #right |
|
386 |
) |
|
387 |
#(#InputFieldSpec |
|
1321 | 388 |
#attributes: |
389 |
#(#tabable |
|
390 |
true |
|
391 |
) |
|
1155 | 392 |
#name: 'nameKeyField' |
1244 | 393 |
#layout: #(#LayoutFrame 110 0 16 0 -5 1.0 38 0) |
1155 | 394 |
#activeHelpKey: #basicsKey |
395 |
#tabable: true |
|
396 |
#model: #nameKey |
|
1244 | 397 |
#group: #inputGroup1 |
1155 | 398 |
#type: #symbolOrNil |
399 |
#acceptOnLeave: false |
|
400 |
#acceptOnReturn: true |
|
401 |
#acceptOnTab: true |
|
402 |
#acceptOnLostFocus: false |
|
403 |
#acceptChannel: #acceptChannel |
|
404 |
#modifiedChannel: #modifiedChannel |
|
405 |
#acceptOnPointerLeave: false |
|
406 |
) |
|
407 |
#(#LabelSpec |
|
408 |
#label: 'Label:' |
|
409 |
#name: 'labelLabel' |
|
410 |
#layout: #(#AlignmentOrigin 107 0 51 0 1 0.5) |
|
411 |
#activeHelpKey: #basicsLabel |
|
412 |
#resizeForLabel: true |
|
413 |
#adjust: #right |
|
414 |
) |
|
415 |
#(#InputFieldSpec |
|
1321 | 416 |
#attributes: |
417 |
#(#tabable |
|
418 |
true |
|
419 |
) |
|
1155 | 420 |
#name: 'labelField' |
421 |
#layout: #(#LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
422 |
#activeHelpKey: #basicsLabel |
|
423 |
#tabable: true |
|
424 |
#model: #label |
|
1244 | 425 |
#group: #inputGroup1 |
1155 | 426 |
#acceptOnReturn: true |
427 |
#acceptOnTab: true |
|
428 |
#acceptOnLostFocus: false |
|
429 |
#acceptChannel: #acceptChannel |
|
430 |
#modifiedChannel: #modifiedChannel |
|
431 |
#acceptOnPointerLeave: false |
|
432 |
) |
|
433 |
#(#LabelSpec |
|
434 |
#label: 'Action:' |
|
435 |
#name: 'valueLabel' |
|
436 |
#layout: #(#AlignmentOrigin 107 0 90 0 1 0.5) |
|
437 |
#activeHelpKey: #basicsAction |
|
438 |
#resizeForLabel: true |
|
439 |
#adjust: #right |
|
440 |
) |
|
441 |
#(#InputFieldSpec |
|
1321 | 442 |
#attributes: |
443 |
#(#tabable |
|
444 |
true |
|
445 |
) |
|
1155 | 446 |
#name: 'valueField' |
447 |
#layout: #(#LayoutFrame 110 0 79 0 -5 1.0 101 0) |
|
448 |
#activeHelpKey: #basicsAction |
|
449 |
#tabable: true |
|
450 |
#model: #value |
|
1244 | 451 |
#group: #inputGroup1 |
1155 | 452 |
#type: #symbolOrNil |
453 |
#acceptOnReturn: true |
|
454 |
#acceptOnTab: true |
|
455 |
#acceptOnLostFocus: false |
|
456 |
#acceptChannel: #acceptChannel |
|
457 |
#modifiedChannel: #modifiedChannel |
|
458 |
#acceptOnPointerLeave: false |
|
459 |
) |
|
460 |
#(#LabelSpec |
|
461 |
#label: 'Argument:' |
|
462 |
#name: 'argumentLabel' |
|
463 |
#layout: #(#AlignmentOrigin 107 0 115 0 1 0.5) |
|
464 |
#activeHelpKey: #basicsArgument |
|
465 |
#resizeForLabel: true |
|
466 |
#adjust: #right |
|
467 |
) |
|
468 |
#(#InputFieldSpec |
|
1321 | 469 |
#attributes: |
470 |
#(#tabable |
|
471 |
true |
|
472 |
) |
|
1155 | 473 |
#name: 'argumentField' |
474 |
#layout: #(#LayoutFrame 110 0 104 0 -5 1.0 126 0) |
|
475 |
#activeHelpKey: #basicsArgument |
|
476 |
#tabable: true |
|
477 |
#model: #argument |
|
1244 | 478 |
#group: #inputGroup1 |
1189
0e7e286f864c
code cleanup; care for non-string argument
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
479 |
#type: #smalltalkObject |
1155 | 480 |
#acceptOnReturn: true |
481 |
#acceptOnTab: true |
|
482 |
#acceptOnLostFocus: false |
|
483 |
#acceptChannel: #acceptChannel |
|
484 |
#modifiedChannel: #modifiedChannel |
|
485 |
#acceptOnPointerLeave: false |
|
486 |
) |
|
487 |
#(#LabelSpec |
|
488 |
#label: 'Indication:' |
|
489 |
#name: 'indicationLabel' |
|
490 |
#layout: #(#AlignmentOrigin 107 0 155 0 1 0.5) |
|
491 |
#activeHelpKey: #basicsIndication |
|
492 |
#resizeForLabel: true |
|
493 |
#adjust: #right |
|
494 |
) |
|
495 |
#(#InputFieldSpec |
|
1321 | 496 |
#attributes: |
497 |
#(#tabable |
|
498 |
true |
|
499 |
) |
|
1155 | 500 |
#name: 'indicationField' |
501 |
#layout: #(#LayoutFrame 110 0 144 0 -5 1.0 166 0) |
|
502 |
#activeHelpKey: #basicsIndication |
|
503 |
#enableChannel: #indicationEnabled |
|
504 |
#tabable: true |
|
505 |
#model: #indication |
|
1244 | 506 |
#group: #inputGroup1 |
1155 | 507 |
#type: #symbolOrNil |
508 |
#immediateAccept: true |
|
509 |
#acceptOnReturn: true |
|
510 |
#acceptOnTab: true |
|
511 |
#acceptOnLostFocus: false |
|
512 |
#acceptChannel: #acceptChannel |
|
513 |
#modifiedChannel: #modifiedChannel |
|
514 |
#acceptOnPointerLeave: false |
|
515 |
) |
|
516 |
#(#LabelSpec |
|
517 |
#label: 'Choice:' |
|
518 |
#name: 'choiceLabel' |
|
519 |
#layout: #(#AlignmentOrigin 107 0 180 0 1 0.5) |
|
520 |
#activeHelpKey: #basicsChoice |
|
521 |
#translateLabel: true |
|
522 |
#resizeForLabel: true |
|
523 |
#adjust: #right |
|
524 |
) |
|
525 |
#(#InputFieldSpec |
|
1321 | 526 |
#attributes: |
527 |
#(#tabable |
|
528 |
true |
|
529 |
) |
|
1155 | 530 |
#name: 'choiceField' |
531 |
#layout: #(#LayoutFrame 110 0 169 0 -5 1.0 191 0) |
|
532 |
#activeHelpKey: #basicsChoice |
|
533 |
#enableChannel: #choiceEnabled |
|
534 |
#tabable: true |
|
535 |
#model: #choice |
|
1244 | 536 |
#group: #inputGroup1 |
1155 | 537 |
#type: #symbolOrNil |
538 |
#immediateAccept: true |
|
539 |
#acceptOnReturn: true |
|
540 |
#acceptOnTab: true |
|
541 |
#acceptOnLostFocus: false |
|
542 |
#acceptChannel: #acceptChannel |
|
543 |
#modifiedChannel: #modifiedChannel |
|
544 |
#acceptOnPointerLeave: false |
|
545 |
) |
|
546 |
#(#LabelSpec |
|
547 |
#label: 'Value:' |
|
548 |
#name: 'choiceValueLabel' |
|
549 |
#layout: #(#AlignmentOrigin 107 0 205 0 1 0.5) |
|
550 |
#activeHelpKey: #basicsChoiceValue |
|
551 |
#translateLabel: true |
|
552 |
#resizeForLabel: true |
|
553 |
#adjust: #right |
|
554 |
) |
|
555 |
#(#InputFieldSpec |
|
1321 | 556 |
#attributes: |
557 |
#(#tabable |
|
558 |
true |
|
559 |
) |
|
1155 | 560 |
#name: 'choiceValueField' |
561 |
#layout: #(#LayoutFrame 110 0 194 0 -5 1.0 216 0) |
|
562 |
#activeHelpKey: #basicsChoiceValue |
|
563 |
#enableChannel: #choiceValueEnabled |
|
564 |
#tabable: true |
|
565 |
#model: #choiceValue |
|
1244 | 566 |
#group: #inputGroup1 |
1155 | 567 |
#type: #smalltalkObject |
568 |
#acceptOnLeave: false |
|
569 |
#acceptOnReturn: true |
|
570 |
#acceptOnTab: true |
|
571 |
#acceptOnLostFocus: false |
|
572 |
#acceptChannel: #acceptChannel |
|
573 |
#modifiedChannel: #modifiedChannel |
|
574 |
#acceptOnPointerLeave: false |
|
575 |
) |
|
576 |
#(#CheckBoxSpec |
|
1321 | 577 |
#attributes: |
578 |
#(#tabable |
|
579 |
true |
|
580 |
) |
|
1155 | 581 |
#label: 'Translate Label' |
582 |
#name: 'translateLabelCheckBox' |
|
583 |
#layout: #(#Point 20 230) |
|
584 |
#activeHelpKey: #basicsTranslateLabel |
|
585 |
#tabable: true |
|
586 |
#model: #translateLabel |
|
587 |
) |
|
588 |
#(#CheckBoxSpec |
|
1321 | 589 |
#attributes: |
590 |
#(#tabable |
|
591 |
true |
|
592 |
) |
|
1155 | 593 |
#label: 'Is Button' |
594 |
#name: 'isButtonCheckBox' |
|
1321 | 595 |
#layout: #(#Point 20 256) |
1155 | 596 |
#activeHelpKey: #basicsIsButton |
597 |
#tabable: true |
|
598 |
#model: #isButton |
|
599 |
) |
|
1321 | 600 |
#(#CheckBoxSpec |
601 |
#attributes: |
|
602 |
#(#tabable |
|
603 |
true |
|
604 |
) |
|
605 |
#label: 'Hide Menu after Activation' |
|
606 |
#name: 'hideMenuOnActivated' |
|
607 |
#layout: #(#Point 20 281) |
|
608 |
#activeHelpKey: #hideMenuOnActivated |
|
609 |
#tabable: true |
|
610 |
#model: #hideMenuOnActivated |
|
611 |
) |
|
1155 | 612 |
) |
613 |
||
614 |
) |
|
199 | 615 |
) |
616 |
! |
|
617 |
||
218 | 618 |
basicsLinkSpec |
738 | 619 |
"This resource specification was automatically generated |
620 |
by the UIPainter of ST/X." |
|
621 |
||
622 |
"Do not manually edit this!! If it is corrupted, |
|
623 |
the UIPainter may not be able to read the specification." |
|
218 | 624 |
|
625 |
" |
|
626 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsLinkSpec |
|
627 |
MenuEditor new openInterface:#basicsLinkSpec |
|
628 |
" |
|
629 |
||
630 |
<resource: #canvas> |
|
631 |
||
1155 | 632 |
^ |
633 |
#(#FullSpec |
|
634 |
#name: #basicsLinkSpec |
|
635 |
#window: |
|
636 |
#(#WindowSpec |
|
637 |
#label: 'Basics Link' |
|
638 |
#name: 'Basics Link' |
|
639 |
#min: #(#Point 10 10) |
|
640 |
#max: #(#Point 1280 1024) |
|
1244 | 641 |
#bounds: #(#Rectangle 94 229 361 548) |
1155 | 642 |
) |
643 |
#component: |
|
644 |
#(#SpecCollection |
|
645 |
#collection: #( |
|
646 |
#(#LabelSpec |
|
647 |
#label: 'Name Key:' |
|
648 |
#name: 'nameKeyLabel' |
|
649 |
#layout: #(#AlignmentOrigin 107 0 26 0 1 0.5) |
|
650 |
#activeHelpKey: #nameKey |
|
651 |
#resizeForLabel: true |
|
652 |
#adjust: #right |
|
653 |
) |
|
654 |
#(#InputFieldSpec |
|
655 |
#name: 'nameKeyField' |
|
656 |
#layout: #(#LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
657 |
#activeHelpKey: #basicsNameKey |
|
658 |
#tabable: true |
|
659 |
#model: #nameKey |
|
1244 | 660 |
#group: #inputGroup2 |
1155 | 661 |
#type: #symbolOrNil |
662 |
#acceptOnReturn: true |
|
663 |
#acceptOnTab: true |
|
664 |
#acceptChannel: #acceptChannel |
|
665 |
#modifiedChannel: #modifiedChannel |
|
666 |
#acceptOnPointerLeave: false |
|
667 |
) |
|
668 |
#(#LabelSpec |
|
669 |
#label: 'Label:' |
|
670 |
#name: 'labelLabel' |
|
671 |
#layout: #(#AlignmentOrigin 107 0 51 0 1 0.5) |
|
672 |
#resizeForLabel: true |
|
673 |
) |
|
674 |
#(#InputFieldSpec |
|
675 |
#name: 'labelField' |
|
676 |
#layout: #(#LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
677 |
#activeHelpKey: #basicsLabel |
|
678 |
#tabable: true |
|
679 |
#model: #label |
|
1244 | 680 |
#group: #inputGroup2 |
1155 | 681 |
#acceptOnReturn: true |
682 |
#acceptOnTab: true |
|
683 |
#acceptChannel: #acceptChannel |
|
684 |
#modifiedChannel: #modifiedChannel |
|
685 |
#acceptOnPointerLeave: false |
|
686 |
) |
|
687 |
#(#LabelSpec |
|
688 |
#label: 'Menu:' |
|
689 |
#name: 'menuLabel' |
|
690 |
#layout: #(#AlignmentOrigin 107 0 76 0 1 0.5) |
|
691 |
#resizeForLabel: true |
|
692 |
) |
|
693 |
#(#InputFieldSpec |
|
694 |
#name: 'menuField' |
|
695 |
#layout: #(#LayoutFrame 110 0 65 0 -5 1.0 87 0) |
|
696 |
#activeHelpKey: #basicsMenu |
|
697 |
#tabable: true |
|
698 |
#model: #submenuChannel |
|
1244 | 699 |
#group: #inputGroup2 |
1155 | 700 |
#type: #symbolOrNil |
701 |
#acceptOnReturn: true |
|
702 |
#acceptOnTab: true |
|
703 |
#acceptChannel: #acceptChannel |
|
704 |
#modifiedChannel: #modifiedChannel |
|
705 |
#acceptOnPointerLeave: false |
|
706 |
) |
|
707 |
#(#LabelSpec |
|
708 |
#label: 'Argument:' |
|
709 |
#name: 'ArgumentLabel' |
|
710 |
#layout: #(#AlignmentOrigin 107 0 100 0 1 0.5) |
|
711 |
#resizeForLabel: true |
|
712 |
) |
|
713 |
#(#InputFieldSpec |
|
714 |
#name: 'argumentField' |
|
715 |
#layout: #(#LayoutFrame 110 0 90 0 -5 1.0 112 0) |
|
716 |
#activeHelpKey: #basicsMenuArgument |
|
717 |
#tabable: true |
|
718 |
#model: #argument |
|
1244 | 719 |
#group: #inputGroup2 |
1155 | 720 |
#acceptOnReturn: true |
721 |
#acceptOnTab: true |
|
722 |
#acceptChannel: #acceptChannel |
|
723 |
#modifiedChannel: #modifiedChannel |
|
724 |
#acceptOnPointerLeave: false |
|
725 |
) |
|
726 |
#(#CheckBoxSpec |
|
727 |
#label: 'Translate Label' |
|
728 |
#name: 'translateLabelCheckBox' |
|
729 |
#layout: #(#Point 20 190) |
|
730 |
#activeHelpKey: #basicsTranslateLabel |
|
731 |
#tabable: true |
|
732 |
#model: #translateLabel |
|
733 |
) |
|
734 |
) |
|
735 |
||
736 |
) |
|
218 | 737 |
) |
738 |
! |
|
739 |
||
199 | 740 |
basicsMenuSpec |
738 | 741 |
"This resource specification was automatically generated |
742 |
by the UIPainter of ST/X." |
|
743 |
||
744 |
"Do not manually edit this!! If it is corrupted, |
|
745 |
the UIPainter may not be able to read the specification." |
|
199 | 746 |
|
747 |
" |
|
748 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsMenuSpec |
|
749 |
MenuEditor new openInterface:#basicsMenuSpec |
|
750 |
" |
|
751 |
||
752 |
<resource: #canvas> |
|
753 |
||
1155 | 754 |
^ |
755 |
#(#FullSpec |
|
756 |
#name: #basicsMenuSpec |
|
757 |
#window: |
|
758 |
#(#WindowSpec |
|
759 |
#label: 'Basics Menu' |
|
760 |
#name: 'Basics Menu' |
|
761 |
#min: #(#Point 10 10) |
|
762 |
#max: #(#Point 1280 1024) |
|
1244 | 763 |
#bounds: #(#Rectangle 93 223 360 542) |
1155 | 764 |
) |
765 |
#component: |
|
766 |
#(#SpecCollection |
|
767 |
#collection: #( |
|
768 |
#(#LabelSpec |
|
769 |
#label: 'Name Key:' |
|
770 |
#name: 'nameKeyLabel' |
|
771 |
#layout: #(#AlignmentOrigin 107 0 26 0 1 0.5) |
|
772 |
#resizeForLabel: true |
|
773 |
#adjust: #right |
|
774 |
) |
|
775 |
#(#InputFieldSpec |
|
776 |
#name: 'nameKeyField' |
|
777 |
#layout: #(#LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
778 |
#activeHelpKey: #basicsNameKey |
|
779 |
#tabable: true |
|
780 |
#model: #nameKey |
|
1244 | 781 |
#group: #inputGroup3 |
1155 | 782 |
#type: #symbolOrNil |
783 |
#acceptOnReturn: true |
|
784 |
#acceptOnTab: true |
|
785 |
#acceptChannel: #acceptChannel |
|
786 |
#modifiedChannel: #modifiedChannel |
|
787 |
#acceptOnPointerLeave: false |
|
788 |
) |
|
789 |
#(#LabelSpec |
|
790 |
#label: 'Label:' |
|
791 |
#name: 'labelLabel' |
|
792 |
#layout: #(#AlignmentOrigin 107 0 51 0 1 0.5) |
|
793 |
#resizeForLabel: true |
|
794 |
#adjust: #right |
|
795 |
) |
|
796 |
#(#InputFieldSpec |
|
797 |
#name: 'labelField' |
|
798 |
#layout: #(#LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
799 |
#activeHelpKey: #basicsLabel |
|
800 |
#tabable: true |
|
801 |
#model: #label |
|
1244 | 802 |
#group: #inputGroup3 |
1155 | 803 |
#acceptOnReturn: true |
804 |
#acceptOnTab: true |
|
805 |
#acceptChannel: #acceptChannel |
|
806 |
#modifiedChannel: #modifiedChannel |
|
807 |
#acceptOnPointerLeave: false |
|
808 |
) |
|
809 |
#(#CheckBoxSpec |
|
810 |
#label: 'Translate Label' |
|
811 |
#name: 'translateLabelCheckBox' |
|
812 |
#layout: #(#Point 20 190) |
|
813 |
#activeHelpKey: #basicsTranslateLabel |
|
814 |
#tabable: true |
|
815 |
#model: #translateLabel |
|
816 |
) |
|
817 |
) |
|
818 |
||
819 |
) |
|
199 | 820 |
) |
821 |
! |
|
822 |
||
823 |
basicsRootSpec |
|
738 | 824 |
"This resource specification was automatically generated |
825 |
by the UIPainter of ST/X." |
|
826 |
||
827 |
"Do not manually edit this!! If it is corrupted, |
|
828 |
the UIPainter may not be able to read the specification." |
|
199 | 829 |
|
830 |
" |
|
831 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsRootSpec |
|
832 |
MenuEditor new openInterface:#basicsRootSpec |
|
833 |
" |
|
834 |
||
835 |
<resource: #canvas> |
|
836 |
||
1155 | 837 |
^ |
838 |
#(#FullSpec |
|
839 |
#name: #basicsRootSpec |
|
840 |
#window: |
|
841 |
#(#WindowSpec |
|
842 |
#label: 'Basics Root' |
|
843 |
#name: 'Basics Root' |
|
844 |
#layout: #(#LayoutFrame 11 0 100 0 277 0 418 0) |
|
845 |
#level: 0 |
|
846 |
#min: #(#Point 10 10) |
|
847 |
#max: #(#Point 1280 1024) |
|
848 |
#bounds: #(#Rectangle 11 100 278 419) |
|
849 |
#usePreferredExtent: false |
|
850 |
#returnIsOKInDialog: true |
|
851 |
#escapeIsCancelInDialog: true |
|
852 |
) |
|
853 |
#component: |
|
854 |
#(#SpecCollection |
|
855 |
#collection: #( |
|
856 |
#(#LabelSpec |
|
857 |
#label: 'Selector:' |
|
858 |
#name: 'selectorLabel' |
|
859 |
#layout: #(#AlignmentOrigin 107 0 26 0 1 0.5) |
|
860 |
#resizeForLabel: true |
|
861 |
#adjust: #right |
|
862 |
) |
|
863 |
#(#InputFieldSpec |
|
864 |
#name: 'selectorField' |
|
865 |
#layout: #(#LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
866 |
#activeHelpKey: #basicsSelector |
|
867 |
#tabable: true |
|
868 |
#model: #label |
|
869 |
#group: #inputGroup |
|
870 |
#acceptOnReturn: true |
|
871 |
#acceptOnTab: true |
|
872 |
#acceptChannel: #acceptChannel |
|
873 |
#modifiedChannel: #modifiedChannel |
|
874 |
#acceptOnPointerLeave: false |
|
875 |
) |
|
876 |
) |
|
877 |
||
878 |
) |
|
199 | 879 |
) |
880 |
! |
|
881 |
||
218 | 882 |
basicsSeparatorSpec |
738 | 883 |
"This resource specification was automatically generated |
884 |
by the UIPainter of ST/X." |
|
885 |
||
886 |
"Do not manually edit this!! If it is corrupted, |
|
887 |
the UIPainter may not be able to read the specification." |
|
199 | 888 |
|
889 |
" |
|
218 | 890 |
UIPainter new openOnClass:MenuEditor andSelector:#basicsSeparatorSpec |
891 |
MenuEditor new openInterface:#basicsSeparatorSpec |
|
199 | 892 |
" |
893 |
||
894 |
<resource: #canvas> |
|
895 |
||
1155 | 896 |
^ |
897 |
#(#FullSpec |
|
898 |
#name: #basicsSeparatorSpec |
|
899 |
#window: |
|
900 |
#(#WindowSpec |
|
901 |
#label: 'Basics Separator' |
|
902 |
#name: 'Basics Separator' |
|
903 |
#layout: #(#LayoutFrame 9 0 149 0 275 0 467 0) |
|
904 |
#level: 0 |
|
905 |
#min: #(#Point 10 10) |
|
906 |
#max: #(#Point 1160 870) |
|
907 |
#bounds: #(#Rectangle 9 149 276 468) |
|
908 |
#usePreferredExtent: false |
|
909 |
#returnIsOKInDialog: true |
|
910 |
#escapeIsCancelInDialog: true |
|
911 |
) |
|
912 |
#component: |
|
913 |
#(#SpecCollection |
|
914 |
#collection: #( |
|
915 |
#(#LabelSpec |
|
916 |
#label: 'Separator Type:' |
|
917 |
#name: 'separatorLabel' |
|
918 |
#layout: #(#AlignmentOrigin 127 0 26 0 1 0.5) |
|
919 |
#resizeForLabel: true |
|
920 |
#adjust: #right |
|
921 |
) |
|
922 |
#(#ComboListSpec |
|
923 |
#name: 'seperatorList' |
|
924 |
#layout: #(#LayoutFrame 132 0 15 0 -5 1.0 37 0) |
|
925 |
#activeHelpKey: #basicsSeparatorType |
|
926 |
#tabable: true |
|
927 |
#model: #seperatorSelection |
|
928 |
#useIndex: true |
|
929 |
) |
|
930 |
#(#LabelSpec |
|
931 |
#label: 'Visibility:' |
|
932 |
#name: 'visibilityLabel' |
|
933 |
#layout: #(#AlignmentOrigin 127 0 76 0 1 0.5) |
|
934 |
#resizeForLabel: true |
|
935 |
#adjust: #right |
|
936 |
) |
|
937 |
#(#InputFieldSpec |
|
938 |
#name: 'visibilityInputField' |
|
939 |
#layout: #(#LayoutFrame 132 0 65 0 -5 1.0 87 0) |
|
940 |
#activeHelpKey: #detailsVisibility |
|
941 |
#tabable: true |
|
942 |
#model: #isVisible |
|
943 |
#group: #inputGroup |
|
944 |
#type: #symbolOrNil |
|
945 |
#acceptOnReturn: true |
|
946 |
#acceptOnTab: true |
|
947 |
#acceptChannel: #acceptChannel |
|
948 |
#modifiedChannel: #modifiedChannel |
|
949 |
#acceptOnPointerLeave: false |
|
950 |
) |
|
951 |
) |
|
952 |
||
953 |
) |
|
199 | 954 |
) |
955 |
! |
|
956 |
||
957 |
detailsEditSpec |
|
738 | 958 |
"This resource specification was automatically generated |
959 |
by the UIPainter of ST/X." |
|
960 |
||
961 |
"Do not manually edit this!! If it is corrupted, |
|
962 |
the UIPainter may not be able to read the specification." |
|
199 | 963 |
|
964 |
" |
|
965 |
UIPainter new openOnClass:MenuEditor andSelector:#detailsEditSpec |
|
966 |
MenuEditor new openInterface:#detailsEditSpec |
|
967 |
" |
|
968 |
||
969 |
<resource: #canvas> |
|
970 |
||
1155 | 971 |
^ |
972 |
#(#FullSpec |
|
973 |
#name: #detailsEditSpec |
|
974 |
#window: |
|
975 |
#(#WindowSpec |
|
976 |
#label: 'Details Edit' |
|
977 |
#name: 'Details Edit' |
|
978 |
#min: #(#Point 10 10) |
|
979 |
#max: #(#Point 1280 1024) |
|
1264 | 980 |
#bounds: #(#Rectangle 670 329 985 613) |
1155 | 981 |
) |
982 |
#component: |
|
983 |
#(#SpecCollection |
|
984 |
#collection: #( |
|
985 |
#(#LabelSpec |
|
986 |
#label: 'Accelerator:' |
|
987 |
#name: 'shortcutKeyLabel' |
|
988 |
#layout: #(#AlignmentOrigin 107 0 26 0 1 0.5) |
|
989 |
#activeHelpKey: #detailsAccelerator |
|
990 |
#resizeForLabel: true |
|
991 |
#adjust: #right |
|
992 |
) |
|
993 |
#(#InputFieldSpec |
|
994 |
#name: 'shortcutKeyField' |
|
995 |
#layout: #(#LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
996 |
#activeHelpKey: #detailsAccelerator |
|
997 |
#tabable: true |
|
998 |
#model: #shortcutKey |
|
1244 | 999 |
#group: #inputGroup4 |
1155 | 1000 |
#type: #symbolOrNil |
1001 |
#acceptOnReturn: true |
|
1002 |
#acceptOnTab: true |
|
1003 |
#acceptChannel: #acceptChannel |
|
1004 |
#modifiedChannel: #modifiedChannel |
|
1244 | 1005 |
#acceptOnPointerLeave: false |
1155 | 1006 |
) |
1007 |
#(#LabelSpec |
|
1008 |
#label: 'Enabled:' |
|
1009 |
#name: 'enabledLabel' |
|
1010 |
#layout: #(#AlignmentOrigin 107 0 51 0 1 0.5) |
|
1011 |
#activeHelpKey: #detailsEnabled |
|
1012 |
#resizeForLabel: true |
|
1013 |
#adjust: #right |
|
1014 |
) |
|
1015 |
#(#InputFieldSpec |
|
1016 |
#name: 'enabledField' |
|
1017 |
#layout: #(#LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
1018 |
#activeHelpKey: #detailsEnabled |
|
1019 |
#tabable: true |
|
1020 |
#model: #enabled |
|
1244 | 1021 |
#group: #inputGroup4 |
1155 | 1022 |
#type: #symbolOrNil |
1023 |
#acceptOnReturn: true |
|
1024 |
#acceptOnTab: true |
|
1025 |
#acceptChannel: #acceptChannel |
|
1026 |
#modifiedChannel: #modifiedChannel |
|
1244 | 1027 |
#acceptOnPointerLeave: false |
1155 | 1028 |
) |
1029 |
#(#LabelSpec |
|
1030 |
#label: 'Visibility:' |
|
1031 |
#name: 'visibilityLabel' |
|
1032 |
#layout: #(#AlignmentOrigin 107 0 76 0 1 0.5) |
|
1033 |
#activeHelpKey: #detailsVisibility |
|
1034 |
#resizeForLabel: true |
|
1035 |
#adjust: #right |
|
1036 |
) |
|
1037 |
#(#InputFieldSpec |
|
1038 |
#name: 'isVisibleInputField' |
|
1039 |
#layout: #(#LayoutFrame 110 0 65 0 -5 1.0 87 0) |
|
1040 |
#activeHelpKey: #detailsVisibility |
|
1041 |
#tabable: true |
|
1042 |
#model: #isVisible |
|
1244 | 1043 |
#group: #inputGroup4 |
1155 | 1044 |
#type: #symbolOrNil |
1045 |
#acceptOnReturn: true |
|
1046 |
#acceptOnTab: true |
|
1047 |
#acceptChannel: #acceptChannel |
|
1048 |
#modifiedChannel: #modifiedChannel |
|
1244 | 1049 |
#acceptOnPointerLeave: false |
1050 |
) |
|
1051 |
#(#LabelSpec |
|
1052 |
#label: 'Aux Value' |
|
1053 |
#name: 'auxLabel' |
|
1054 |
#layout: #(#AlignmentOrigin 107 0 101 0 1 0.5) |
|
1055 |
#activeHelpKey: #detailsAuxValue |
|
1056 |
#translateLabel: true |
|
1057 |
#resizeForLabel: true |
|
1058 |
#adjust: #right |
|
1059 |
) |
|
1060 |
#(#InputFieldSpec |
|
1061 |
#name: 'auxInputField' |
|
1062 |
#layout: #(#LayoutFrame 110 0 90 0 -5 1.0 112 0) |
|
1063 |
#activeHelpKey: #detailsAuxValue |
|
1064 |
#tabable: true |
|
1065 |
#model: #auxValue |
|
1066 |
#group: #inputGroup4 |
|
1067 |
#type: #smalltalkObject |
|
1068 |
#acceptOnReturn: true |
|
1069 |
#acceptOnTab: true |
|
1070 |
#acceptChannel: #acceptChannel |
|
1071 |
#modifiedChannel: #modifiedChannel |
|
1072 |
#acceptOnPointerLeave: false |
|
1155 | 1073 |
) |
1074 |
#(#LabelSpec |
|
1075 |
#label: 'Start Group:' |
|
1076 |
#name: 'StartGroupLabel' |
|
1199 | 1077 |
#layout: #(#AlignmentOrigin 107 0 139 0 1 0.5) |
1155 | 1078 |
#activeHelpKey: #detailsStartGroup |
1079 |
#resizeForLabel: true |
|
1080 |
#adjust: #right |
|
1081 |
) |
|
1082 |
#(#PopUpListSpec |
|
1083 |
#label: 'PopUpList' |
|
1084 |
#name: 'StartGroupPopUp' |
|
1199 | 1085 |
#layout: #(#LayoutFrame 110 0 128 0 -5 1.0 150 0) |
1155 | 1086 |
#activeHelpKey: #detailsStartGroup |
1087 |
#tabable: true |
|
1088 |
#model: #startGroup |
|
1089 |
#menu: |
|
1264 | 1090 |
#(nil |
1155 | 1091 |
#right |
199 | 1092 |
) |
1155 | 1093 |
#useIndex: false |
1094 |
) |
|
1095 |
#(#LabelSpec |
|
1096 |
#label: 'Access Character Position:' |
|
1097 |
#name: 'accessCharLabel' |
|
1199 | 1098 |
#layout: #(#AlignmentOrigin 217 0 170 0 1 0.5) |
1155 | 1099 |
#activeHelpKey: #detailsAccessCharaterPosition |
1100 |
#resizeForLabel: true |
|
1101 |
#adjust: #right |
|
1102 |
) |
|
1103 |
#(#InputFieldSpec |
|
1104 |
#name: 'accessCharField' |
|
1199 | 1105 |
#layout: #(#LayoutFrame 220 0 159 0 -5 1.0 181 0) |
1155 | 1106 |
#activeHelpKey: #detailsAccessCharaterPosition |
1107 |
#tabable: true |
|
1108 |
#model: #accessCharacterPos |
|
1244 | 1109 |
#group: #inputGroup4 |
1155 | 1110 |
#type: #numberOrNil |
1111 |
#immediateAccept: false |
|
1112 |
#acceptOnReturn: true |
|
1113 |
#acceptOnTab: true |
|
1114 |
#acceptChannel: #acceptChannel |
|
1115 |
#modifiedChannel: #modifiedChannel |
|
1244 | 1116 |
#acceptOnPointerLeave: false |
1155 | 1117 |
) |
1118 |
) |
|
1119 |
||
1120 |
) |
|
199 | 1121 |
) |
1122 |
! |
|
1123 |
||
398 | 1124 |
imageEditSpec |
738 | 1125 |
"This resource specification was automatically generated |
1126 |
by the UIPainter of ST/X." |
|
1127 |
||
1128 |
"Do not manually edit this!! If it is corrupted, |
|
1129 |
the UIPainter may not be able to read the specification." |
|
199 | 1130 |
|
1131 |
" |
|
398 | 1132 |
UIPainter new openOnClass:MenuEditor andSelector:#imageEditSpec |
1133 |
MenuEditor new openInterface:#imageEditSpec |
|
199 | 1134 |
" |
1135 |
||
1136 |
<resource: #canvas> |
|
1137 |
||
1155 | 1138 |
^ |
1139 |
#(#FullSpec |
|
1140 |
#name: #imageEditSpec |
|
1141 |
#window: |
|
1142 |
#(#WindowSpec |
|
1143 |
#label: 'Image Item' |
|
1144 |
#name: 'Image Item' |
|
1145 |
#min: #(#Point 10 10) |
|
1146 |
#max: #(#Point 1280 1024) |
|
1301 | 1147 |
#bounds: #(#Rectangle 15 153 411 430) |
1155 | 1148 |
) |
1149 |
#component: |
|
1150 |
#(#SpecCollection |
|
1151 |
#collection: #( |
|
1152 |
#(#LabelSpec |
|
1153 |
#label: 'Retriever:' |
|
1154 |
#name: 'retrieverLabel' |
|
1155 |
#layout: #(#AlignmentOrigin 107 0 26 0 1 0.5) |
|
1156 |
#activeHelpKey: #imageRetriever |
|
1157 |
#resizeForLabel: true |
|
1158 |
#adjust: #right |
|
1159 |
) |
|
1160 |
#(#ComboBoxSpec |
|
1301 | 1161 |
#attributes: |
1162 |
#(#tabable |
|
1163 |
true |
|
1164 |
) |
|
1155 | 1165 |
#name: 'retrieverField' |
1166 |
#layout: #(#LayoutFrame 110 0 15 0 0 1.0 37 0) |
|
1167 |
#activeHelpKey: #imageRetriever |
|
1168 |
#tabable: true |
|
1169 |
#model: #retriever |
|
1170 |
#type: #symbolOrNil |
|
1171 |
#acceptOnReturn: true |
|
1172 |
#acceptOnTab: true |
|
1173 |
#acceptChannel: #acceptChannel |
|
1174 |
#acceptOnPointerLeave: false |
|
1175 |
#comboList: #retrieverClassList |
|
1176 |
) |
|
1177 |
#(#LabelSpec |
|
1178 |
#label: 'Selector:' |
|
1179 |
#name: 'iconLabel' |
|
1180 |
#layout: #(#AlignmentOrigin 107 0 51 0 1 0.5) |
|
1181 |
#activeHelpKey: #imageSelector |
|
1182 |
#resizeForLabel: true |
|
1183 |
#adjust: #right |
|
1184 |
) |
|
1185 |
#(#InputFieldSpec |
|
1301 | 1186 |
#attributes: |
1187 |
#(#tabable |
|
1188 |
true |
|
1189 |
) |
|
1155 | 1190 |
#name: 'iconField' |
1191 |
#layout: #(#LayoutFrame 110 0 40 0 -31 1.0 62 0) |
|
1192 |
#activeHelpKey: #imageSelector |
|
1193 |
#tabable: true |
|
1194 |
#model: #icon |
|
1244 | 1195 |
#group: #inputGroup5 |
1155 | 1196 |
#type: #symbolOrNil |
1197 |
#acceptOnReturn: true |
|
1198 |
#acceptOnTab: true |
|
1199 |
#acceptChannel: #acceptChannel |
|
1200 |
#modifiedChannel: #modifiedChannel |
|
1201 |
#acceptOnPointerLeave: false |
|
1202 |
) |
|
1203 |
#(#ActionButtonSpec |
|
1301 | 1204 |
#attributes: |
1205 |
#(#tabable |
|
1206 |
true |
|
1207 |
) |
|
1208 |
#label: '...' |
|
1209 |
#name: 'browseButton' |
|
1210 |
#layout: #(#LayoutFrame -26 1 41 0 -2 1 63 0) |
|
1211 |
#activeHelpKey: #browseResource |
|
1155 | 1212 |
#tabable: true |
1301 | 1213 |
#model: #doBrowseForImageResource |
1155 | 1214 |
) |
1215 |
#(#SequenceViewSpec |
|
1216 |
#name: 'systemOrUserImagesList' |
|
1217 |
#layout: #(#LayoutFrame 22 0 67 0 11 0.6 200 0) |
|
1218 |
#activeHelpKey: #imageImageList |
|
1301 | 1219 |
#tabable: true |
1155 | 1220 |
#model: #selectionOfImage |
1221 |
#menu: #menuEditImage |
|
1222 |
#hasHorizontalScrollBar: true |
|
1223 |
#hasVerticalScrollBar: true |
|
1224 |
#miniScrollerHorizontal: true |
|
1225 |
#doubleClickSelector: #doEditImage |
|
1226 |
#valueChangeSelector: #imageSelected |
|
1227 |
#useIndex: false |
|
1228 |
#sequenceList: #listOfImages |
|
1229 |
) |
|
1230 |
#(#ActionButtonSpec |
|
1301 | 1231 |
#attributes: |
1232 |
#(#tabable |
|
1233 |
true |
|
1234 |
) |
|
1235 |
#label: 'Image Editor' |
|
1236 |
#name: 'imageEditorButton' |
|
1237 |
#layout: #(#LayoutFrame 19 0.6 128 0 -5 1 152 0) |
|
1238 |
#activeHelpKey: #imageImageEditor |
|
1239 |
#tabable: true |
|
1240 |
#model: #doEditImage |
|
1241 |
) |
|
1242 |
#(#CheckBoxSpec |
|
1243 |
#attributes: |
|
1244 |
#(#tabable |
|
1245 |
true |
|
1246 |
) |
|
1247 |
#label: 'Image & Label' |
|
1248 |
#name: 'iconAndLabelCheckBox' |
|
1249 |
#layout: #(#LayoutOrigin 20 0 215 0) |
|
1250 |
#activeHelpKey: #imageImageAndLabel |
|
1251 |
#tabable: true |
|
1252 |
#model: #iconAndLabel |
|
1155 | 1253 |
) |
1254 |
) |
|
1255 |
||
1256 |
) |
|
199 | 1257 |
) |
525 | 1258 |
! |
1259 |
||
1260 |
windowSpec |
|
738 | 1261 |
"This resource specification was automatically generated |
1262 |
by the UIPainter of ST/X." |
|
1263 |
||
1264 |
"Do not manually edit this!! If it is corrupted, |
|
1265 |
the UIPainter may not be able to read the specification." |
|
525 | 1266 |
|
1267 |
" |
|
1268 |
UIPainter new openOnClass:MenuEditor andSelector:#windowSpec |
|
1269 |
MenuEditor new openInterface:#windowSpec |
|
738 | 1270 |
MenuEditor open |
525 | 1271 |
" |
1272 |
||
1273 |
<resource: #canvas> |
|
1274 |
||
1244 | 1275 |
^ |
1276 |
#(#FullSpec |
|
1277 |
#name: #windowSpec |
|
1278 |
#window: |
|
1279 |
#(#WindowSpec |
|
1280 |
#label: 'Menu Editor' |
|
1281 |
#name: 'Menu Editor' |
|
1282 |
#min: #(#Point 550 440) |
|
1283 |
#max: #(#Point 1152 900) |
|
1322 | 1284 |
#bounds: #(#Rectangle 12 22 569 462) |
1244 | 1285 |
#menu: #menu |
1249 | 1286 |
#returnIsOKInDialog: false |
1287 |
#escapeIsCancelInDialog: false |
|
1244 | 1288 |
) |
1289 |
#component: |
|
1290 |
#(#SpecCollection |
|
1291 |
#collection: #( |
|
1292 |
#(#MenuPanelSpec |
|
1322 | 1293 |
#attributes: |
1294 |
#(#tabable |
|
1295 |
true |
|
1296 |
) |
|
1244 | 1297 |
#name: 'menuToolbarView' |
1298 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0) |
|
1322 | 1299 |
#tabable: true |
1244 | 1300 |
#menu: #menuToolbar |
1301 |
#showSeparatingLines: true |
|
1302 |
) |
|
1303 |
#(#VariableHorizontalPanelSpec |
|
1304 |
#name: 'VariableHorizontalPanel' |
|
1305 |
#layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0) |
|
1306 |
#component: |
|
1307 |
#(#SpecCollection |
|
1308 |
#collection: #( |
|
1309 |
#(#ArbitraryComponentSpec |
|
1310 |
#name: 'TreeView' |
|
1311 |
#menu: #menuEdit |
|
1312 |
#hasHorizontalScrollBar: true |
|
1313 |
#hasVerticalScrollBar: true |
|
1314 |
#hasBorder: false |
|
1315 |
#component: #treeView |
|
1316 |
) |
|
1317 |
#(#ViewSpec |
|
1318 |
#name: 'Box' |
|
1319 |
#level: -1 |
|
703 | 1320 |
#component: |
1244 | 1321 |
#(#SpecCollection |
1322 |
#collection: #( |
|
1323 |
#(#NoteBookViewSpec |
|
1322 | 1324 |
#attributes: |
1325 |
#(#tabable |
|
1326 |
true |
|
1327 |
) |
|
1244 | 1328 |
#name: 'NoteBook' |
1329 |
#layout: #(#LayoutFrame 1 0.0 0 0.0 1 1.0 -30 1.0) |
|
1330 |
#enableChannel: #hasAnySingleSelection |
|
1331 |
#tabable: true |
|
1332 |
#model: #tabModel |
|
1333 |
#menu: #tabList |
|
1334 |
#useIndex: true |
|
1335 |
#canvas: #tabCanvasHolder |
|
1336 |
#keepCanvasAlive: true |
|
1337 |
) |
|
1338 |
#(#UISubSpecification |
|
1339 |
#name: 'SubSpecification' |
|
1340 |
#layout: #(#LayoutFrame 2 0.0 -26 1 -2 1.0 -2 1.0) |
|
1341 |
#majorKey: #ToolApplicationModel |
|
1342 |
#minorKey: #windowSpecForCommit |
|
525 | 1343 |
) |
1244 | 1344 |
) |
1345 |
||
525 | 1346 |
) |
1244 | 1347 |
) |
1348 |
) |
|
1349 |
||
525 | 1350 |
) |
1244 | 1351 |
#handles: #(#Any 0.346499 1.0) |
1352 |
) |
|
1353 |
#(#UISubSpecification |
|
1354 |
#name: 'InfoBarSubSpec' |
|
1355 |
#layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) |
|
1356 |
#majorKey: #ToolApplicationModel |
|
1357 |
#minorKey: #windowSpecForInfoBar |
|
1358 |
) |
|
1359 |
) |
|
1360 |
||
1361 |
) |
|
525 | 1362 |
) |
1363 |
! ! |
|
1364 |
||
1365 |
!MenuEditor class methodsFor:'menu specs'! |
|
1366 |
||
1367 |
menu |
|
738 | 1368 |
"This resource specification was automatically generated |
1369 |
by the MenuEditor of ST/X." |
|
1370 |
||
1371 |
"Do not manually edit this!! If it is corrupted, |
|
1372 |
the MenuEditor may not be able to read the specification." |
|
525 | 1373 |
|
1374 |
" |
|
1375 |
MenuEditor new openOnClass:MenuEditor andSelector:#menu |
|
1376 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menu)) startUp |
|
1377 |
" |
|
1378 |
||
1379 |
<resource: #menu> |
|
1380 |
||
1381 |
^ |
|
1382 |
||
1383 |
#(#Menu |
|
1384 |
||
1385 |
#( |
|
1386 |
#(#MenuItem |
|
686 | 1387 |
#label: 'About' |
836 | 1388 |
#translateLabel: true |
686 | 1389 |
#accessCharacterPosition: 1 |
1390 |
#labelImage: #(#ResourceRetriever nil #menuIcon) |
|
1391 |
#submenuChannel: #menuAbout |
|
525 | 1392 |
) |
1393 |
#(#MenuItem |
|
686 | 1394 |
#label: 'File' |
1395 |
#activeHelpKey: #file |
|
836 | 1396 |
#translateLabel: true |
686 | 1397 |
#submenu: |
525 | 1398 |
#(#Menu |
1399 |
||
1400 |
#( |
|
1401 |
#(#MenuItem |
|
686 | 1402 |
#label: 'New' |
1403 |
#value: #doNew |
|
836 | 1404 |
#translateLabel: true |
686 | 1405 |
#activeHelpKey: #fileNew |
525 | 1406 |
) |
1407 |
#(#MenuItem |
|
686 | 1408 |
#label: '-' |
525 | 1409 |
) |
1410 |
#(#MenuItem |
|
686 | 1411 |
#label: 'Load...' |
1412 |
#translateLabel: true |
|
1413 |
#value: #doLoad |
|
1414 |
#activeHelpKey: #fileLoad |
|
525 | 1415 |
) |
1416 |
#(#MenuItem |
|
686 | 1417 |
#label: '-' |
525 | 1418 |
) |
1419 |
#(#MenuItem |
|
686 | 1420 |
#label: 'Save' |
836 | 1421 |
#translateLabel: true |
686 | 1422 |
#value: #doSave |
1423 |
#activeHelpKey: #fileSave |
|
525 | 1424 |
) |
1425 |
#(#MenuItem |
|
686 | 1426 |
#label: 'Save As...' |
836 | 1427 |
#translateLabel: true |
686 | 1428 |
#value: #doSaveAs |
1429 |
#activeHelpKey: #fileSaveAs |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
1430 |
) |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
1431 |
#(#MenuItem |
686 | 1432 |
#label: '-' |
525 | 1433 |
) |
1434 |
#(#MenuItem |
|
686 | 1435 |
#label: 'Pick A Menu...' |
836 | 1436 |
#translateLabel: true |
686 | 1437 |
#value: #doPickAMenu |
1438 |
#activeHelpKey: #filePickAMenu |
|
525 | 1439 |
) |
1440 |
#(#MenuItem |
|
686 | 1441 |
#label: '-' |
525 | 1442 |
) |
1443 |
#(#MenuItem |
|
686 | 1444 |
#label: 'Browse Class' |
836 | 1445 |
#translateLabel: true |
686 | 1446 |
#value: #doBrowseClass |
1447 |
#activeHelpKey: #fileBrowseClass |
|
525 | 1448 |
) |
1449 |
#(#MenuItem |
|
686 | 1450 |
#label: '-' |
525 | 1451 |
) |
1452 |
#(#MenuItem |
|
686 | 1453 |
#label: 'Exit' |
1454 |
#translateLabel: true |
|
1455 |
#value: #closeRequest |
|
1456 |
#activeHelpKey: #fileExit |
|
525 | 1457 |
) |
1458 |
) nil |
|
1459 |
nil |
|
1460 |
) |
|
1461 |
) |
|
1462 |
#(#MenuItem |
|
686 | 1463 |
#label: 'Edit' |
1464 |
#activeHelpKey: #edit |
|
836 | 1465 |
#translateLabel: true |
686 | 1466 |
#submenuChannel: #menuEdit |
525 | 1467 |
) |
1468 |
#(#MenuItem |
|
686 | 1469 |
#label: 'Add' |
1470 |
#activeHelpKey: #add |
|
836 | 1471 |
#translateLabel: true |
686 | 1472 |
#submenuChannel: #menuAdd |
525 | 1473 |
) |
1474 |
#(#MenuItem |
|
686 | 1475 |
#label: 'Test' |
1476 |
#activeHelpKey: #test |
|
836 | 1477 |
#translateLabel: true |
686 | 1478 |
#submenuChannel: #submenuTest |
525 | 1479 |
) |
1033
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1480 |
"/ #(#MenuItem |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1481 |
"/ #label: 'Settings' |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1482 |
"/ #submenu: |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1483 |
"/ #(#Menu |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1484 |
"/ |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1485 |
"/ #( |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1486 |
"/ #(#MenuItem |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1487 |
"/ #label: 'Fonts' |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1488 |
"/ #translateLabel: true |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1489 |
"/ #submenuChannel: #menuFont |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1490 |
"/ ) |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1491 |
"/ ) nil |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1492 |
"/ nil |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1493 |
"/ ) |
21b3bc025e0c
removed the (stupid) fontSettings menu support.
Claus Gittinger <cg@exept.de>
parents:
1023
diff
changeset
|
1494 |
"/ ) |
738 | 1495 |
#(#MenuItem |
748 | 1496 |
#label: 'History' |
1497 |
#activeHelpKey: #history |
|
836 | 1498 |
#translateLabel: true |
748 | 1499 |
#submenuChannel: #menuHistory |
1500 |
) |
|
1501 |
#(#MenuItem |
|
686 | 1502 |
#label: 'Help' |
836 | 1503 |
#translateLabel: true |
686 | 1504 |
#startGroup: #right |
748 | 1505 |
#submenu: |
1506 |
#(#Menu |
|
1507 |
||
1508 |
#( |
|
1509 |
#(#MenuItem |
|
1510 |
#label: 'Documentation' |
|
1511 |
#value: #openHTMLDocument: |
|
836 | 1512 |
#translateLabel: true |
748 | 1513 |
#activeHelpKey: #helpTutorial |
764 | 1514 |
#argument: 'tools/uipainter/MenuEditor.html' |
748 | 1515 |
) |
1516 |
#(#MenuItem |
|
1517 |
#label: '-' |
|
1518 |
) |
|
1519 |
#(#MenuItem |
|
1520 |
#label: 'Help Tool' |
|
1521 |
#value: #openHTMLDocument: |
|
836 | 1522 |
#translateLabel: true |
748 | 1523 |
#activeHelpKey: #helpHelpTool |
1524 |
#argument: 'tools/uipainter/HelpTool.html' |
|
1525 |
) |
|
1526 |
#(#MenuItem |
|
1527 |
#label: '-' |
|
1528 |
) |
|
1529 |
#(#MenuItem |
|
1530 |
#label: 'Show Help Texts' |
|
836 | 1531 |
#translateLabel: true |
748 | 1532 |
#activeHelpKey: #helpShowHelp |
936
f3db8359547a
method rename: #showHelp -> #showingHelp
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1533 |
#indication: #showingHelp: |
748 | 1534 |
) |
1535 |
) nil |
|
1536 |
nil |
|
1537 |
) |
|
525 | 1538 |
) |
1539 |
) nil |
|
1540 |
nil |
|
1541 |
) |
|
836 | 1542 |
|
936
f3db8359547a
method rename: #showHelp -> #showingHelp
Claus Gittinger <cg@exept.de>
parents:
931
diff
changeset
|
1543 |
"Modified: / 31.7.1998 / 18:19:47 / cg" |
525 | 1544 |
! |
1545 |
||
1546 |
menuAdd |
|
738 | 1547 |
"This resource specification was automatically generated |
1548 |
by the MenuEditor of ST/X." |
|
1549 |
||
1550 |
"Do not manually edit this!! If it is corrupted, |
|
1551 |
the MenuEditor may not be able to read the specification." |
|
525 | 1552 |
|
1553 |
" |
|
1554 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuAdd |
|
1555 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuAdd)) startUp |
|
1556 |
" |
|
1557 |
||
1558 |
<resource: #menu> |
|
1559 |
||
1560 |
^ |
|
1561 |
||
1562 |
#(#Menu |
|
1563 |
||
1564 |
#( |
|
1565 |
#(#MenuItem |
|
703 | 1566 |
#label: 'Menu Item' |
836 | 1567 |
#translateLabel: true |
703 | 1568 |
#value: #doCreateItem |
1569 |
#activeHelpKey: #addMenuItem |
|
1570 |
#labelImage: #(#ResourceRetriever #MenuEditor #menuItemImage 'Menu Item') |
|
525 | 1571 |
) |
1572 |
#(#MenuItem |
|
703 | 1573 |
#label: 'Menu Separator' |
836 | 1574 |
#translateLabel: true |
703 | 1575 |
#value: #doCreateSep |
1576 |
#activeHelpKey: #addMenuSeparator |
|
1577 |
#labelImage: #(#ResourceRetriever #MenuEditor #menuSeparatorImage 'Menu Separator') |
|
525 | 1578 |
) |
1579 |
#(#MenuItem |
|
703 | 1580 |
#label: '-' |
525 | 1581 |
) |
1582 |
#(#MenuItem |
|
703 | 1583 |
#label: 'Submenu' |
836 | 1584 |
#translateLabel: true |
703 | 1585 |
#value: #doCreateMenu |
1586 |
#activeHelpKey: #addSubMenu |
|
1587 |
#labelImage: #(#ResourceRetriever #MenuEditor #submenuImage 'Submenu') |
|
525 | 1588 |
) |
1589 |
#(#MenuItem |
|
703 | 1590 |
#label: 'Submenu Link' |
836 | 1591 |
#translateLabel: true |
703 | 1592 |
#value: #doCreateLink |
1593 |
#activeHelpKey: #addSubMenuLink |
|
1594 |
#labelImage: #(#ResourceRetriever #MenuEditor #linkSubmenuImage 'Submenu Link') |
|
525 | 1595 |
) |
968
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1596 |
#(#MenuItem |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1597 |
#label: '-' |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1598 |
) |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1599 |
#(#MenuItem |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1600 |
#label: 'Standard Submenu' |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1601 |
#translateLabel: true |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1602 |
#submenu: |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1603 |
#(#Menu |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1604 |
|
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1605 |
#( |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1606 |
#(#MenuItem |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1607 |
#label: 'Standard File Menu' |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1608 |
#translateLabel: true |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1609 |
#value: #doCreateStandardFileMenu |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1610 |
) |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1611 |
#(#MenuItem |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1612 |
#label: 'Standard Edit Menu' |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1613 |
#translateLabel: true |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1614 |
#value: #doCreateStandardEditMenu |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1615 |
) |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1616 |
#(#MenuItem |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1617 |
#label: 'Standard Help Menu' |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1618 |
#translateLabel: true |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1619 |
#value: #doCreateStandardHelpMenu |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1620 |
) |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1621 |
) nil |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1622 |
nil |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1623 |
) |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1624 |
) |
525 | 1625 |
) nil |
1626 |
nil |
|
1627 |
) |
|
836 | 1628 |
|
968
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
1629 |
"Modified: / 23.8.1998 / 15:48:21 / cg" |
525 | 1630 |
! |
1631 |
||
1632 |
menuDefaultLink |
|
738 | 1633 |
"This resource specification was automatically generated |
1634 |
by the MenuEditor of ST/X." |
|
1635 |
||
1636 |
"Do not manually edit this!! If it is corrupted, |
|
1637 |
the MenuEditor may not be able to read the specification." |
|
525 | 1638 |
|
1639 |
" |
|
1640 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuDefaultLink |
|
1641 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuDefaultLink)) startUp |
|
1642 |
" |
|
1643 |
||
1644 |
<resource: #menu> |
|
1645 |
||
1646 |
^ |
|
738 | 1647 |
|
525 | 1648 |
#(#Menu |
738 | 1649 |
|
525 | 1650 |
#( |
1651 |
#(#MenuItem |
|
738 | 1652 |
#'label:' '!!!! derives from application !!!!' |
525 | 1653 |
) |
1654 |
) nil |
|
1655 |
nil |
|
1656 |
) |
|
1657 |
! |
|
1658 |
||
1659 |
menuEdit |
|
738 | 1660 |
"This resource specification was automatically generated |
1661 |
by the MenuEditor of ST/X." |
|
1662 |
||
1663 |
"Do not manually edit this!! If it is corrupted, |
|
1664 |
the MenuEditor may not be able to read the specification." |
|
525 | 1665 |
|
1666 |
" |
|
1667 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuEdit |
|
1668 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuEdit)) startUp |
|
1669 |
" |
|
1670 |
||
1671 |
<resource: #menu> |
|
1672 |
||
1673 |
^ |
|
1674 |
||
1675 |
#(#Menu |
|
1676 |
||
1677 |
#( |
|
1678 |
#(#MenuItem |
|
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1679 |
#label: 'Cut' |
882 | 1680 |
#translateLabel: true |
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1681 |
#value: #doCut |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1682 |
#activeHelpKey: #editCut |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1683 |
#enabled: #hasValidSelection |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1684 |
#shortcutKeyCharacter: #Cut |
525 | 1685 |
) |
1686 |
#(#MenuItem |
|
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1687 |
#label: 'Copy' |
882 | 1688 |
#translateLabel: true |
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1689 |
#value: #doCopy |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1690 |
#activeHelpKey: #editCopy |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1691 |
#enabled: #hasValidSelection |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1692 |
#shortcutKeyCharacter: #Copy |
525 | 1693 |
) |
1694 |
#(#MenuItem |
|
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1695 |
#label: 'Paste' |
882 | 1696 |
#translateLabel: true |
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1697 |
#value: #doPaste |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1698 |
#activeHelpKey: #editPaste |
738 | 1699 |
#enabled: #valueOfCanPaste |
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1700 |
#shortcutKeyCharacter: #Paste |
525 | 1701 |
) |
1702 |
#(#MenuItem |
|
686 | 1703 |
#label: 'Delete' |
882 | 1704 |
#translateLabel: true |
686 | 1705 |
#value: #doDelete |
1706 |
#activeHelpKey: #editDelete |
|
1707 |
#enabled: #hasValidSelection |
|
1708 |
#shortcutKeyCharacter: #Delete |
|
1709 |
) |
|
1710 |
#(#MenuItem |
|
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1711 |
#label: '-' |
525 | 1712 |
) |
1713 |
#(#MenuItem |
|
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1714 |
#label: 'Move Up' |
882 | 1715 |
#translateLabel: true |
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1716 |
#value: #doStepUp |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1717 |
#activeHelpKey: #editMoveUp |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1718 |
#enabled: #valueOfEnableMovingUpOrDown |
882 | 1719 |
#labelImage: #(#ResourceRetriever #Icon #upIcon 'Move Up') |
525 | 1720 |
) |
1721 |
#(#MenuItem |
|
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1722 |
#label: 'Move Down' |
882 | 1723 |
#translateLabel: true |
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1724 |
#value: #doStepDown |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1725 |
#activeHelpKey: #editMoveDown |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1726 |
#enabled: #valueOfEnableMovingUpOrDown |
882 | 1727 |
#labelImage: #(#ResourceRetriever #Icon #downIcon 'Move Down') |
525 | 1728 |
) |
1729 |
#(#MenuItem |
|
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1730 |
#label: 'Move In' |
882 | 1731 |
#translateLabel: true |
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1732 |
#value: #doStepIn |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1733 |
#activeHelpKey: #editMoveIn |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1734 |
#enabled: #valueOfEnableMovingIn |
882 | 1735 |
#labelImage: #(#ResourceRetriever #Icon #downRightIcon 'Move In') |
525 | 1736 |
) |
1737 |
#(#MenuItem |
|
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1738 |
#label: 'Move Out' |
882 | 1739 |
#translateLabel: true |
669
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1740 |
#value: #doStepOut |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1741 |
#activeHelpKey: #editMoveOut |
1f5b2d936bcf
disable move down/up buttons while selecting multiple items
tz
parents:
667
diff
changeset
|
1742 |
#enabled: #valueOfEnableMovingOut |
882 | 1743 |
#labelImage: #(#ResourceRetriever #Icon #leftDownIcon 'Move Out') |
525 | 1744 |
) |
1745 |
) nil |
|
1746 |
nil |
|
1747 |
) |
|
1748 |
! |
|
1749 |
||
888 | 1750 |
menuEditImage |
1751 |
"This resource specification was automatically generated |
|
1752 |
by the MenuEditor of ST/X." |
|
1753 |
||
1754 |
"Do not manually edit this!! If it is corrupted, |
|
1755 |
the MenuEditor may not be able to read the specification." |
|
1756 |
||
1757 |
" |
|
1758 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuEditImage |
|
1759 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuEditImage)) startUp |
|
1760 |
" |
|
1761 |
||
1762 |
<resource: #menu> |
|
1763 |
||
1764 |
^ |
|
1765 |
||
1766 |
#(#Menu |
|
1767 |
||
1768 |
#( |
|
1769 |
#(#MenuItem |
|
1770 |
#label: 'Edit' |
|
1771 |
#translateLabel: true |
|
1772 |
#value: #doEditImage |
|
1773 |
#activeHelpKey: #editCut |
|
1774 |
#enabled: #hasValidSelection |
|
1775 |
#shortcutKeyCharacter: #Cut |
|
1776 |
) |
|
1777 |
#(#MenuItem |
|
1778 |
#label: 'Remove' |
|
1779 |
#translateLabel: true |
|
1780 |
#value: #doRemoveImage |
|
1781 |
#activeHelpKey: #editCopy |
|
1782 |
#enabled: #hasValidSelection |
|
1783 |
#shortcutKeyCharacter: #Copy |
|
1784 |
) |
|
1785 |
) nil |
|
1786 |
nil |
|
1787 |
) |
|
1788 |
! |
|
1789 |
||
525 | 1790 |
menuToolbar |
738 | 1791 |
"This resource specification was automatically generated |
1792 |
by the MenuEditor of ST/X." |
|
1793 |
||
1794 |
"Do not manually edit this!! If it is corrupted, |
|
1795 |
the MenuEditor may not be able to read the specification." |
|
525 | 1796 |
|
1797 |
" |
|
1798 |
MenuEditor new openOnClass:MenuEditor andSelector:#menuToolbar |
|
1799 |
(Menu new fromLiteralArrayEncoding:(MenuEditor menuToolbar)) startUp |
|
1800 |
" |
|
1801 |
||
1802 |
<resource: #menu> |
|
1803 |
||
1322 | 1804 |
^ |
1805 |
#(#Menu |
|
1806 |
#( |
|
1807 |
#(#MenuItem |
|
1808 |
#label: 'New' |
|
1809 |
#isButton: true |
|
1810 |
#value: #doNew |
|
1811 |
#activeHelpKey: #fileNew |
|
1812 |
#labelImage: #(#ResourceRetriever #Icon #newIcon) |
|
1813 |
) |
|
1814 |
#(#MenuItem |
|
1815 |
#label: 'Load' |
|
1816 |
#isButton: true |
|
1817 |
#value: #doLoad |
|
1818 |
#activeHelpKey: #fileLoad |
|
1819 |
#labelImage: #(#ResourceRetriever #Icon #loadIcon) |
|
1820 |
) |
|
1821 |
#(#MenuItem |
|
1822 |
#label: 'Save' |
|
1823 |
#isButton: true |
|
1824 |
#value: #doSave |
|
1825 |
#activeHelpKey: #fileSave |
|
1826 |
#labelImage: #(#ResourceRetriever #Icon #saveIcon) |
|
1827 |
) |
|
1828 |
#(#MenuItem |
|
1829 |
#label: '' |
|
1830 |
) |
|
1831 |
#(#MenuItem |
|
1832 |
#label: 'Cut' |
|
1833 |
#isButton: true |
|
1834 |
#value: #doCut |
|
1835 |
#activeHelpKey: #editCut |
|
1836 |
#enabled: #hasValidSelection |
|
1837 |
#labelImage: #(#ResourceRetriever #Icon #cutIcon) |
|
1838 |
) |
|
1839 |
#(#MenuItem |
|
1840 |
#label: 'Copy' |
|
1841 |
#isButton: true |
|
1842 |
#value: #doCopy |
|
1843 |
#activeHelpKey: #editCopy |
|
1844 |
#enabled: #hasValidSelection |
|
1845 |
#labelImage: #(#ResourceRetriever #Icon #copyIcon) |
|
1846 |
) |
|
1847 |
#(#MenuItem |
|
1848 |
#label: 'Paste' |
|
1849 |
#isButton: true |
|
1850 |
#value: #doPaste |
|
1851 |
#activeHelpKey: #editPaste |
|
1852 |
#enabled: #valueOfCanPaste |
|
1853 |
#labelImage: #(#ResourceRetriever #Icon #pasteIcon) |
|
1854 |
) |
|
1855 |
#(#MenuItem |
|
1856 |
#label: 'Delete' |
|
1857 |
#isButton: true |
|
1858 |
#value: #doDelete |
|
1859 |
#activeHelpKey: #editDelete |
|
1860 |
#enabled: #hasValidSelection |
|
1861 |
#labelImage: #(#ResourceRetriever #Icon #deleteIcon) |
|
1862 |
) |
|
1863 |
#(#MenuItem |
|
1864 |
#label: '' |
|
1865 |
) |
|
1866 |
#(#MenuItem |
|
1867 |
#label: 'Add Item' |
|
1868 |
#isButton: true |
|
1869 |
#value: #doCreateItem |
|
1870 |
#activeHelpKey: #addMenuItem |
|
1871 |
#enabled: #hasAnySingleSelection |
|
1872 |
#labelImage: #(#ResourceRetriever nil #menuItemImage) |
|
1873 |
) |
|
1874 |
#(#MenuItem |
|
1875 |
#label: 'Add Separator' |
|
1876 |
#isButton: true |
|
1877 |
#value: #doCreateSep |
|
1878 |
#activeHelpKey: #addMenuSeparator |
|
1879 |
#enabled: #hasAnySingleSelection |
|
1880 |
#labelImage: #(#ResourceRetriever nil #menuSeparatorImage) |
|
1881 |
) |
|
1882 |
#(#MenuItem |
|
1883 |
#label: 'Add Submenu' |
|
1884 |
#isButton: true |
|
1885 |
#value: #doCreateMenu |
|
1886 |
#activeHelpKey: #addSubMenu |
|
1887 |
#enabled: #hasAnySingleSelection |
|
1888 |
#labelImage: #(#ResourceRetriever nil #submenuImage) |
|
1889 |
) |
|
1890 |
#(#MenuItem |
|
1891 |
#label: 'Add Linked Submenu' |
|
1892 |
#isButton: true |
|
1893 |
#value: #doCreateLink |
|
1894 |
#activeHelpKey: #addSubMenuLink |
|
1895 |
#enabled: #hasAnySingleSelection |
|
1896 |
#labelImage: #(#ResourceRetriever nil #linkSubmenuImage) |
|
1897 |
) |
|
1898 |
#(#MenuItem |
|
1899 |
#label: '' |
|
1900 |
) |
|
1901 |
#(#MenuItem |
|
1902 |
#label: 'Move Up' |
|
1903 |
#isButton: true |
|
1904 |
#value: #doStepUp |
|
1905 |
#activeHelpKey: #editMoveUp |
|
1906 |
#enabled: #valueOfEnableMovingUpOrDown |
|
1907 |
#labelImage: #(#ResourceRetriever #Icon #upIcon) |
|
1908 |
) |
|
1909 |
#(#MenuItem |
|
1910 |
#label: 'Move Down' |
|
1911 |
#isButton: true |
|
1912 |
#value: #doStepDown |
|
1913 |
#activeHelpKey: #editMoveDown |
|
1914 |
#enabled: #valueOfEnableMovingUpOrDown |
|
1915 |
#labelImage: #(#ResourceRetriever #Icon #downIcon) |
|
1916 |
) |
|
1917 |
#(#MenuItem |
|
1918 |
#label: 'Move In' |
|
1919 |
#isButton: true |
|
1920 |
#value: #doStepIn |
|
1921 |
#activeHelpKey: #editMoveIn |
|
1922 |
#enabled: #valueOfEnableMovingIn |
|
1923 |
#labelImage: #(#ResourceRetriever #Icon #downRightIcon) |
|
1924 |
) |
|
1925 |
#(#MenuItem |
|
1926 |
#label: 'Move Out' |
|
1927 |
#isButton: true |
|
1928 |
#value: #doStepOut |
|
1929 |
#activeHelpKey: #editMoveOut |
|
1930 |
#enabled: #valueOfEnableMovingOut |
|
1931 |
#labelImage: #(#ResourceRetriever #Icon #leftDownIcon) |
|
1932 |
) |
|
1933 |
) |
|
1934 |
nil |
|
1935 |
nil |
|
525 | 1936 |
) |
1937 |
! ! |
|
1938 |
||
971
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1939 |
!MenuEditor class methodsFor:'queries'! |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1940 |
|
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1941 |
getAllImageSelectorsFrom: aClass |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1942 |
"returns all image selectors implementing an image spec in class aClass" |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1943 |
|
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1944 |
|iconClass imageMethodSelectors r| |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1945 |
|
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1946 |
aClass isNil ifTrue:[ |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1947 |
^ #() |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1948 |
]. |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1949 |
|
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1950 |
aClass isSymbol |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1951 |
ifTrue: [iconClass := Smalltalk at: aClass] |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1952 |
ifFalse: [iconClass := aClass]. |
1020
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
1953 |
aClass isBehavior ifFalse:[ |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
1954 |
^ #() |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
1955 |
]. |
971
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1956 |
|
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1957 |
imageMethodSelectors := OrderedCollection new. |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1958 |
|
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1959 |
iconClass withAllSuperclasses do:[:cls | |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1960 |
cls class methodDictionary keysAndValuesDo: [:sel :m | |
1020
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
1961 |
((r := m resourceType) == #image |
971
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1962 |
or:[r == #programImage]) ifTrue:[ |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1963 |
imageMethodSelectors add:sel |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1964 |
] |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1965 |
] |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1966 |
]. |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1967 |
|
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1968 |
^ imageMethodSelectors asSortedCollection asOrderedCollection |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1969 |
|
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1970 |
"Modified: / 24.8.1998 / 21:42:34 / cg" |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1971 |
"Created: / 24.8.1998 / 21:53:20 / cg" |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1972 |
! ! |
f3b1476f5006
find all images in getAllImageSelectorsFrom: (walk superclass chain)
Claus Gittinger <cg@exept.de>
parents:
970
diff
changeset
|
1973 |
|
525 | 1974 |
!MenuEditor class methodsFor:'slices'! |
1975 |
||
1976 |
slicesItem |
|
1977 |
^#( |
|
1978 |
(Basics basicsItemSpec) |
|
1979 |
(Details detailsEditSpec) |
|
1980 |
(Image imageEditSpec) |
|
1981 |
) |
|
1982 |
||
1983 |
! |
|
1984 |
||
1985 |
slicesLink |
|
1986 |
^#( |
|
1987 |
(Basics basicsLinkSpec) |
|
1988 |
(Details detailsEditSpec) |
|
1989 |
(Image imageEditSpec) |
|
1990 |
) |
|
1991 |
||
1992 |
! |
|
1993 |
||
1994 |
slicesMenu |
|
1995 |
^#( |
|
1996 |
(Basics basicsMenuSpec) |
|
1997 |
(Details detailsEditSpec) |
|
1998 |
(Image imageEditSpec) |
|
1999 |
) |
|
2000 |
||
2001 |
! |
|
2002 |
||
2003 |
slicesRootMenu |
|
2004 |
^#( |
|
2005 |
(Basics basicsRootSpec) |
|
2006 |
) |
|
2007 |
||
2008 |
! |
|
2009 |
||
2010 |
slicesSeparatorMenu |
|
2011 |
^#( |
|
2012 |
(Basics basicsSeparatorSpec) |
|
2013 |
) |
|
2014 |
||
199 | 2015 |
! ! |
2016 |
||
2017 |
!MenuEditor methodsFor:'accessing'! |
|
2018 |
||
218 | 2019 |
submenuTest |
849
0001a9185d99
translate labels in the test-menu.
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
2020 |
"return the submenu assigned to item test; |
0001a9185d99
translate labels in the test-menu.
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
2021 |
this is dynamically constructed, to reflect the current |
0001a9185d99
translate labels in the test-menu.
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
2022 |
edited menu." |
0001a9185d99
translate labels in the test-menu.
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
2023 |
|
0001a9185d99
translate labels in the test-menu.
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
2024 |
|menu cls| |
218 | 2025 |
|
1244 | 2026 |
(menu := treeView asMenu) allItemsDo:[:anItem| |
218 | 2027 |
anItem value:nil. |
2028 |
anItem enabled:true. |
|
2029 |
]. |
|
849
0001a9185d99
translate labels in the test-menu.
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
2030 |
|
0001a9185d99
translate labels in the test-menu.
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
2031 |
cls := self resolveName:specClass. |
0001a9185d99
translate labels in the test-menu.
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
2032 |
menu findGuiResourcesIn:cls. |
0001a9185d99
translate labels in the test-menu.
Claus Gittinger <cg@exept.de>
parents:
836
diff
changeset
|
2033 |
^ menu |
287 | 2034 |
! |
2035 |
||
716 | 2036 |
useHelpTool: aHelpTool |
728 | 2037 |
"take the help dictionaries from aHelpTool into my helpTool" |
407 | 2038 |
|
748 | 2039 |
self helpTool buildFromClass: aHelpTool specClass. |
2040 |
self helpTool dictionaries: aHelpTool dictionaries. |
|
2041 |
self helpTool dictionary: aHelpTool dictionary |
|
1244 | 2042 |
|
2043 |
||
199 | 2044 |
! ! |
2045 |
||
2046 |
!MenuEditor methodsFor:'aspects'! |
|
2047 |
||
220 | 2048 |
hasAnySingleSelection |
407 | 2049 |
|
2050 |
^builder booleanValueAspectFor: #hasAnySingleSelection |
|
220 | 2051 |
! |
2052 |
||
2053 |
hasValidSelection |
|
407 | 2054 |
|
2055 |
^builder booleanValueAspectFor: #hasValidSelection |
|
220 | 2056 |
! |
2057 |
||
879 | 2058 |
listOfImages |
1244 | 2059 |
"get a list of the images |
2060 |
" |
|
2061 |
|list| |
|
2062 |
||
2063 |
(list := builder bindingAt:#listOfImages) isNil ifTrue:[ |
|
2064 |
builder aspectAt:#listOfImages put: (list := List new). |
|
879 | 2065 |
]. |
1244 | 2066 |
^ list |
2067 |
||
2068 |
||
199 | 2069 |
! |
2070 |
||
879 | 2071 |
selectionOfImage |
2072 |
"get selection of list of the images as value" |
|
2073 |
||
2074 |
|holder| |
|
2075 |
(holder := builder bindingAt:#selectionOfImage) isNil ifTrue:[ |
|
2076 |
builder aspectAt:#selectionOfImage put: (holder := nil asValue). |
|
2077 |
]. |
|
2078 |
^ holder |
|
2079 |
||
2080 |
||
2081 |
! |
|
2082 |
||
1244 | 2083 |
tabCanvasHolder |
2084 |
"keep the canvas for the current selected item or nil |
|
2085 |
" |
|
2086 |
|holder| |
|
2087 |
||
2088 |
(holder := builder bindingAt:#tabCanvasHolder) isNil ifTrue:[ |
|
1301 | 2089 |
builder aspectAt:#tabCanvasHolder put: (holder := ValueHolder new). |
1244 | 2090 |
]. |
2091 |
^ holder |
|
2092 |
||
2093 |
||
2094 |
! |
|
2095 |
||
199 | 2096 |
tabList |
728 | 2097 |
"get a value holder with the list of the attribute sections (slices)" |
199 | 2098 |
|
298 | 2099 |
|holder| |
1244 | 2100 |
|
298 | 2101 |
(holder := builder bindingAt:#tabList) isNil ifTrue:[ |
1244 | 2102 |
builder aspectAt:#tabList put:(holder := nil asValue). |
298 | 2103 |
]. |
2104 |
^ holder |
|
2105 |
||
2106 |
||
199 | 2107 |
! |
2108 |
||
407 | 2109 |
treeView |
728 | 2110 |
"get a tree view representing hierarchically the menu items" |
407 | 2111 |
|
1244 | 2112 |
^ treeView |
199 | 2113 |
! ! |
2114 |
||
728 | 2115 |
!MenuEditor methodsFor:'building'! |
2116 |
||
734 | 2117 |
buildFromClass:aClass andSelector:aSelector |
2118 |
||
2119 |
self isStandAlone ifTrue:[ |
|
748 | 2120 |
self helpTool buildFromClass:specClass |
734 | 2121 |
]. |
1244 | 2122 |
treeView buildFromClass: aClass andSelector: aSelector. |
734 | 2123 |
|
2124 |
self updateHistory. |
|
2125 |
self updateInfoLabel. |
|
2126 |
||
2127 |
! |
|
2128 |
||
1244 | 2129 |
buildFromResourceSpec:aResourceSpec |
2130 |
|spec| |
|
2131 |
||
2132 |
spec := aResourceSpec isCollection ifTrue:[aResourceSpec decodeAsLiteralArray] |
|
2133 |
ifFalse:[aResourceSpec]. |
|
2134 |
||
2135 |
self buildFromMenu:spec |
|
728 | 2136 |
! ! |
2137 |
||
199 | 2138 |
!MenuEditor methodsFor:'change & update'! |
2139 |
||
970 | 2140 |
update:something with:aParameter from:changedObject |
2141 |
super update:something with:aParameter from:changedObject. |
|
2142 |
||
2143 |
changedObject == (aspects at:#retriever) ifTrue:[ |
|
1244 | 2144 |
self updateImageView. |
970 | 2145 |
]. |
2146 |
||
2147 |
"Modified: / 24.8.1998 / 21:47:48 / cg" |
|
2148 |
! |
|
2149 |
||
748 | 2150 |
updateChannels |
2151 |
"update channels" |
|
407 | 2152 |
|
1244 | 2153 |
|node parent next state canPaste| |
2154 |
||
412 | 2155 |
state := false. |
1244 | 2156 |
node := treeView selectedNode. |
2157 |
||
2158 |
node notNil ifTrue:[ |
|
220 | 2159 |
self hasAnySingleSelection value:true. |
1244 | 2160 |
canPaste := self valueOfCanPaste value. |
2161 |
||
2162 |
(parent := node parent) notNil ifTrue:[ |
|
220 | 2163 |
next := parent childAt:((parent indexOfChild:node) + 1). |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2164 |
self valueOfEnableMovingIn value:(next notNil and:[next hasChildren]). |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2165 |
self valueOfEnableMovingUpOrDown value:(parent children size > 1). |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2166 |
self valueOfEnableMovingOut value:parent parent notNil. |
748 | 2167 |
self hasValidSelection value:true. |
1244 | 2168 |
self valueOfCanPaste value:canPaste. |
2169 |
^ self |
|
2170 |
]. |
|
2171 |
] ifFalse:[ |
|
2172 |
canPaste := false. |
|
2173 |
||
220 | 2174 |
self hasAnySingleSelection value:false. |
1244 | 2175 |
|
2176 |
treeView numberOfSelections ~~ 0 ifTrue:[ |
|
2177 |
canPaste := false. |
|
2178 |
state := (treeView isInSelection:1) not |
|
220 | 2179 |
] |
407 | 2180 |
]. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2181 |
self valueOfEnableMovingUpOrDown value:false. |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2182 |
self valueOfEnableMovingIn value:false. |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2183 |
self valueOfEnableMovingOut value:false. |
748 | 2184 |
self hasValidSelection value:state. |
1244 | 2185 |
self valueOfCanPaste value:canPaste. |
879 | 2186 |
|
2187 |
! |
|
2188 |
||
1244 | 2189 |
updateImageView |
2190 |
"update the image view |
|
2191 |
" |
|
2192 |
|cls newList icon| |
|
2193 |
||
2194 |
self isImageViewSelected ifFalse:[ |
|
2195 |
^ self |
|
902 | 2196 |
]. |
1244 | 2197 |
cls := self currentImageRetrieverClass. |
2198 |
||
2199 |
lastImageRetriever == cls ifTrue:[ |
|
2200 |
newList := self listOfImages |
|
2201 |
] ifFalse:[ |
|
2202 |
cls notNil ifTrue:[ |
|
2203 |
lastImageRetriever := cls. |
|
2204 |
||
2205 |
newList := self class getAllImageSelectorsFrom:cls. |
|
2206 |
newList := newList collect: [:sel| |img| |
|
2207 |
img := cls perform: sel. |
|
2208 |
img height > 22 ifTrue:[ |
|
2209 |
img := img magnifiedBy: 22 / img extent y |
|
2210 |
]. |
|
2211 |
LabelAndIcon icon:img string:sel |
|
2212 |
]. |
|
2213 |
] ifFalse:[ |
|
2214 |
newList := #() |
|
2215 |
]. |
|
2216 |
self listOfImages contents:newList. |
|
2217 |
]. |
|
2218 |
||
2219 |
icon := (aspects at:#icon) value. |
|
2220 |
||
2221 |
icon notNil ifTrue:[ |
|
2222 |
icon := newList detect:[:el| el string == icon] ifNone:nil. |
|
2223 |
]. |
|
2224 |
self selectionOfImage value:icon. |
|
2225 |
||
879 | 2226 |
|
220 | 2227 |
! ! |
2228 |
||
916 | 2229 |
!MenuEditor methodsFor:'defaults'! |
2230 |
||
2231 |
aboutImage |
|
2232 |
"the image to be displayed in my about-box; |
|
2233 |
If nil is returned, thhe ST/X default image is used." |
|
2234 |
||
2235 |
^ Image fromFile:'bitmaps/xpmBitmaps/misc_tools/setup_menus.xpm' |
|
2236 |
||
2237 |
"Created: / 25.7.1998 / 20:48:12 / cg" |
|
2238 |
"Modified: / 27.7.1998 / 10:21:55 / cg" |
|
2239 |
! ! |
|
2240 |
||
220 | 2241 |
!MenuEditor methodsFor:'event handling'! |
2242 |
||
407 | 2243 |
doesNotUnderstand: aMessage |
2244 |
"detour incoming messages to the tree view" |
|
2245 |
||
1244 | 2246 |
^ aMessage sendTo:treeView |
199 | 2247 |
! ! |
2248 |
||
287 | 2249 |
!MenuEditor methodsFor:'private'! |
2250 |
||
1244 | 2251 |
currentImageRetrieverClass |
2252 |
"returns the current class which provides the images dependent on |
|
2253 |
the retriver or the current spec. |
|
2254 |
" |
|
2255 |
|clsName| |
|
2256 |
||
2257 |
clsName := (aspects at: #retriever) value. |
|
2258 |
||
2259 |
clsName size == 0 ifTrue:[ |
|
2260 |
clsName := specClass |
|
2261 |
]. |
|
2262 |
^ Smalltalk at:clsName ifAbsent:nil |
|
2263 |
! |
|
2264 |
||
287 | 2265 |
helpKey |
728 | 2266 |
"get the help key of the selected menu item" |
407 | 2267 |
|
287 | 2268 |
|node| |
1244 | 2269 |
|
2270 |
(node := treeView selectedNode) notNil ifTrue:[ |
|
287 | 2271 |
^ node contents activeHelpKey |
2272 |
]. |
|
2273 |
^ nil |
|
2274 |
! |
|
2275 |
||
2276 |
helpTool |
|
1244 | 2277 |
"get the help tool application |
2278 |
" |
|
2279 |
|helpView helpTool| |
|
2280 |
||
2281 |
helpTool := listOfCanvas at:#help ifAbsent:nil. |
|
2282 |
||
2283 |
helpTool isNil ifTrue:[ |
|
2284 |
helpTool := UIHelpTool new createBuilder. |
|
2285 |
helpTool masterApplication:self. |
|
2286 |
helpTool modifiedHolder: self valueOfEnablingCommitButtons. |
|
2287 |
helpView := View new client:helpTool. |
|
2288 |
helpTool builder window:helpView. |
|
2289 |
listOfCanvas at:#help put:helpTool. |
|
2290 |
]. |
|
2291 |
^ helpTool |
|
2292 |
||
2293 |
||
287 | 2294 |
! ! |
2295 |
||
199 | 2296 |
!MenuEditor methodsFor:'queries'! |
2297 |
||
2298 |
isHelpToolSelected |
|
1244 | 2299 |
"return true if current selection is help tool |
2300 |
" |
|
2301 |
^ typeOfCanvas == #help |
|
2302 |
||
2303 |
! |
|
2304 |
||
2305 |
isImageViewSelected |
|
2306 |
"return true if current selection is help tool |
|
2307 |
" |
|
2308 |
^ typeOfCanvas == #imageEditSpec |
|
2309 |
||
287 | 2310 |
! |
2311 |
||
535 | 2312 |
preferredExtent |
2313 |
||
2314 |
^super preferredExtent max: (Screen current width//3)@(Screen current height//2.5) |
|
2315 |
||
2316 |
||
199 | 2317 |
! ! |
2318 |
||
2319 |
!MenuEditor methodsFor:'selection'! |
|
2320 |
||
879 | 2321 |
imageSelected |
1078
84683b5a6979
oops - care for non-existing selection
Claus Gittinger <cg@exept.de>
parents:
1069
diff
changeset
|
2322 |
|imgSel| |
84683b5a6979
oops - care for non-existing selection
Claus Gittinger <cg@exept.de>
parents:
1069
diff
changeset
|
2323 |
|
84683b5a6979
oops - care for non-existing selection
Claus Gittinger <cg@exept.de>
parents:
1069
diff
changeset
|
2324 |
imgSel := self selectionOfImage value. |
84683b5a6979
oops - care for non-existing selection
Claus Gittinger <cg@exept.de>
parents:
1069
diff
changeset
|
2325 |
imgSel notNil ifTrue:[ |
84683b5a6979
oops - care for non-existing selection
Claus Gittinger <cg@exept.de>
parents:
1069
diff
changeset
|
2326 |
(aspects at: #icon) value: imgSel string |
84683b5a6979
oops - care for non-existing selection
Claus Gittinger <cg@exept.de>
parents:
1069
diff
changeset
|
2327 |
] |
879 | 2328 |
! |
2329 |
||
199 | 2330 |
menuChanged |
407 | 2331 |
|
1244 | 2332 |
|node item myClass oldLabel oldSlices newList index| |
2333 |
||
2334 |
node := treeView selectedNode. |
|
2335 |
||
2336 |
node isNil ifTrue:[ |
|
2337 |
slices := nil. |
|
2338 |
index := 0. |
|
2339 |
] ifFalse:[ |
|
2340 |
oldSlices := slices. |
|
2341 |
myClass := self class. |
|
2342 |
item := node contents. |
|
2343 |
||
218 | 2344 |
item isSeparator ifFalse:[ |
199 | 2345 |
node parent isNil ifFalse:[ |
218 | 2346 |
node hasChildren ifTrue:[ |
1244 | 2347 |
slices := #slicesMenu |
218 | 2348 |
] ifFalse:[ |
1244 | 2349 |
item submenuChannel isNil ifTrue:[slices := #slicesItem] |
2350 |
ifFalse:[slices := #slicesLink] |
|
218 | 2351 |
]. |
1244 | 2352 |
slices := listOfSlices at:slices |
2353 |
ifAbsentPut:[(myClass perform:slices) copyWith:#('Help' #help)]. |
|
199 | 2354 |
] ifTrue:[ |
1244 | 2355 |
slices := listOfSlices at:#slicesRootMenu |
2356 |
ifAbsentPut:[myClass perform:#slicesRootMenu]. |
|
287 | 2357 |
]. |
199 | 2358 |
] ifTrue:[ |
1244 | 2359 |
slices := myClass perform:#slicesSeparatorMenu. |
287 | 2360 |
]. |
1244 | 2361 |
index := tabSelection ? 0. |
2362 |
||
2363 |
slices ~~ oldSlices ifTrue:[ |
|
1322 | 2364 |
tabSelection := 0. |
2365 |
typeOfCanvas := 0. |
|
2366 |
||
2367 |
self tabCanvasHolder value:nil. |
|
2368 |
||
1244 | 2369 |
newList := slices collect:[:el| el first]. |
2370 |
||
2371 |
index ~~ 0 ifTrue:[ |
|
2372 |
oldLabel := self tabList value at:index ifAbsent:nil. |
|
2373 |
||
2374 |
oldLabel notNil ifTrue:[ |
|
2375 |
index := newList indexOf:oldLabel. |
|
2376 |
] |
|
287 | 2377 |
]. |
1244 | 2378 |
self tabList value:newList. |
2379 |
]. |
|
2380 |
index := index max:1. |
|
199 | 2381 |
]. |
1244 | 2382 |
self tabModel value:index. |
1246 | 2383 |
aspects do:[:a| a removeDependent:self]. |
2384 |
self cancel. |
|
748 | 2385 |
self updateChannels. |
1246 | 2386 |
aspects do:[:a| a addDependent:self]. |
1244 | 2387 |
|
199 | 2388 |
! |
2389 |
||
1301 | 2390 |
tabSelection:aSelection |
1244 | 2391 |
"put the section aSelection into the note book |
2392 |
" |
|
1301 | 2393 |
|view spec| |
2394 |
||
1322 | 2395 |
aSelection = tabSelection ifTrue:[^self]. |
1301 | 2396 |
|
2397 |
(tabSelection := aSelection) isNil ifTrue:[ |
|
2398 |
tabSelection == 0 ifTrue:[^ self]. |
|
2399 |
tabSelection := 0. |
|
199 | 2400 |
]. |
1256
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2401 |
|
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2402 |
"/ before bringing up the new notebook page, |
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2403 |
"/ we must disable all now invisible input fields ... |
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2404 |
"/ (otherwise, those would fire on #accept. |
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2405 |
|
1301 | 2406 |
(view := self tabCanvasHolder value) notNil ifTrue:[ |
2407 |
view allSubViewsDo:[:aComponent | |
|
1256
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2408 |
aComponent isInputField ifTrue:[ |
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2409 |
aComponent disableIfInvisible:true |
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2410 |
] |
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2411 |
] |
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2412 |
]. |
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2413 |
|
1301 | 2414 |
tabSelection == 0 ifTrue:[ |
2415 |
^ self tabCanvasHolder value:nil. |
|
2416 |
]. |
|
2417 |
||
2418 |
typeOfCanvas := (slices at:tabSelection) last. |
|
2419 |
||
2420 |
self isHelpToolSelected ifTrue:[ |
|
2421 |
view := self helpTool window. |
|
2422 |
] ifFalse:[ |
|
2423 |
self updateImageView. |
|
2424 |
||
2425 |
view := listOfCanvas at:typeOfCanvas |
|
2426 |
ifAbsentPut:[SimpleView new client:self spec:typeOfCanvas builder:(self builder)]. |
|
2427 |
]. |
|
1256
38ff328f119b
care for hidden editFields with acceptChannel
Claus Gittinger <cg@exept.de>
parents:
1250
diff
changeset
|
2428 |
self tabCanvasHolder value:view. |
1244 | 2429 |
|
199 | 2430 |
! ! |
2431 |
||
2432 |
!MenuEditor methodsFor:'startup / release'! |
|
2433 |
||
738 | 2434 |
initialize |
2435 |
"initialize value holders for the attributes of the menu components" |
|
2436 |
||
2437 |
|holder| |
|
2438 |
||
2439 |
super initialize. |
|
2440 |
||
2441 |
aspects at:#seperatorSelection put:(holder := SelectionInList new). |
|
2442 |
holder list: Item separatorList. |
|
872
eb3bd8e609f1
must create builder early - req'd.
Claus Gittinger <cg@exept.de>
parents:
860
diff
changeset
|
2443 |
holder addDependent:self. |
eb3bd8e609f1
must create builder early - req'd.
Claus Gittinger <cg@exept.de>
parents:
860
diff
changeset
|
2444 |
|
1244 | 2445 |
listOfCanvas := IdentityDictionary new. |
2446 |
listOfSlices := IdentityDictionary new. |
|
2447 |
||
2448 |
treeView := TreeView new. |
|
2449 |
treeView action:[:dummy| self menuChanged ]. |
|
2450 |
||
953
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
2451 |
aspects at:#indicationEnabled put:(BlockValue |
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
2452 |
with:[:a | a size == 0] |
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
2453 |
argument:(aspects at:#choice)). |
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
2454 |
aspects at:#choiceEnabled put:(BlockValue |
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
2455 |
with:[:a | a size == 0] |
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
2456 |
argument:(aspects at:#indication)). |
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
2457 |
aspects at:#choiceValueEnabled put:(BlockValue |
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
2458 |
with:[:a | a size > 0] |
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
2459 |
argument:(aspects at:#choice)). |
1aecad8bf33a
added choice type menu items (i.e. radioButton behavior)
Claus Gittinger <cg@exept.de>
parents:
943
diff
changeset
|
2460 |
|
1020
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2461 |
aspects at:#retrieverClassList put:self class defaultRetrieverClassList asValue. |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2462 |
|
1244 | 2463 |
aspects do: [:holder| holder addDependent:self]. |
2464 |
||
738 | 2465 |
! |
2466 |
||
728 | 2467 |
openModalOnMenu: aMenu |
734 | 2468 |
"build a tree from aMenu and open it modal" |
728 | 2469 |
|
738 | 2470 |
super openModalOnResourceSpec: aMenu |
1250 | 2471 |
! |
2472 |
||
2473 |
postOpenWith:aBuilder |
|
2474 |
"reset keyboardProcessor for menuBar |
|
2475 |
" |
|
2476 |
super postOpenWith: aBuilder. |
|
2477 |
aBuilder keyboardProcessor menuBar:nil. |
|
199 | 2478 |
! ! |
2479 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2480 |
!MenuEditor methodsFor:'user actions'! |
199 | 2481 |
|
407 | 2482 |
accept |
2483 |
"invoked by button 'OK' and by save requests of menu item changes" |
|
2484 |
||
1244 | 2485 |
|node item| |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2486 |
|
637 | 2487 |
super accept. |
2488 |
||
1244 | 2489 |
(node := treeView selectedNode) notNil ifTrue:[ |
2490 |
item := node contents. |
|
2491 |
||
1062 | 2492 |
self isHelpToolSelected ifTrue:[ |
407 | 2493 |
self helpTool accept. |
1244 | 2494 |
item activeHelpKey: self helpTool helpKey. |
686 | 2495 |
self valueOfEnablingCommitButtons value: false. |
1189
0e7e286f864c
code cleanup; care for non-string argument
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
2496 |
self clearModifiedFlag. |
1062 | 2497 |
] ifFalse:[ |
1244 | 2498 |
item buildFromAspects:aspects. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2499 |
node changed. |
1244 | 2500 |
specSelector := treeView selectorName. |
407 | 2501 |
] |
734 | 2502 |
]. |
879 | 2503 |
self updateInfoLabel. |
1155 | 2504 |
|
407 | 2505 |
! |
2506 |
||
2507 |
cancel |
|
2508 |
"invoked by button 'Cancel'" |
|
1244 | 2509 |
|node item| |
2510 |
||
2511 |
node := treeView selectedNode. |
|
2512 |
||
2513 |
aspects keysAndValuesDo:[:aKey :anAspect| |
|
2514 |
aKey ~~ #retrieverClassList ifTrue:[ |
|
2515 |
anAspect setValue:''. "/ to clear the field. |
|
2516 |
anAspect value:'' |
|
2517 |
] |
|
407 | 2518 |
]. |
1244 | 2519 |
|
2520 |
node notNil ifTrue:[ |
|
2521 |
item := node contents. |
|
2522 |
item toAspects:aspects. |
|
2523 |
self helpTool helpKey:(item activeHelpKey). |
|
2524 |
]. |
|
2525 |
self updateImageView. |
|
2526 |
self valueOfEnablingCommitButtons value:false. |
|
1189
0e7e286f864c
code cleanup; care for non-string argument
Claus Gittinger <cg@exept.de>
parents:
1155
diff
changeset
|
2527 |
self clearModifiedFlag. |
407 | 2528 |
! |
2529 |
||
1020
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2530 |
doBrowseForImageResource |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2531 |
"opens a browser on image-resource methods" |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2532 |
|
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2533 |
|msg currClass w cls sel| |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2534 |
|
1244 | 2535 |
currClass := self currentImageRetrieverClass. |
1020
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2536 |
msg := |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2537 |
(ResourceSelectionBrowser |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2538 |
request: 'Use Image From Class' |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2539 |
onSuperclass: nil |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2540 |
andClass: currClass |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2541 |
andSelector: (aspects at: #icon) |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2542 |
withResourceTypes: #(image fileImage programImage)). |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2543 |
|
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2544 |
msg notNil ifTrue:[ |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2545 |
(w := msg asCollectionOfWords) size == 2 ifTrue:[ |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2546 |
cls := w at:1. |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2547 |
sel := w at:2. |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2548 |
cls ~= currClass ifTrue:[ |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2549 |
(aspects at: #retriever) value:cls asSymbol. |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2550 |
]. |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2551 |
sel ~= (aspects at:#icon) ifTrue:[ |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2552 |
(aspects at: #icon) value:sel asSymbol. |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2553 |
]. |
1244 | 2554 |
self updateImageView. |
1020
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2555 |
]. |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2556 |
]. |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2557 |
|
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2558 |
|
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2559 |
! |
dcfbf3acb037
added browsing capability to image section.
Claus Gittinger <cg@exept.de>
parents:
1007
diff
changeset
|
2560 |
|
879 | 2561 |
doEditImage |
888 | 2562 |
"opens a Image Editor on the resource retriever and the icon selector; |
2563 |
then updates the list of images and select the line of the image" |
|
879 | 2564 |
|
2565 |
super doEditImage. |
|
1244 | 2566 |
lastImageRetriever := nil. |
2567 |
self updateImageView. |
|
879 | 2568 |
! |
2569 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2570 |
doNew |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2571 |
|
748 | 2572 |
super doNew ifTrue: [self helpTool doNew] |
199 | 2573 |
! |
2574 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2575 |
doPickAMenu |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2576 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2577 |
|view| |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2578 |
|
1244 | 2579 |
self askForModification ifTrue:[ |
2580 |
((view := Screen current viewFromUser) isNil or: |
|
2581 |
[view == Screen current rootView]) ifTrue:[ |
|
2582 |
^ self |
|
2583 |
]. |
|
2584 |
view specClass == MenuPanelSpec ifTrue:[ |
|
2585 |
^ treeView buildFromMenu: view asMenu |
|
2586 |
]. |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2587 |
]. |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2588 |
^ nil |
381 | 2589 |
! |
2590 |
||
888 | 2591 |
doRemoveImage |
2592 |
"removes the image of the selected line" |
|
1244 | 2593 |
|cls sel| |
2594 |
||
2595 |
sel := self selectionOfImage value. |
|
2596 |
||
2597 |
sel size ~~ 0 ifTrue:[ |
|
2598 |
cls := self currentImageRetrieverClass. |
|
2599 |
cls notNil ifTrue:[ |
|
2600 |
cls class removeSelector:(sel string) |
|
2601 |
]. |
|
2602 |
(aspects at:#icon) value:nil. |
|
2603 |
lastImageRetriever := nil. |
|
2604 |
self updateImageView. |
|
888 | 2605 |
] |
2606 |
! |
|
2607 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2608 |
doSave |
1244 | 2609 |
|cls menu spec mthd category code excla| |
199 | 2610 |
|
642 | 2611 |
super doSave ifFalse: [^nil]. |
637 | 2612 |
|
1244 | 2613 |
cls := self resolveName: specClass. |
2614 |
menu := treeView asMenu literalArrayEncoding. |
|
199 | 2615 |
spec := WriteStream on:String new. |
2616 |
UISpecification prettyPrintSpecArray:menu on:spec indent:5. |
|
2617 |
spec := spec contents. |
|
2618 |
||
2619 |
"/ if that method already exists, do not overwrite the category |
|
2620 |
||
576 | 2621 |
category := 'menu specs'. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2622 |
(mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[ |
199 | 2623 |
category := mthd category. |
2624 |
]. |
|
2625 |
||
764 | 2626 |
excla := Character excla asString. |
2627 |
||
2628 |
code := excla |
|
654
45cc74ba1113
simplified comma-expression to make microsoft-cc happy
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2629 |
, (cls name , ' class methodsFor:' , category storeString) |
764 | 2630 |
, excla , '\\' |
199 | 2631 |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2632 |
, specSelector , '\' |
738 | 2633 |
, (self class codeGenerationComment replChar:$!! withString:'!!!!') |
2634 |
, '\\ "\' |
|
654
45cc74ba1113
simplified comma-expression to make microsoft-cc happy
Claus Gittinger <cg@exept.de>
parents:
642
diff
changeset
|
2635 |
, (' 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
|
2636 |
, (' (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , specSelector , ')) startUp\') |
199 | 2637 |
, ' "\'. |
2638 |
||
2639 |
code := code |
|
2640 |
, '\' |
|
2641 |
, ' <resource: #menu>\\' |
|
1083 | 2642 |
, ' ^ ' , spec |
199 | 2643 |
, '\' |
764 | 2644 |
, (excla , ' ' , excla) |
199 | 2645 |
, '\\'. |
2646 |
||
2647 |
code := code withCRs. |
|
2648 |
(ReadStream on:code) fileIn. |
|
2649 |
||
764 | 2650 |
self isStandAlone ifTrue: [self helpTool installHelpSpecsOnClass:self specClass]. |
699 | 2651 |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2652 |
self updateHistory. |
748 | 2653 |
self updateInfoLabel. |
2654 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2655 |
hasSaved := true. |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2656 |
modified := false. |
218 | 2657 |
|
199 | 2658 |
! |
2659 |
||
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2660 |
doSaveAs |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2661 |
|
1244 | 2662 |
super doSaveAs ifTrue: [treeView selectorName:specSelector] |
218 | 2663 |
! |
199 | 2664 |
|
218 | 2665 |
doStepDown |
407 | 2666 |
"shift selected menu item one step down" |
2667 |
||
1244 | 2668 |
treeView selectedNodeChangeSequenceOrder:1. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2669 |
modified := true. |
398 | 2670 |
|
2671 |
||
2672 |
||
2673 |
||
218 | 2674 |
! |
2675 |
||
2676 |
doStepIn |
|
407 | 2677 |
"move selected menu item into next submenu" |
2678 |
||
1244 | 2679 |
treeView selectedNodeBecomeChildOfNext. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2680 |
modified := true. |
398 | 2681 |
|
2682 |
||
2683 |
||
2684 |
||
199 | 2685 |
|
218 | 2686 |
! |
199 | 2687 |
|
218 | 2688 |
doStepOut |
407 | 2689 |
"move selected menu item out from parent submenu" |
2690 |
||
1244 | 2691 |
treeView selectedNodeBecomeSisterOfParent. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2692 |
modified := true. |
218 | 2693 |
! |
2694 |
||
2695 |
doStepUp |
|
407 | 2696 |
"shift selected menu item one step up" |
2697 |
||
1244 | 2698 |
treeView selectedNodeChangeSequenceOrder:-1. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2699 |
modified := true. |
199 | 2700 |
! ! |
2701 |
||
407 | 2702 |
!MenuEditor::TreeView class methodsFor:'documentation'! |
199 | 2703 |
|
2704 |
documentation |
|
2705 |
" |
|
734 | 2706 |
This tree view class provides a hierarchical representation |
2707 |
of the components of a menu. |
|
199 | 2708 |
|
2709 |
[see also:] |
|
2710 |
SelectionInTreeView |
|
213 | 2711 |
SelectionInTree |
2712 |
TreeItem |
|
199 | 2713 |
|
2714 |
[author:] |
|
2715 |
Claus Atzkern |
|
2716 |
" |
|
2717 |
! ! |
|
2718 |
||
407 | 2719 |
!MenuEditor::TreeView methodsFor:'accessing'! |
199 | 2720 |
|
1322 | 2721 |
canTab |
2722 |
^ true |
|
2723 |
! |
|
2724 |
||
199 | 2725 |
selectorName |
734 | 2726 |
"get the selector of the menu spec" |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2727 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2728 |
^(listOfNodes first contents label) asSymbol |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2729 |
! |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2730 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2731 |
selectorName: aSymbol |
734 | 2732 |
"set the selector for the menu spec" |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2733 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2734 |
listOfNodes first contents label: aSymbol |
199 | 2735 |
! ! |
2736 |
||
407 | 2737 |
!MenuEditor::TreeView methodsFor:'building'! |
199 | 2738 |
|
637 | 2739 |
buildFromClass:aClass andSelector:aSelector |
734 | 2740 |
"read a menu spec from aClass and aSelector and put |
2741 |
the encoded menu into the tree view" |
|
407 | 2742 |
|
728 | 2743 |
|spec cls menu firstNode firstNodeLabel| |
2744 |
||
2745 |
"if opened on a menu" |
|
2746 |
(aClass isNil and: [aSelector isNil and: [listOfNodes size > 0]]) ifTrue: [^nil]. |
|
199 | 2747 |
|
1244 | 2748 |
self selection:nil. |
2749 |
||
199 | 2750 |
(aClass notNil and:[aSelector notNil]) ifTrue:[ |
340 | 2751 |
cls := self application resolveName:aClass. |
199 | 2752 |
|
2753 |
(cls respondsTo:aSelector) ifTrue:[ |
|
2754 |
spec := cls perform:aSelector |
|
2755 |
] |
|
2756 |
]. |
|
331 | 2757 |
|
199 | 2758 |
spec isNil ifFalse:[ |
298 | 2759 |
(spec isMemberOf:Menu) ifFalse:[ |
2760 |
menu := Menu new fromLiteralArrayEncoding:spec. |
|
2761 |
] ifTrue:[ |
|
2762 |
menu := spec. |
|
2763 |
]. |
|
728 | 2764 |
firstNode := self nodeLabel:(aSelector asString). |
2765 |
self subMenu:menu parent:firstNode. |
|
199 | 2766 |
] ifTrue:[ |
728 | 2767 |
(aClass notNil and: [aSelector isNil and: [listOfNodes size > 0]]) |
2768 |
ifTrue: |
|
2769 |
[ |
|
2770 |
firstNode := listOfNodes first |
|
2771 |
] |
|
2772 |
ifFalse: |
|
2773 |
[ |
|
2774 |
aSelector notNil ifTrue:[firstNodeLabel := aSelector asString] |
|
2775 |
ifFalse:[firstNodeLabel := 'menu']. |
|
2776 |
firstNode := self nodeLabel:firstNodeLabel. |
|
2777 |
] |
|
199 | 2778 |
]. |
734 | 2779 |
|
728 | 2780 |
firstNode expand. |
2781 |
model root: firstNode. |
|
2782 |
||
2783 |
firstNode hasChildren ifFalse:[ |
|
775 | 2784 |
model add:(self nodeLabel:'Item 1') below:firstNode |
199 | 2785 |
]. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2786 |
|
199 | 2787 |
|
2788 |
! |
|
2789 |
||
2790 |
buildFromMenu:aMenu |
|
734 | 2791 |
"put aMenu into the tree view" |
199 | 2792 |
|
249 | 2793 |
|node| |
199 | 2794 |
|
1244 | 2795 |
self selection:nil. |
2796 |
||
213 | 2797 |
node := self nodeLabel:'menu'. |
199 | 2798 |
self subMenu:aMenu parent:node. |
2799 |
||
2800 |
node hasChildren ifFalse:[ |
|
728 | 2801 |
node add:(self nodeLabel:'Item 1') |
199 | 2802 |
]. |
213 | 2803 |
node expand. |
199 | 2804 |
model root:node. |
2805 |
! |
|
2806 |
||
213 | 2807 |
menuItem:anItem |
199 | 2808 |
|
249 | 2809 |
|node| |
199 | 2810 |
|
407 | 2811 |
node := self nodeLabel: anItem label. |
199 | 2812 |
node contents buildFromMenuItem:anItem. |
407 | 2813 |
self subMenu: anItem submenu parent:node. |
2814 |
^node. |
|
199 | 2815 |
|
2816 |
||
2817 |
! |
|
2818 |
||
2819 |
subMenu:aMenu parent:aParent |
|
407 | 2820 |
|
213 | 2821 |
|idx grp| |
199 | 2822 |
|
2823 |
aMenu isNil ifFalse:[ |
|
2824 |
grp := aMenu groupSizes. |
|
213 | 2825 |
aMenu itemsDo:[:i| aParent add:(self menuItem:i)]. |
199 | 2826 |
|
2827 |
grp notNil ifTrue:[ |
|
213 | 2828 |
idx := 0. |
199 | 2829 |
|
2830 |
grp do:[:i| |
|
213 | 2831 |
idx := idx + i + 1. |
2832 |
aParent add:(self nodeLabel:nil) beforeIndex:idx. |
|
199 | 2833 |
] |
2834 |
] |
|
2835 |
] |
|
2836 |
! ! |
|
2837 |
||
407 | 2838 |
!MenuEditor::TreeView methodsFor:'conversion'! |
199 | 2839 |
|
2840 |
asMenu |
|
2841 |
|menu root| |
|
2842 |
||
2843 |
root := self root. |
|
2844 |
||
2845 |
root hasChildren ifTrue:[ |
|
2846 |
menu := Menu new. |
|
2847 |
root children do:[:aChild| menu addItem:(self asMenuItem:aChild)]. |
|
2848 |
]. |
|
2849 |
^ menu |
|
2850 |
! |
|
2851 |
||
2852 |
asMenuItem:aNode |
|
2853 |
||
2854 |
|menu item| |
|
2855 |
||
2856 |
item := aNode contents asMenuItem. |
|
2857 |
||
2858 |
aNode hasChildren ifTrue:[ |
|
2859 |
menu := Menu new. |
|
2860 |
aNode children do:[:aChild| menu addItem:(self asMenuItem:aChild)]. |
|
2861 |
item submenu:menu |
|
2862 |
]. |
|
2863 |
^ item |
|
2864 |
||
2865 |
! ! |
|
2866 |
||
407 | 2867 |
!MenuEditor::TreeView methodsFor:'drawing basics'! |
199 | 2868 |
|
853 | 2869 |
redrawLabelAt:x y:yTop index:anIndex |
407 | 2870 |
"draw text label assigned to a node at x y( center)" |
2871 |
||
1067 | 2872 |
|isSelected y0 x0 x1 w type item| |
199 | 2873 |
|
2874 |
item := (listOfNodes at:anIndex) contents. |
|
218 | 2875 |
type := item separatorType. |
199 | 2876 |
|
218 | 2877 |
type isNil ifTrue:[ |
853 | 2878 |
^ super redrawLabelAt:x y:yTop index:anIndex |
2879 |
]. |
|
2880 |
isSelected := self isInSelection:anIndex. |
|
854 | 2881 |
x0 := x. |
853 | 2882 |
|
2883 |
highlightMode == #label ifTrue:[ |
|
2884 |
x0 := x + 4. |
|
2885 |
||
2886 |
isSelected ifTrue:[ |
|
2887 |
w := 80 + 8. |
|
2888 |
self paint:hilightBgColor. |
|
2889 |
self fillRectangleX:x y:yTop width:w height:fontHeight. |
|
2890 |
] |
|
218 | 2891 |
] ifFalse:[ |
853 | 2892 |
w := 0. |
2893 |
]. |
|
2894 |
type == #blank ifFalse:[ |
|
2895 |
isSelected ifTrue:[self paint:hilightFgColor] |
|
2896 |
ifFalse:[self paint:fgColor]. |
|
2897 |
||
2898 |
x1 := x0 + 80. |
|
2899 |
y0 := yTop - 1 + (fontHeight // 2). |
|
2900 |
self displayLineFromX:x0 y:y0 toX:x1 y:y0. |
|
2901 |
||
2902 |
type == #double ifTrue:[ |
|
2903 |
y0 := y0 + 2. |
|
2904 |
self displayLineFromX:x0 y:y0 toX:x1 y:y0. |
|
2905 |
] |
|
2906 |
]. |
|
2907 |
||
2908 |
(isSelected and:[highlightMode == #label]) ifTrue:[ |
|
2909 |
self redrawSelFrameAtX:x y:yTop toX:(x + w) |
|
2910 |
]. |
|
2911 |
||
199 | 2912 |
! ! |
2913 |
||
407 | 2914 |
!MenuEditor::TreeView methodsFor:'event handling'! |
356 | 2915 |
|
2916 |
keyPress:key x:x y:y |
|
407 | 2917 |
"invoked if any key was pressed" |
2918 |
||
412 | 2919 |
<resource: #keyboard (#Delete #BackSpace #Cut #Copy #Paste)> |
2920 |
||
686 | 2921 |
(key == #Delete or:[key == #BackSpace]) ifTrue: [^self doDelete]. |
748 | 2922 |
key == #Cut ifTrue:[^self doCut]. |
407 | 2923 |
key == #Copy ifTrue:[^self doCopy]. |
2924 |
key == #Paste ifTrue:[^self doPaste]. |
|
356 | 2925 |
|
412 | 2926 |
super keyPress:key x:x y:y |
356 | 2927 |
|
2928 |
! ! |
|
2929 |
||
407 | 2930 |
!MenuEditor::TreeView methodsFor:'initialization'! |
199 | 2931 |
|
2932 |
initialize |
|
734 | 2933 |
"initialize the tree view of the menu components" |
407 | 2934 |
|
199 | 2935 |
super initialize. |
275 | 2936 |
|
213 | 2937 |
self multipleSelectOk:true. |
407 | 2938 |
self showDirectoryIndicator: true. |
2939 |
self showDirectoryIndicatorForRoot: false. |
|
634 | 2940 |
self selectConditionBlock: [:i|self application askForItemModification]. |
412 | 2941 |
self validateDoubleClickBlock: [:node| node ~~ listOfNodes first]. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2942 |
self model iconAction: [:aNode| aNode contents iconFor: aNode]. |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2943 |
self model labelAction: [:aNode| aNode contents treeViewLabel] |
199 | 2944 |
! ! |
2945 |
||
407 | 2946 |
!MenuEditor::TreeView methodsFor:'menus'! |
199 | 2947 |
|
2948 |
doCopy |
|
912 | 2949 |
|clip| |
398 | 2950 |
|
213 | 2951 |
self hasSelection ifTrue:[ |
912 | 2952 |
self application clipboard:(clip := OrderedCollection new). |
2953 |
self selectionDo:[:i | clip add:((listOfNodes at:i) copy)]. |
|
748 | 2954 |
self topView application updateAllToolInstances. |
213 | 2955 |
] |
199 | 2956 |
! |
2957 |
||
2958 |
doCreateItem |
|
398 | 2959 |
|
557 | 2960 |
self addElement: (self nodeLabel:'Item') |
199 | 2961 |
! |
2962 |
||
218 | 2963 |
doCreateLink |
407 | 2964 |
|
218 | 2965 |
|node item| |
2966 |
||
557 | 2967 |
node := self nodeLabel:'Submenu Link'. |
218 | 2968 |
item := node contents. |
2969 |
item submenuChannel:#menuDefaultLink. |
|
398 | 2970 |
self addElement:node. |
2971 |
self setModified. |
|
218 | 2972 |
|
2973 |
||
2974 |
! |
|
2975 |
||
199 | 2976 |
doCreateMenu |
398 | 2977 |
|
199 | 2978 |
|node| |
557 | 2979 |
node := self nodeLabel:'Submenu'. |
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
2980 |
node parent: self selectedNode. |
557 | 2981 |
node add:(self nodeLabel:'Item 1'). |
213 | 2982 |
self addElement:node |
199 | 2983 |
! |
2984 |
||
2985 |
doCreateSep |
|
398 | 2986 |
|
213 | 2987 |
self addElement:(self nodeLabel:nil) |
199 | 2988 |
! |
2989 |
||
968
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
2990 |
doCreateStandardEditMenu |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
2991 |
|
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
2992 |
|node| |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
2993 |
node := self nodeLabel:'Edit'. |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
2994 |
node parent: self selectedNode. |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
2995 |
node add:(self nodeLabel:'Copy' selector:#copySelection). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
2996 |
node add:(self nodeLabel:'Cut' selector:#cutSelection). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
2997 |
node add:(self nodeLabel:'Paste' selector:#paste). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
2998 |
self addElement:node |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
2999 |
|
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3000 |
"Created: / 23.8.1998 / 15:52:16 / cg" |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3001 |
"Modified: / 23.8.1998 / 15:59:36 / cg" |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3002 |
! |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3003 |
|
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3004 |
doCreateStandardFileMenu |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3005 |
|
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3006 |
|node| |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3007 |
node := self nodeLabel:'File'. |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3008 |
node parent: self selectedNode. |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3009 |
node add:(self nodeLabel:'New' selector:#menuNew). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3010 |
node add:(self nodeLabel:'-' ). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3011 |
node add:(self nodeLabel:'Open...' selector:#menuOpen). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3012 |
node add:(self nodeLabel:'-' ). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3013 |
node add:(self nodeLabel:'Save' selector:#menuSave). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3014 |
node add:(self nodeLabel:'Save As...' selector:#menuSaveAs). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3015 |
node add:(self nodeLabel:'-' ). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3016 |
node add:(self nodeLabel:'Exit' selector:#closeRequest). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3017 |
self addElement:node |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3018 |
|
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3019 |
"Created: / 23.8.1998 / 15:51:55 / cg" |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3020 |
"Modified: / 23.8.1998 / 16:04:24 / cg" |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3021 |
! |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3022 |
|
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3023 |
doCreateStandardHelpMenu |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3024 |
|
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3025 |
|node| |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3026 |
node := self nodeLabel:'Help'. |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3027 |
node parent: self selectedNode. |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3028 |
node contents startGroup:#right. |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3029 |
node add:(self nodeLabel:'Documentation' selector:#openDocumentation). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3030 |
node add:(self nodeLabel:'-'). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3031 |
node add:(self nodeLabel:'About this Application' selector:#openAboutThisApplication). |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3032 |
self addElement:node |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3033 |
|
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3034 |
"Created: / 23.8.1998 / 15:52:46 / cg" |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3035 |
"Modified: / 23.8.1998 / 17:30:12 / cg" |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3036 |
! |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3037 |
|
199 | 3038 |
doCut |
912 | 3039 |
|app| |
3040 |
||
3041 |
app := self topView application. |
|
3042 |
(app hasValidSelection value and: [self askForItemModification]) |
|
603 | 3043 |
ifTrue: |
3044 |
[ |
|
3045 |
|selectedNodes| |
|
3046 |
self doCopy. |
|
3047 |
selectedNodes := self selection asSortedCollection. |
|
3048 |
self selectedNodesRemove. |
|
3049 |
self selection: selectedNodes first - 1. |
|
3050 |
self setModified. |
|
912 | 3051 |
app updateAllToolInstances. |
603 | 3052 |
] |
398 | 3053 |
|
199 | 3054 |
! |
3055 |
||
686 | 3056 |
doDelete |
3057 |
||
3058 |
(self topView application hasValidSelection value and: [self askForItemModification]) |
|
3059 |
ifTrue: |
|
3060 |
[ |
|
3061 |
|selectedNodes| |
|
3062 |
selectedNodes := self selection asSortedCollection. |
|
3063 |
self selectedNodesRemove. |
|
3064 |
self selection: selectedNodes first - 1. |
|
3065 |
self setModified. |
|
3066 |
] |
|
3067 |
||
3068 |
! |
|
3069 |
||
199 | 3070 |
doPaste |
912 | 3071 |
|clip| |
3072 |
||
3073 |
clip := self application clipboard. |
|
3074 |
(clip notNil and:[self selectedNode notNil]) ifTrue:[ |
|
3075 |
self addElement:(clip collect:[:el| el copy]) |
|
220 | 3076 |
]. |
199 | 3077 |
! ! |
3078 |
||
407 | 3079 |
!MenuEditor::TreeView methodsFor:'private'! |
199 | 3080 |
|
557 | 3081 |
addElement: aNode |
407 | 3082 |
"add something after selection" |
3083 |
||
1104 | 3084 |
|label sel| |
3085 |
||
3086 |
self askForItemModification ifTrue:[ |
|
3087 |
self selectedNodeAdd:aNode. |
|
3088 |
(aNode isCollection not |
|
3089 |
and: [aNode name = 'Item']) |
|
3090 |
ifTrue:[ |
|
3091 |
sel := self selectedNode. |
|
3092 |
label := aNode name , ' ', |
|
3093 |
(sel parent notNil |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
3094 |
ifTrue: |
1104 | 3095 |
[ |
3096 |
(((sel children size = 0 |
|
3097 |
ifTrue: [sel parent children] |
|
3098 |
ifFalse: [sel children]) |
|
3099 |
select:[:node| |
|
3100 |
|lab| |
|
3101 |
lab := node contents label. |
|
3102 |
((node children size = 0) & |
|
3103 |
node contents submenuChannel isNil & |
|
3104 |
(lab ~= '-') & (lab ~= '=') & (lab ~= '')) |
|
3105 |
]) size) printString |
|
3106 |
] |
|
633
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
3107 |
ifFalse: ['1']). |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
3108 |
|
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
3109 |
aNode name: label string asBoldText. |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
3110 |
aNode contents label: label string. |
11bbf4599843
uses dynamic tree items and needs ListSpecEditor as superclass (-> libview2)
tz
parents:
627
diff
changeset
|
3111 |
]. |
603 | 3112 |
aNode isCollection ifFalse: [self selectNode: aNode] ifTrue: [self selection: (aNode collect: [:node| self indexOfNode: node])]. |
3113 |
self setModified. |
|
3114 |
] |
|
3115 |
! |
|
3116 |
||
634 | 3117 |
askForItemModification |
3118 |
||
3119 |
^self topView application askForItemModification |
|
199 | 3120 |
! |
3121 |
||
213 | 3122 |
nodeLabel:aLabel |
407 | 3123 |
|
860
3e5171aad09f
new items have translateLabel on by default.
Claus Gittinger <cg@exept.de>
parents:
854
diff
changeset
|
3124 |
^TreeItem new contents: ((MenuEditor::Item new label:aLabel) translateLabel:true) |
3e5171aad09f
new items have translateLabel on by default.
Claus Gittinger <cg@exept.de>
parents:
854
diff
changeset
|
3125 |
|
3e5171aad09f
new items have translateLabel on by default.
Claus Gittinger <cg@exept.de>
parents:
854
diff
changeset
|
3126 |
"Modified: / 6.6.1998 / 17:22:35 / cg" |
398 | 3127 |
! |
3128 |
||
968
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3129 |
nodeLabel:aLabel selector:aSelector |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3130 |
|
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3131 |
^TreeItem new contents: (((MenuEditor::Item new label:aLabel) value:aSelector) translateLabel:true) |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3132 |
|
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3133 |
"Modified: / 6.6.1998 / 17:22:35 / cg" |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3134 |
"Created: / 23.8.1998 / 15:58:59 / cg" |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3135 |
! |
f52b5744063b
added standard-submenu generators (in item menu)
Claus Gittinger <cg@exept.de>
parents:
959
diff
changeset
|
3136 |
|
557 | 3137 |
selectedNodeAdd:something |
3138 |
||
1104 | 3139 |
|node numChildren| |
557 | 3140 |
|
3141 |
something notNil ifTrue:[ |
|
3142 |
(node := self selectedNode) notNil ifTrue:[ |
|
1104 | 3143 |
numChildren := node children size. |
3144 |
||
557 | 3145 |
node parent notNil ifTrue:[ |
3146 |
node isCollapsable ifTrue:[ |
|
1104 | 3147 |
model add:something afterIndex:numChildren below:node |
557 | 3148 |
] ifFalse:[ |
3149 |
model add:something after:node |
|
3150 |
] |
|
3151 |
] ifFalse:[ |
|
1104 | 3152 |
model add:something afterIndex:numChildren below:(self root) |
557 | 3153 |
] |
3154 |
] |
|
3155 |
] |
|
3156 |
||
3157 |
||
3158 |
! |
|
3159 |
||
398 | 3160 |
setModified |
912 | 3161 |
|app| |
3162 |
||
3163 |
(app := self topView application) modified: true. |
|
3164 |
app updateChannels |
|
199 | 3165 |
! ! |
3166 |
||
1330 | 3167 |
!MenuEditor::Item class methodsFor:'constants'! |
3168 |
||
3169 |
separatorList |
|
3170 |
"get the list of available separator types" |
|
3171 |
||
3172 |
^#('blank' 'single line' 'double line') |
|
3173 |
! |
|
3174 |
||
3175 |
separatorSlices |
|
3176 |
"get the list of menu spec values of the corresponding separator types" |
|
3177 |
||
3178 |
^ #( |
|
3179 |
( #blank '' ) |
|
3180 |
( #single '-' ) |
|
3181 |
( #double '=' ) |
|
3182 |
) |
|
3183 |
! ! |
|
3184 |
||
3185 |
!MenuEditor::Item class methodsFor:'documentation'! |
|
3186 |
||
3187 |
documentation |
|
3188 |
" |
|
3189 |
implements the contents assigned to a TreeItem. An instance |
|
3190 |
is associated with one item and keeps all its information |
|
3191 |
||
3192 |
[see also:] |
|
3193 |
TreeItem |
|
3194 |
MenuEditor |
|
3195 |
||
3196 |
[author:] |
|
3197 |
Claus Atzkern |
|
3198 |
" |
|
3199 |
||
3200 |
||
3201 |
! ! |
|
3202 |
||
3203 |
!MenuEditor::Item methodsFor:'accessing'! |
|
3204 |
||
3205 |
activeHelpKey |
|
3206 |
"get the help key of the menu item" |
|
3207 |
||
3208 |
^activeHelpKey |
|
3209 |
! |
|
3210 |
||
3211 |
activeHelpKey:aKey |
|
3212 |
"set the help key of the menu item" |
|
3213 |
||
3214 |
activeHelpKey := aKey |
|
3215 |
! |
|
3216 |
||
3217 |
label |
|
3218 |
"get the value of the menu item" |
|
3219 |
||
3220 |
^label |
|
3221 |
! |
|
3222 |
||
3223 |
label:something |
|
3224 |
"set the value of the menu item" |
|
3225 |
||
3226 |
label := something ? '-' |
|
3227 |
! |
|
3228 |
||
3229 |
separatorType |
|
3230 |
"get the separator type assigned to item or nil" |
|
3231 |
||
3232 |
label size > 1 |
|
3233 |
ifFalse: |
|
3234 |
[ |
|
3235 |
label size == 0 ifTrue:[^#blank]. |
|
3236 |
label first == $- ifTrue:[^#single]. |
|
3237 |
label first == $= ifTrue:[^#double]. |
|
3238 |
]. |
|
3239 |
^nil |
|
3240 |
||
3241 |
! |
|
3242 |
||
3243 |
startGroup:aSymbolOrNil |
|
3244 |
"set the startGroup attribute" |
|
3245 |
||
3246 |
startGroup := aSymbolOrNil |
|
3247 |
||
3248 |
"Created: / 23.8.1998 / 15:56:03 / cg" |
|
3249 |
! |
|
3250 |
||
3251 |
submenuChannel |
|
3252 |
"return the value of the instance variable 'submenuChannel' (automatically generated)" |
|
3253 |
||
3254 |
^submenuChannel |
|
3255 |
! |
|
3256 |
||
3257 |
submenuChannel:aChannel |
|
3258 |
"get the submenuChannel" |
|
3259 |
||
3260 |
submenuChannel := aChannel |
|
3261 |
! |
|
3262 |
||
3263 |
translateLabel:aBoolean |
|
3264 |
"set/clear the translate to national-language flag" |
|
3265 |
||
3266 |
translateLabel := aBoolean |
|
3267 |
||
3268 |
"Created: / 6.6.1998 / 17:23:33 / cg" |
|
3269 |
! |
|
3270 |
||
3271 |
value:aSymbol |
|
3272 |
"set the value attribute" |
|
3273 |
||
3274 |
value := aSymbol |
|
3275 |
||
3276 |
"Created: / 23.8.1998 / 16:02:10 / cg" |
|
3277 |
! ! |
|
3278 |
||
3279 |
!MenuEditor::Item methodsFor:'building'! |
|
3280 |
||
3281 |
buildFromAspects:aspects |
|
3282 |
"read the values of the aspects into my values" |
|
3283 |
||
3284 |
|name| |
|
3285 |
self isSeparator |
|
3286 |
ifFalse: |
|
3287 |
[ |
|
3288 |
name := label. |
|
3289 |
label := (aspects at:#label) value. |
|
3290 |
||
3291 |
(label isNil or:[self isSeparator]) ifTrue:[ |
|
3292 |
(aspects at:#label) value:(label := name) |
|
3293 |
]. |
|
3294 |
||
3295 |
enabled := (aspects at:#enabled) value. |
|
3296 |
value := (aspects at:#value) value. |
|
3297 |
nameKey := (aspects at:#nameKey) value. |
|
3298 |
indication := (aspects at:#indication) value. |
|
3299 |
choice := (aspects at:#choice) value. |
|
3300 |
choiceValue := (aspects at:#choiceValue) value. |
|
3301 |
shortcutKey := (aspects at:#shortcutKey) value. |
|
3302 |
startGroup := (aspects at:#startGroup) value. |
|
3303 |
accessCharacterPos := (aspects at:#accessCharacterPos) value. |
|
3304 |
argument := (aspects at:#argument) value. |
|
3305 |
translateLabel := (aspects at:#translateLabel) value. |
|
3306 |
isButton := (aspects at:#isButton) value. |
|
3307 |
auxValue := (aspects at:#auxValue) value. |
|
3308 |
||
3309 |
argument isString ifTrue:[ |
|
3310 |
argument size > 1 ifTrue:[ |
|
3311 |
(argument at:1) == $# ifTrue:[ |
|
3312 |
argument := (argument copyFrom:2) asSymbol |
|
3313 |
] |
|
3314 |
] |
|
3315 |
]. |
|
3316 |
submenuChannel := (aspects at:#submenuChannel) value. |
|
3317 |
retriever := (aspects at:#retriever) value. |
|
3318 |
icon := (aspects at:#icon) value. |
|
3319 |
iconAndLabel := (aspects at:#iconAndLabel) value. |
|
3320 |
] |
|
3321 |
ifTrue: |
|
3322 |
[ |
|
3323 |
name := (aspects at:#seperatorSelection) selectionIndex. |
|
3324 |
label := (self class separatorSlices at:name) last. |
|
3325 |
]. |
|
3326 |
isVisible := (aspects at:#isVisible) value. |
|
3327 |
hideMenuOnActivated := (aspects at:#hideMenuOnActivated) value. |
|
3328 |
||
3329 |
"Modified: / 14.8.1998 / 15:36:38 / cg" |
|
3330 |
! |
|
3331 |
||
3332 |
buildFromMenuItem:anItem |
|
3333 |
"read the attributes of anItem into my values" |
|
3334 |
||
3335 |
|rtv| |
|
3336 |
||
3337 |
self label:(anItem rawLabel). |
|
3338 |
activeHelpKey := anItem activeHelpKey. |
|
3339 |
||
3340 |
(enabled := anItem enabled) isSymbol ifFalse:[ |
|
3341 |
enabled := nil |
|
3342 |
]. |
|
3343 |
(value := anItem value) isSymbol ifFalse:[ |
|
3344 |
value := nil. |
|
3345 |
]. |
|
3346 |
(indication := anItem indication) isSymbol ifFalse:[ |
|
3347 |
indication := nil |
|
3348 |
]. |
|
3349 |
(choice := anItem choice) isSymbol ifFalse:[ |
|
3350 |
choice := nil |
|
3351 |
]. |
|
3352 |
choiceValue := anItem choiceValue. |
|
3353 |
nameKey := anItem nameKey. |
|
3354 |
shortcutKey := anItem shortcutKeyCharacter. |
|
3355 |
startGroup := anItem startGroup. |
|
3356 |
accessCharacterPos := anItem accessCharacterPosition. |
|
3357 |
argument := anItem argument. |
|
3358 |
||
3359 |
submenuChannel := anItem submenuChannel. |
|
3360 |
translateLabel := anItem translateLabel. |
|
3361 |
isButton := anItem isButton. |
|
3362 |
isVisible := anItem isVisible. |
|
3363 |
hideMenuOnActivated := anItem hideMenuOnActivated. |
|
3364 |
auxValue := anItem auxValue. |
|
3365 |
||
3366 |
(((rtv := anItem adornment) notNil) |
|
3367 |
and:[(rtv := rtv labelImage) isKindOf:ResourceRetriever]) |
|
3368 |
ifTrue: |
|
3369 |
[ |
|
3370 |
retriever := rtv className. |
|
3371 |
icon := rtv selector. |
|
3372 |
(iconAndLabel := rtv labelText notNil) ifTrue:[ |
|
3373 |
label := rtv labelText. |
|
3374 |
] |
|
3375 |
] |
|
3376 |
||
3377 |
"Modified: / 29.9.1998 / 11:18:25 / cg" |
|
3378 |
! ! |
|
3379 |
||
3380 |
!MenuEditor::Item methodsFor:'conversion'! |
|
3381 |
||
3382 |
asMenuItem |
|
3383 |
"converts self to a menu item" |
|
3384 |
||
3385 |
|item rcv| |
|
3386 |
||
3387 |
item := MenuItem labeled:label. |
|
3388 |
item isVisible:isVisible. |
|
3389 |
item hideMenuOnActivated:hideMenuOnActivated. |
|
3390 |
||
3391 |
self isSeparator ifFalse:[ |
|
3392 |
item activeHelpKey:activeHelpKey. |
|
3393 |
item enabled:enabled. |
|
3394 |
item accessCharacterPosition:accessCharacterPos. |
|
3395 |
item argument:argument. |
|
3396 |
item submenuChannel:submenuChannel. |
|
3397 |
item nameKey:nameKey. |
|
3398 |
item shortcutKeyCharacter:shortcutKey. |
|
3399 |
item startGroup:startGroup. |
|
3400 |
item value:value. |
|
3401 |
item indication:indication. |
|
3402 |
item choice:choice. |
|
3403 |
item choiceValue:choiceValue. |
|
3404 |
item translateLabel: translateLabel. |
|
3405 |
item isButton: isButton. |
|
3406 |
item auxValue: auxValue. |
|
3407 |
||
3408 |
icon notNil ifTrue:[ |
|
3409 |
rcv := ResourceRetriever new. |
|
3410 |
rcv className:retriever. |
|
3411 |
rcv selector:icon. |
|
3412 |
iconAndLabel == true ifTrue:[ |
|
3413 |
rcv labelText:label |
|
3414 |
]. |
|
3415 |
item labelImage:rcv |
|
3416 |
] |
|
3417 |
]. |
|
3418 |
^item |
|
3419 |
||
3420 |
"Modified: / 14.8.1998 / 15:36:35 / cg" |
|
3421 |
! |
|
3422 |
||
3423 |
toAspects:aspects |
|
3424 |
"put my values into the values of aspects" |
|
3425 |
||
3426 |
|type| |
|
3427 |
(type := self separatorType) notNil ifTrue: [ |
|
3428 |
type := self class separatorSlices findFirst:[:el| el first == type ]. |
|
3429 |
(aspects at:#seperatorSelection) selectionIndex:type. |
|
3430 |
] ifFalse: [ |
|
3431 |
(aspects at:#label) value:label. |
|
3432 |
(aspects at:#enabled) value:enabled. |
|
3433 |
(aspects at:#value) value:value. |
|
3434 |
(aspects at:#nameKey) value:nameKey. |
|
3435 |
(aspects at:#indication) value:indication. |
|
3436 |
(aspects at:#choice) value:choice. |
|
3437 |
(aspects at:#choiceValue) value:choiceValue. |
|
3438 |
(aspects at:#shortcutKey) value:shortcutKey. |
|
3439 |
(aspects at:#startGroup) value:startGroup. |
|
3440 |
(aspects at:#accessCharacterPos) value:accessCharacterPos. |
|
3441 |
(aspects at:#translateLabel) value:translateLabel. |
|
3442 |
(aspects at:#submenuChannel) value:submenuChannel. |
|
3443 |
(aspects at:#retriever) value:retriever. |
|
3444 |
(aspects at:#icon) value:icon. |
|
3445 |
(aspects at:#iconAndLabel) value:iconAndLabel. |
|
3446 |
(aspects at:#isButton) value:isButton. |
|
3447 |
(aspects at:#auxValue) value:auxValue. |
|
3448 |
||
3449 |
(aspects at:#argument) |
|
3450 |
value:(argument isSymbol |
|
3451 |
ifTrue: ['#', argument] |
|
3452 |
ifFalse:[argument]). |
|
3453 |
]. |
|
3454 |
(aspects at:#isVisible) value:isVisible. |
|
3455 |
(aspects at:#hideMenuOnActivated) value:hideMenuOnActivated. |
|
3456 |
||
3457 |
"Modified: / 14.8.1998 / 15:37:29 / cg" |
|
3458 |
! ! |
|
3459 |
||
3460 |
!MenuEditor::Item methodsFor:'queries'! |
|
3461 |
||
3462 |
iconFor: aNode |
|
3463 |
"get the icon of the menu item for the tree view" |
|
3464 |
||
3465 |
(aNode hasChildren or: [aNode parent isNil]) |
|
3466 |
ifTrue: |
|
3467 |
[ |
|
3468 |
^MenuEditor submenuImage |
|
3469 |
] |
|
3470 |
ifFalse: |
|
3471 |
[ |
|
3472 |
submenuChannel notNil |
|
3473 |
ifTrue: |
|
3474 |
[ |
|
3475 |
^MenuEditor linkSubmenuImage |
|
3476 |
] |
|
3477 |
ifFalse: |
|
3478 |
[ |
|
3479 |
self isSeparator |
|
3480 |
ifTrue: [^MenuEditor menuSeparatorImage] |
|
3481 |
ifFalse: [^MenuEditor menuItemImage] |
|
3482 |
] |
|
3483 |
] |
|
3484 |
! |
|
3485 |
||
3486 |
isSeparator |
|
3487 |
"return true if item is a seperator" |
|
3488 |
||
3489 |
^self separatorType notNil |
|
3490 |
! |
|
3491 |
||
3492 |
treeViewLabel |
|
3493 |
"get the label of the menu item for the tree view" |
|
3494 |
||
3495 |
^label |
|
3496 |
" asBoldText, |
|
3497 |
(value notNil ifTrue: [': [', |
|
3498 |
value , |
|
3499 |
(argument isString ifTrue: [' ', (Text string: argument emphasis: #italic)] ifFalse: ['']), |
|
3500 |
']'] ifFalse: ['']) |
|
3501 |
||
3502 |
||
3503 |
" |
|
3504 |
! ! |
|
3505 |
||
199 | 3506 |
!MenuEditor class methodsFor:'documentation'! |
3507 |
||
3508 |
version |
|
3509 |
^ '$Header$' |
|
3510 |
! ! |