# HG changeset patch # User Claus Gittinger # Date 1204021250 -3600 # Node ID ee43ce83094de086f870be335babfb783d20ddff # Parent 365b3a73cd284333475eb967535756aa84cae080 *** empty log message *** diff -r 365b3a73cd28 -r ee43ce83094d MenuEditor.st --- a/MenuEditor.st Tue Feb 26 11:20:34 2008 +0100 +++ b/MenuEditor.st Tue Feb 26 11:20:50 2008 +0100 @@ -476,6 +476,12 @@ !MenuEditor class methodsFor:'image specs'! +browseActionImage + + + ^ UIPainter browseActionImage +! + defaultIcon @@ -1637,40 +1643,40 @@ ! accept:ok - "ok if true the modifications are accepted - than reload from item + "if ok is true, the modifications are accepted. + then reload from item " |selectedItem rscRetrHolder helpKeyHolder helpTool imageTool acceptChannel| selectedItem := self selectedItem. selectedItem ifNotNil:[ - self withoutNotifyDo:[ - rscRetrHolder := aspects at:#resourceRetriever. - helpKeyHolder := aspects at:#activeHelpKey. - imageTool := self imageTool. - helpTool := self helpTool. - acceptChannel := self acceptChannel. - - acceptChannel triggerValue:true. - acceptChannel setValue:false. - - ok ifTrue:[ - helpTool accept. - rscRetrHolder value:(imageTool resourceRetriever). - helpKeyHolder value:(helpTool helpKey). - selectedItem fromAspects:aspects. - self setModified. - - selectedItem isRootItem ifTrue:[ - "/ update specSelector - specSelector := selectedItem rawLabel. - ]. - ]. - selectedItem toAspects:aspects. - helpTool helpKey:(helpKeyHolder value). - imageTool resourceRetriever:(rscRetrHolder value). - ] + self withoutNotifyDo:[ + rscRetrHolder := aspects at:#resourceRetriever. + helpKeyHolder := aspects at:#activeHelpKey. + imageTool := self imageTool. + helpTool := self helpTool. + acceptChannel := self acceptChannel. + + acceptChannel triggerValue:true. + acceptChannel setValue:false. + + ok ifTrue:[ + helpTool accept. + rscRetrHolder value:(imageTool resourceRetriever). + helpKeyHolder value:(helpTool helpKey). + selectedItem fromAspects:aspects. + self setModified. + + selectedItem isRootItem ifTrue:[ + "/ update specSelector + specSelector := selectedItem rawLabel. + ]. + ]. + selectedItem toAspects:aspects. + helpTool helpKey:(helpKeyHolder value). + imageTool resourceRetriever:(rscRetrHolder value). + ] ]. self updateChannels. "/ self clearModified. @@ -2482,6 +2488,43 @@ ^ selectors asOrderedCollection ! +doBrowseActionMethod + |selector cls category| + + selector := (self aspectFor:#itemValue) value. + + selector isEmptyOrNil ifTrue:[ + Dialog information:(resources + string:'Please enter an action method name.'). + ^ self + ]. + + selector := selector asSymbol. + + specClass isNil ifTrue:[ + self warn:'Please define the application class first.'. + ^ self + ]. + + cls := self resolveName:specClass. + cls isNil ifTrue:[ + self warn:'Class ', specClass asString, ' does not exist!!'. + ^ self + ]. + + (cls implements:selector) ifFalse:[ + category := UserPreferences current categoryForMenuActionsMethods. + + CodeGeneratorTool + createActionMethodFor:selector in:cls + category:category + redefine:(self redefineAspectMethodsChannel value). + ]. + + UserPreferences current systemBrowserClass + openInClass:cls selector:selector. +! + doGenerateAspectMethods "compile aspect and action methods" @@ -3662,17 +3705,17 @@ - ^ + ^ #(FullSpec name: basicsEditSpec - window: + window: (WindowSpec label: 'basicsEditSpec' name: 'basicsEditSpec' min: (Point 10 10) bounds: (Rectangle 0 0 340 340) ) - component: + component: (SpecCollection collection: ( (LabelSpec @@ -3736,7 +3779,7 @@ ) (InputFieldSpec name: 'valueField' - layout: (LayoutFrame 110 0 71 0 -5 1.0 93 0) + layout: (LayoutFrame 110 0 71 0 -25 1.0 93 0) activeHelpKey: basicsAction tabable: true model: itemValue @@ -3751,6 +3794,16 @@ modifiedChannel: modifiedChannel acceptOnPointerLeave: true ) + (ActionButtonSpec + label: 'browseActionImage' + name: 'Button1' + layout: (LayoutFrame -25 1 71 0 -5 1 93 0) + hasCharacterOrientedLabel: false + translateLabel: true + resizeForLabel: true + tabable: true + model: doBrowseActionMethod + ) (LabelSpec label: 'Argument:' name: 'argumentLabel' @@ -3910,7 +3963,7 @@ translateLabel: true ) ) - + ) ) ! !