--- a/MenuEditor.st Fri May 04 21:26:30 2001 +0200
+++ b/MenuEditor.st Sat May 05 07:40:28 2001 +0200
@@ -17,7 +17,7 @@
ResourceSpecEditor subclass:#MenuEditor
instanceVariableNames:'treeView typeOfCanvas listOfCanvas listOfSlices
lastImageRetriever slices'
- classVariableNames:''
+ classVariableNames:'ImageRetrieverClasses'
poolDictionaries:''
category:'Interface-UIPainter'
!
@@ -77,6 +77,15 @@
! !
+!MenuEditor class methodsFor:'initialization'!
+
+initialize
+ ImageRetrieverClasses := #( Icon
+ NewLauncher
+ SystemBrowser
+ ) asList.
+! !
+
!MenuEditor class methodsFor:'instance creation'!
openModalOnMenu: aMenu
@@ -106,6 +115,31 @@
! !
+!MenuEditor class methodsFor:'accessing image retriever'!
+
+addNewImageRetriever:aSymbolOrClass
+ |key|
+
+ aSymbolOrClass isString ifFalse:[
+ aSymbolOrClass isBehavior ifTrue:[
+ key := aSymbolOrClass nameWithNameSpacePrefix
+ ]
+ ].
+ key size ~~ 0 ifTrue:[
+ key := key asSymbol.
+
+ (ImageRetrieverClasses identityIndexOf:key) == 0 ifTrue:[
+ ImageRetrieverClasses add:key.
+ ]
+ ].
+!
+
+imageRetrieverClasses
+ "returns a collection of image retrievers
+ "
+ ^ ImageRetrieverClasses
+! !
+
!MenuEditor class methodsFor:'aspects'!
aspects
@@ -141,14 +175,6 @@
"Modified: / 14.8.1998 / 14:46:36 / cg"
! !
-!MenuEditor class methodsFor:'defaults'!
-
-defaultRetrieverClassList
- ^ #(Icon NewLauncher SystemBrowser)
-
-
-! !
-
!MenuEditor class methodsFor:'help specs'!
helpSpec
@@ -1162,7 +1188,7 @@
#name: 'Image Item'
#min: #(#Point 10 10)
#max: #(#Point 1280 1024)
- #bounds: #(#Rectangle 15 153 411 430)
+ #bounds: #(#Rectangle 707 147 995 442)
)
#component:
#(#SpecCollection
@@ -1176,12 +1202,8 @@
#adjust: #right
)
#(#ComboBoxSpec
- #attributes:
- #(#tabable
- true
- )
#name: 'retrieverField'
- #layout: #(#LayoutFrame 110 0 15 0 0 1.0 37 0)
+ #layout: #(#LayoutFrame 110 0 15 0 -20 1.0 37 0)
#activeHelpKey: #imageRetriever
#tabable: true
#model: #retriever
@@ -1201,12 +1223,8 @@
#adjust: #right
)
#(#InputFieldSpec
- #attributes:
- #(#tabable
- true
- )
#name: 'iconField'
- #layout: #(#LayoutFrame 110 0 40 0 -31 1.0 62 0)
+ #layout: #(#LayoutFrame 110 0 40 0 -42 1.0 62 0)
#activeHelpKey: #imageSelector
#tabable: true
#model: #icon
@@ -1219,20 +1237,16 @@
#acceptOnPointerLeave: false
)
#(#ActionButtonSpec
- #attributes:
- #(#tabable
- true
- )
#label: '...'
#name: 'browseButton'
- #layout: #(#LayoutFrame -26 1 41 0 -2 1 63 0)
+ #layout: #(#LayoutFrame -40 1 40 0 -20 1 62 0)
#activeHelpKey: #browseResource
#tabable: true
#model: #doBrowseForImageResource
)
#(#SequenceViewSpec
#name: 'systemOrUserImagesList'
- #layout: #(#LayoutFrame 22 0 67 0 11 0.6 200 0)
+ #layout: #(#LayoutFrame 20 0.0 67 0 -20 1.0 -30 1.0)
#activeHelpKey: #imageImageList
#tabable: true
#model: #selectionOfImage
@@ -1245,29 +1259,32 @@
#useIndex: false
#sequenceList: #listOfImages
)
- #(#ActionButtonSpec
- #attributes:
- #(#tabable
- true
+ #(#ViewSpec
+ #name: 'Box1'
+ #layout: #(#LayoutFrame 20 0.0 -30 1.0 -20 1.0 0 1.0)
+ #level: 0
+ #component:
+ #(#SpecCollection
+ #collection: #(
+ #(#CheckBoxSpec
+ #label: 'Image & Label'
+ #name: 'iconAndLabelCheckBox'
+ #layout: #(#AlignmentOrigin 0 0 0 0.5 0 0.5)
+ #activeHelpKey: #imageImageAndLabel
+ #tabable: true
+ #model: #iconAndLabel
+ )
+ #(#ActionButtonSpec
+ #label: 'Image Editor'
+ #name: 'imageEditorButton'
+ #layout: #(#AlignmentOrigin 0 1.0 0 0.5 1 0.5)
+ #activeHelpKey: #imageImageEditor
+ #tabable: true
+ #model: #doEditImage
+ )
+ )
+
)
- #label: 'Image Editor'
- #name: 'imageEditorButton'
- #layout: #(#LayoutFrame 19 0.6 128 0 -5 1 152 0)
- #activeHelpKey: #imageImageEditor
- #tabable: true
- #model: #doEditImage
- )
- #(#CheckBoxSpec
- #attributes:
- #(#tabable
- true
- )
- #label: 'Image & Label'
- #name: 'iconAndLabelCheckBox'
- #layout: #(#LayoutOrigin 20 0 215 0)
- #activeHelpKey: #imageImageAndLabel
- #tabable: true
- #model: #iconAndLabel
)
)
@@ -2463,10 +2480,9 @@
with:[:a | a size > 0]
argument:(aspects at:#choice)).
- aspects at:#retrieverClassList put:self class defaultRetrieverClassList asValue.
+ aspects at:#retrieverClassList put:self class imageRetrieverClasses asValue.
aspects do: [:holder| holder addDependent:self].
-
!
openModalOnMenu: aMenu
@@ -3562,3 +3578,4 @@
version
^ '$Header$'
! !
+MenuEditor initialize!