diff -r 6454aaabda51 -r 9fdcc26c458f MenuEditor.st --- a/MenuEditor.st Fri Mar 13 23:48:08 1998 +0100 +++ b/MenuEditor.st Sat Mar 14 12:12:53 1998 +0100 @@ -101,6 +101,15 @@ !MenuEditor class methodsFor:'accessing'! +iconUnknown + "returns an image used for picked items containing an image + " + + + + ^Image fromFile:'brokenImage.xpm' +! + resourceType "get the type of resource of the method generated by the MenuEditor" @@ -236,6 +245,56 @@ ) ! ! +!MenuEditor class methodsFor:'image specs'! + +linkSubmenuImage + "Generated by the Image Editor" + " + ImageEditor openOnClass:self andSelector:#linkSubmenuImage + " + + + + ^Icon + constantNamed:#'MenuEditor linkSubmenuImage' + 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????? + + ^Icon + constantNamed:#'MenuEditor menuItemImage' + 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:'@@@@@@@@@@@@@@@@@@@@??? + + ^Icon + constantNamed:#'MenuEditor menuSeparatorImage' + 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:'@@@@@@@@@@@@@@@@@@@@??? + + ^Icon + constantNamed:#'MenuEditor submenuImage' + 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:'??? - - - ^ Image fromFile:'brokenImage.xpm' -! - -linkSubmenuImage - "Generated by the Image Editor" - " - ImageEditor openOnClass:self andSelector:#linkSubmenuImage - " - - - - ^Icon - constantNamed:#'MenuEditor linkSubmenuImage' - 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????? - - ^Icon - constantNamed:#'MenuEditor menuItemImage' - 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:'@@@@@@@@@@@@@@@@@@@@??? - - ^Icon - constantNamed:#'MenuEditor menuSeparatorImage' - 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:'@@@@@@@@@@@@@@@@@@@@??? - - ^Icon - constantNamed:#'MenuEditor submenuImage' - 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:'??? 1 ifFalse: @@ -2068,7 +2073,7 @@ ! submenuChannel:aChannel - "return the value of the instance variable 'submenuChannel' (automatically generated)" + "get the submenuChannel" submenuChannel := aChannel ! ! @@ -2111,6 +2116,7 @@ ! buildFromAspects:aspects + "read the values of the aspects into my values" |name| self isSeparator @@ -2156,6 +2162,7 @@ ! buildFromMenuItem:anItem + "read the attributes of anItem into my values" |rtv| @@ -2198,6 +2205,7 @@ ! toAspects:aspects + "put my values into the values of aspects" |type| (type := self separatorType) notNil @@ -2234,6 +2242,7 @@ !MenuEditor::Item methodsFor:'queries'! iconFor: aNode + "get the icon of the menu item for the tree view" (aNode hasChildren or: [aNode parent isNil]) ifTrue: @@ -2257,12 +2266,13 @@ ! isSeparator - "returns true if item is a seperator" + "return true if item is a seperator" ^self separatorType notNil ! treeViewLabel + "get the label of the menu item for the tree view" ^label asBoldText, (value notNil ifTrue: [': [', @@ -2275,7 +2285,8 @@ documentation " - menu selection list + This tree view class provides a hierarchical representation + of the components of a menu. [see also:] SelectionInTreeView @@ -2285,18 +2296,18 @@ [author:] Claus Atzkern " - - ! ! !MenuEditor::TreeView methodsFor:'accessing'! selectorName + "get the selector of the menu spec" ^(listOfNodes first contents label) asSymbol ! selectorName: aSymbol + "set the selector for the menu spec" listOfNodes first contents label: aSymbol ! ! @@ -2304,6 +2315,8 @@ !MenuEditor::TreeView methodsFor:'building'! buildFromClass:aClass andSelector:aSelector + "read a menu spec from aClass and aSelector and put + the encoded menu into the tree view" |spec cls menu firstNode firstNodeLabel| @@ -2339,6 +2352,7 @@ firstNode := self nodeLabel:firstNodeLabel. ] ]. + firstNode expand. model root: firstNode. @@ -2354,6 +2368,7 @@ ! buildFromMenu:aMenu + "put aMenu into the tree view" |node| @@ -2474,6 +2489,7 @@ !MenuEditor::TreeView methodsFor:'initialization'! initialize + "initialize the tree view of the menu components" super initialize.