'From Squeak3.2alpha of 17 December 2001 [latest update: #4623] on 18 December 2001 at 9:25:39 pm'! "Change Set: Stationary2-ar Date: 17 December 2001 Author: Andreas Raab As per Kim's request this version is the new default."! !SimpleButtonMorph methodsFor: 'accessing' stamp: 'ar 12/17/2001 21:15'! actWhen: condition "Accepts symbols: #buttonDown, #buttonUp, and #whilePressed, #startDrag" actWhen _ condition. actWhen == #startDrag ifTrue:[self on: #startDrag send: #doButtonAction to: self].! ! !SimpleButtonMorph methodsFor: 'events' stamp: 'ar 12/17/2001 21:24'! doButtonAction "Perform the action of this button. Subclasses may override this method. The default behavior is to send the button's actionSelector to its target object with its arguments." (target ~~ nil and: [actionSelector ~~ nil]) ifTrue: [ Cursor normal showWhile: [ target perform: actionSelector withArguments: arguments]]. actWhen == #startDrag ifTrue:[ oldColor ifNotNil:[self color: oldColor]. ].! ! !IconicButton methodsFor: 'initialization' stamp: 'ar 12/17/2001 21:17'! borderThick self borderStyle: (BorderStyle width: 2 color: self raisedColor twiceDarker).! ! !IconicButton methodsFor: 'initialization' stamp: 'ar 12/18/2001 21:22'! initializeWithThumbnail: aThumbnail withLabel: aLabel andSend: aSelector to: aReceiver "Initialize the receiver to show aThumbnail on its face, giving it the label supplied and arranging for it, when the button goes down on it, to obtain a new morph by sending the supplied selector to the supplied receiver" | labeledItem | labeledItem _ AlignmentMorph newColumn beTransparent. labeledItem borderWidth: 0. labeledItem addMorph: aThumbnail. labeledItem addMorphBack: (Morph new extent: (4@4)) beTransparent. labeledItem addMorphBack: (BorderedStringMorph contents: aLabel font: (StrikeFont familyName: 'ComicBold' size: 15)). self beTransparent; labelGraphic: labeledItem imageForm; borderWidth: 0; target: aReceiver; actionSelector: #launchPartVia:label:; arguments: {aSelector. aLabel}; actWhen: #buttonDown. self stationarySetup.! ! !IconicButton methodsFor: 'initialization' stamp: 'ar 12/18/2001 21:22'! stationarySetup self actWhen: #startDrag. self cornerStyle: #rounded. self borderNormal. self on: #mouseEnter send: #borderThick to: self. self on: #mouseDown send: nil to: nil. self on: #mouseLeave send: #borderNormal to: self. self on: #mouseLeaveDragging send: #borderNormal to: self. self on: #mouseUp send: #borderThick to: self.! ! "Postscript: " PartsBin allInstances do:[:pb| pb submorphsDo:[:m| (m isKindOf: IconicButton) ifTrue:[m stationarySetup]. ]].!