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