320 'Search for methods with image resource.' |
331 'Search for methods with image resource.' |
321 |
332 |
322 #detailsAccelerator |
333 #detailsAccelerator |
323 'Accelerator key to select the menu item from the keyboard (Cmdx or Ctrlx).' |
334 'Accelerator key to select the menu item from the keyboard (Cmdx or Ctrlx).' |
324 |
335 |
|
336 #detailsAccessCharaterPosition |
|
337 'Index of the access character position of the textual label (obsolete, VW compatibility).' |
|
338 |
|
339 #detailsAuxValue |
|
340 'Some additional value - for arbitrary use by the program.' |
|
341 |
|
342 #detailsEnabled |
|
343 'Aspect or binding providing a boolean value holder to enable/disable the menu item.' |
|
344 |
325 #detailsIgnoreAcceleratorKeys |
345 #detailsIgnoreAcceleratorKeys |
326 'Ignore accelerator keys in submenu(s).' |
346 'Ignore accelerator keys in submenu(s).' |
327 |
347 |
328 #detailsIgnoreMnemonicKeys |
348 #detailsIgnoreMnemonicKeys |
329 'Ignore mnemonic keys (access characters) in submenu(s).' |
349 'Ignore mnemonic keys (access characters) in submenu(s).' |
330 |
|
331 #detailsAccessCharaterPosition |
|
332 'Index of the access character position of the textual label (obsolete, VW compatibility).' |
|
333 |
|
334 #detailsAuxValue |
|
335 'Some additional value - for arbitrary use by the program.' |
|
336 |
|
337 #detailsEnabled |
|
338 'Aspect or binding providing a boolean value holder to enable/disable the menu item.' |
|
339 |
350 |
340 #detailsStartGroup |
351 #detailsStartGroup |
341 'Specify start of a right-aligned item group.' |
352 'Specify start of a right-aligned item group.' |
342 |
353 |
343 #detailsVisibility |
354 #detailsVisibility |
605 " |
616 " |
606 |
617 |
607 <resource: #menu> |
618 <resource: #menu> |
608 |
619 |
609 ^ |
620 ^ |
610 #(#Menu |
621 #(Menu |
611 #( |
622 ( |
612 #(#MenuItem |
623 (MenuItem |
613 #activeHelpKey: #addMenuSeparator |
624 activeHelpKey: addMenuSeparator |
614 #label: 'Separator' |
625 label: 'Separator' |
615 #itemValue: #doCreateSep |
626 itemValue: doCreateSep |
616 #translateLabel: true |
627 translateLabel: true |
617 #labelImage: #(#ResourceRetriever #'MenuEditor::Item' #iconSeparator '') |
628 labelImage: (ResourceRetriever #'MenuEditor::Item' iconSeparator '') |
618 ) |
629 ) |
619 #(#MenuItem |
630 (MenuItem |
620 #activeHelpKey: #addMenuItem |
631 activeHelpKey: addMenuItem |
621 #label: 'Item' |
632 label: 'Item' |
622 #itemValue: #doCreateItem |
633 itemValue: doCreateItem |
623 #translateLabel: true |
634 translateLabel: true |
624 #labelImage: #(#ResourceRetriever #'MenuEditor::Item' #iconItem '') |
635 labelImage: (ResourceRetriever #'MenuEditor::Item' iconItem '') |
625 ) |
636 ) |
626 #(#MenuItem |
637 (MenuItem |
627 #activeHelpKey: #addMenuItem |
638 activeHelpKey: addMenuSliceItem |
628 #label: 'Menu' |
639 label: 'Menu Slice' |
629 #itemValue: #doCreateMenu |
640 itemValue: doCreateMenuSliceItem |
630 #translateLabel: true |
641 translateLabel: true |
631 #labelImage: #(#ResourceRetriever #'MenuEditor::Item' #iconMenu '') |
642 labelImage: (ResourceRetriever #'MenuEditor::Item' iconSliceMenu '') |
632 ) |
643 ) |
633 #(#MenuItem |
644 (MenuItem |
634 #activeHelpKey: #addSubMenuLink |
645 activeHelpKey: addMenuItem |
635 #label: 'Linked Menu' |
646 label: 'Menu' |
636 #itemValue: #doCreateLinkedMenu |
647 itemValue: doCreateMenu |
637 #translateLabel: true |
648 translateLabel: true |
638 #labelImage: #(#ResourceRetriever #'MenuEditor::Item' #iconLinkedMenu '') |
649 labelImage: (ResourceRetriever #'MenuEditor::Item' iconMenu '') |
639 ) |
650 ) |
640 #(#MenuItem |
651 (MenuItem |
641 #label: '-' |
652 activeHelpKey: addSubMenuLink |
642 ) |
653 label: 'Linked Menu' |
643 #(#MenuItem |
654 itemValue: doCreateLinkedMenu |
644 #activeHelpKey: #addDelayedMenu |
655 translateLabel: true |
645 #enabled: #canCreateDelayedMenuChannel |
656 labelImage: (ResourceRetriever #'MenuEditor::Item' iconLinkedMenu '') |
646 #label: 'Delayed Menu' |
657 ) |
647 #itemValue: #doCreateDelayedMenu: |
658 (MenuItem |
648 #translateLabel: true |
659 label: '-' |
649 #labelImage: #(#ResourceRetriever #'MenuEditor::Item' #iconDelayedMenu '') |
660 ) |
650 #argument: #menu |
661 (MenuItem |
651 ) |
662 activeHelpKey: addDelayedMenu |
652 #(#MenuItem |
663 enabled: canCreateDelayedMenuChannel |
653 #activeHelpKey: #addDelayedSubMenuLink |
664 label: 'Delayed Menu' |
654 #enabled: #canCreateDelayedMenuChannel |
665 itemValue: doCreateDelayedMenu: |
655 #label: 'Delayed Linked Menu' |
666 translateLabel: true |
656 #itemValue: #doCreateDelayedMenu: |
667 labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedMenu '') |
657 #translateLabel: true |
668 argument: menu |
658 #labelImage: #(#ResourceRetriever #'MenuEditor::Item' #iconDelayedLinkedMenu '') |
669 ) |
659 #argument: #linkedMenu |
670 (MenuItem |
660 ) |
671 activeHelpKey: addDelayedSubMenuLink |
661 #(#MenuItem |
672 enabled: canCreateDelayedMenuChannel |
662 #label: '-' |
673 label: 'Delayed Linked Menu' |
663 ) |
674 itemValue: doCreateDelayedMenu: |
664 #(#MenuItem |
675 translateLabel: true |
665 #label: 'Standard Menus' |
676 labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedLinkedMenu '') |
666 #translateLabel: true |
677 argument: linkedMenu |
667 #submenuChannel: #standardMenus |
678 ) |
668 #keepLinkedMenu: true |
679 (MenuItem |
|
680 label: '-' |
|
681 ) |
|
682 (MenuItem |
|
683 label: 'Standard Menus' |
|
684 translateLabel: true |
|
685 submenuChannel: standardMenus |
|
686 keepLinkedMenu: true |
669 ) |
687 ) |
670 ) |
688 ) |
671 nil |
689 nil |
672 nil |
690 nil |
673 ) |
691 ) |
2225 ]. |
2252 ]. |
2226 anItem choice notNil ifTrue:[ |
2253 anItem choice notNil ifTrue:[ |
2227 choice isNil ifTrue:[ choice := anItem choiceValue asValue ]. |
2254 choice isNil ifTrue:[ choice := anItem choiceValue asValue ]. |
2228 anItem choice:choice |
2255 anItem choice:choice |
2229 ]. |
2256 ]. |
2230 |
2257 anItem isMenuSlice ifTrue:[ |
|
2258 anItem submenuChannel:nil. |
|
2259 anItem label:'... Slice Menu ...'. |
|
2260 ]. |
2231 anItem submenuChannel notNil ifTrue:[ |
2261 anItem submenuChannel notNil ifTrue:[ |
2232 anItem submenuChannel:nil. |
2262 anItem submenuChannel:nil. |
2233 anItem submenu isNil ifTrue:[ |
2263 anItem submenu isNil ifTrue:[ |
2234 submenu isNil ifTrue:[ |
2264 submenu isNil ifTrue:[ |
2235 submenu := Menu new. |
2265 submenu := Menu new. |
2877 <resource: #image> |
2913 <resource: #image> |
2878 |
2914 |
2879 ^Icon |
2915 ^Icon |
2880 constantNamed:#'MenuEditor::Item class iconSeparator' |
2916 constantNamed:#'MenuEditor::Item class iconSeparator' |
2881 ifAbsentPut:[(Depth2Image new) width: 20; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUUUUUUUP@@@@@@EUUUUU Z****+A*****,F????:0[@@@@[A)UUUU,F*****0Z****+B?????<@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 127 127]; mask:((Depth1Image new) width: 20; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@???0???0???0???0???0???0???0???0???0???0???0@@@@@@@@@@@@') ; yourself); yourself] |
2917 ifAbsentPut:[(Depth2Image new) width: 20; height: 16; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'UUUUUUUUUUUUUP@@@@@@EUUUUU Z****+A*****,F????:0[@@@@[A)UUUU,F*****0Z****+B?????<@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 170 170 170 127 127 127]; mask:((Depth1Image new) width: 20; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@???0???0???0???0???0???0???0???0???0???0???0@@@@@@@@@@@@') ; yourself); yourself] |
|
2918 ! |
|
2919 |
|
2920 iconSliceMenu |
|
2921 "This resource specification was automatically generated |
|
2922 by the ImageEditor of ST/X." |
|
2923 |
|
2924 "Do not manually edit this!! If it is corrupted, |
|
2925 the ImageEditor may not be able to read the specification." |
|
2926 |
|
2927 " |
|
2928 self iconSliceMenu inspect |
|
2929 ImageEditor openOnClass:self andSelector:#iconSliceMenu |
|
2930 Icon flushCachedIcons |
|
2931 " |
|
2932 |
|
2933 <resource: #image> |
|
2934 |
|
2935 ^Icon |
|
2936 constantNamed:#'MenuEditor::Item class iconSliceMenu' |
|
2937 ifAbsentPut:[(Depth2Image new) width: 20; height: 16; photometric:(#palette); bitsPerSample:(#(2)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@O?????0:*****C/?6??XN:*[*) ;*).*&C.*&:*XN5U[UU :*****C*****(@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 127 127 127 170 170 170 255 255 255]; mask:((Depth1Image new) width: 20; height: 16; photometric:(#blackIs0); bitsPerSample:(#(1)); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@???0???0???0???0???0???0???0???0???0???0???0@@@@@@@@@@@@') ; yourself); yourself] |
2882 ! ! |
2938 ! ! |
2883 |
2939 |
2884 !MenuEditor::Item class methodsFor:'instance creation'! |
2940 !MenuEditor::Item class methodsFor:'instance creation'! |
2885 |
2941 |
2886 classFor:aMenuItem |
2942 classFor:aMenuItem |
2887 |
2943 |
2888 aMenuItem isNil ifTrue:[ ^ nil ]. |
2944 aMenuItem isNil ifTrue:[ ^ nil ]. |
2889 |
2945 |
2890 aMenuItem itemValue isNil ifTrue:[ |
2946 aMenuItem itemValue isNil ifTrue:[ |
2891 aMenuItem submenu notNil ifTrue:[ ^ MenuEditor::RegularMenuItem ]. |
2947 aMenuItem isMenuSlice ifTrue:[ ^ MenuEditor::MenuSliceItem ]. |
|
2948 aMenuItem submenu notNil ifTrue:[ ^ MenuEditor::RegularMenuItem ]. |
2892 aMenuItem submenuChannel notNil ifTrue:[ ^ MenuEditor::LinkedMenuItem ]. |
2949 aMenuItem submenuChannel notNil ifTrue:[ ^ MenuEditor::LinkedMenuItem ]. |
2893 |
2950 |
2894 (self separatorTypeOf:(aMenuItem rawLabel)) notNil ifTrue:[ |
2951 (self separatorTypeOf:(aMenuItem rawLabel)) notNil ifTrue:[ |
2895 ^ MenuEditor::SeparatorItem |
2952 ^ MenuEditor::SeparatorItem |
2896 ] |
2953 ] |
4141 |
4198 |
4142 !MenuEditor::LinkedMenuItem methodsFor:'queries'! |
4199 !MenuEditor::LinkedMenuItem methodsFor:'queries'! |
4143 |
4200 |
4144 isKindOfMenu |
4201 isKindOfMenu |
4145 ^ true |
4202 ^ true |
|
4203 ! ! |
|
4204 |
|
4205 !MenuEditor::MenuSliceItem class methodsFor:'defaults'! |
|
4206 |
|
4207 defaultLabel |
|
4208 ^ 'Menu Slice' |
|
4209 ! ! |
|
4210 |
|
4211 !MenuEditor::MenuSliceItem class methodsFor:'interface specs'! |
|
4212 |
|
4213 basicsEditSpec |
|
4214 "This resource specification was automatically generated |
|
4215 by the UIPainter of ST/X." |
|
4216 |
|
4217 "Do not manually edit this!! If it is corrupted, |
|
4218 the UIPainter may not be able to read the specification." |
|
4219 |
|
4220 " |
|
4221 UIPainter new openOnClass:MenuEditor::MenuSliceItem andSelector:#basicsEditSpec |
|
4222 " |
|
4223 |
|
4224 <resource: #canvas> |
|
4225 |
|
4226 ^ |
|
4227 #(FullSpec |
|
4228 name: basicsEditSpec |
|
4229 window: |
|
4230 (WindowSpec |
|
4231 label: 'basicsEditSpec' |
|
4232 name: 'basicsEditSpec' |
|
4233 min: (Point 10 10) |
|
4234 bounds: (Rectangle 0 0 344 146) |
|
4235 ) |
|
4236 component: |
|
4237 (SpecCollection |
|
4238 collection: ( |
|
4239 (LabelSpec |
|
4240 label: 'Name Key:' |
|
4241 name: 'nameKeyLabel' |
|
4242 layout: (AlignmentOrigin 107 0 25 0 1 0.5) |
|
4243 activeHelpKey: basicsKey |
|
4244 visibilityChannel: notDelayedMenu |
|
4245 translateLabel: true |
|
4246 resizeForLabel: true |
|
4247 adjust: right |
|
4248 ) |
|
4249 (InputFieldSpec |
|
4250 name: 'nameKeyField' |
|
4251 layout: (LayoutFrame 110 0 15 0 -5 1.0 37 0) |
|
4252 activeHelpKey: basicsKey |
|
4253 visibilityChannel: notDelayedMenu |
|
4254 tabable: true |
|
4255 model: nameKey |
|
4256 group: inputGroup |
|
4257 type: symbolOrNil |
|
4258 immediateAccept: false |
|
4259 acceptOnLeave: false |
|
4260 acceptOnReturn: true |
|
4261 acceptOnTab: true |
|
4262 acceptOnLostFocus: false |
|
4263 acceptChannel: acceptChannel |
|
4264 modifiedChannel: modifiedChannel |
|
4265 acceptOnPointerLeave: false |
|
4266 ) |
|
4267 (LabelSpec |
|
4268 label: 'Label:' |
|
4269 name: 'labelLabel' |
|
4270 layout: (AlignmentOrigin 107 0 51 0 1 0.5) |
|
4271 activeHelpKey: basicsLabel |
|
4272 visibilityChannel: notDelayedMenu |
|
4273 translateLabel: true |
|
4274 resizeForLabel: true |
|
4275 adjust: right |
|
4276 ) |
|
4277 (InputFieldSpec |
|
4278 name: 'labelField' |
|
4279 layout: (LayoutFrame 110 0 40 0 -5 1.0 62 0) |
|
4280 activeHelpKey: basicsLabel |
|
4281 visibilityChannel: notDelayedMenu |
|
4282 tabable: true |
|
4283 model: rawLabel |
|
4284 group: inputGroup |
|
4285 immediateAccept: false |
|
4286 acceptOnReturn: true |
|
4287 acceptOnTab: true |
|
4288 acceptOnLostFocus: false |
|
4289 acceptChannel: acceptChannel |
|
4290 modifiedChannel: modifiedChannel |
|
4291 acceptOnPointerLeave: false |
|
4292 ) |
|
4293 (LabelSpec |
|
4294 label: 'Menu:' |
|
4295 name: 'menuLabel' |
|
4296 layout: (AlignmentOrigin 107 0 90 0 1 0.5) |
|
4297 activeHelpKey: basicsLabel |
|
4298 translateLabel: true |
|
4299 resizeForLabel: true |
|
4300 adjust: right |
|
4301 ) |
|
4302 (InputFieldSpec |
|
4303 name: 'menuField' |
|
4304 layout: (LayoutFrame 110 0 79 0 -5 1.0 101 0) |
|
4305 activeHelpKey: basicsMenu |
|
4306 tabable: true |
|
4307 model: submenuChannel |
|
4308 group: inputGroup |
|
4309 type: symbolOrNil |
|
4310 immediateAccept: false |
|
4311 acceptOnReturn: true |
|
4312 acceptOnTab: true |
|
4313 acceptOnLostFocus: false |
|
4314 acceptChannel: acceptChannel |
|
4315 modifiedChannel: modifiedChannel |
|
4316 acceptOnPointerLeave: false |
|
4317 ) |
|
4318 (LabelSpec |
|
4319 label: 'Argument:' |
|
4320 name: 'argumentLabel' |
|
4321 layout: (AlignmentOrigin 107 0 115 0 1 0.5) |
|
4322 activeHelpKey: basicsLabel |
|
4323 translateLabel: true |
|
4324 resizeForLabel: true |
|
4325 adjust: right |
|
4326 ) |
|
4327 (InputFieldSpec |
|
4328 name: 'argumentField' |
|
4329 layout: (LayoutFrame 110 0 104 0 -5 1.0 126 0) |
|
4330 activeHelpKey: basicsMenuArgument |
|
4331 enableChannel: notDelayedMenu |
|
4332 tabable: true |
|
4333 model: argument |
|
4334 group: inputGroup |
|
4335 type: smalltalkObject |
|
4336 immediateAccept: false |
|
4337 acceptOnReturn: true |
|
4338 acceptOnTab: true |
|
4339 acceptOnLostFocus: false |
|
4340 acceptChannel: acceptChannel |
|
4341 modifiedChannel: modifiedChannel |
|
4342 acceptOnPointerLeave: false |
|
4343 ) |
|
4344 ) |
|
4345 |
|
4346 ) |
|
4347 ) |
|
4348 ! ! |
|
4349 |
|
4350 !MenuEditor::MenuSliceItem methodsFor:'accessing'! |
|
4351 |
|
4352 icon |
|
4353 ^ self class iconSliceMenu |
|
4354 ! |
|
4355 |
|
4356 menuItem |
|
4357 "returns self as a MenuItem |
|
4358 " |
|
4359 |item| |
|
4360 |
|
4361 item := super menuItem. |
|
4362 item submenuChannel:(self submenuChannel). |
|
4363 item isMenuSlice:true. |
|
4364 ^ item |
|
4365 ! |
|
4366 |
|
4367 slices |
|
4368 ^ #( |
|
4369 (Basics basicsEditSpec) |
|
4370 ) |
|
4371 ! ! |
|
4372 |
|
4373 !MenuEditor::MenuSliceItem methodsFor:'aspects'! |
|
4374 |
|
4375 argument:aValue |
|
4376 menuItem argument:aValue. |
|
4377 ! |
|
4378 |
|
4379 aspectAt:aKey put:aValue |
|
4380 "set a specific aspect named aKey to the aValue |
|
4381 " |
|
4382 aKey == #submenuChannel ifTrue:[ ^ self submenuChannel:aValue ]. |
|
4383 aKey == #isSliceMenu ifTrue:[ ^ self ]. |
|
4384 |
|
4385 super aspectAt:aKey put:aValue. |
|
4386 ! |
|
4387 |
|
4388 submenuChannel |
|
4389 ^ menuItem submenuChannel ? #unspecified |
|
4390 ! |
|
4391 |
|
4392 submenuChannel:aValue |
|
4393 menuItem submenuChannel:aValue. |
4146 ! ! |
4394 ! ! |
4147 |
4395 |
4148 !MenuEditor::RegularMenuItem class methodsFor:'defaults'! |
4396 !MenuEditor::RegularMenuItem class methodsFor:'defaults'! |
4149 |
4397 |
4150 defaultDelayedLabel |
4398 defaultDelayedLabel |