Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.725.mcz ==================== Summary ==================== Name: Morphic-cmm.725 Author: cmm Time: 8 May 2014, 11:07:42.239 am UUID: 8d7e08f0-4f57-413c-a417-82ecac09f391 Ancestors: Morphic-eem.724 Morphic, let Array class be responsible for the shared empty Array in the system. =============== Diff against Morphic-eem.724 =============== Item was changed: ----- Method: MenuMorph>>add:action: (in category 'construction') ----- + add: aString action: aSymbolOrValuable - add: aString action: aSymbolOrValuable "Append a menu item with the given label. If the item is selected, it will send the given selector to the default target object." "Details: Note that the menu item added captures the default target object at the time the item is added; the default target can later be changed before added additional items without affecting the targets of previously added entries. The model is that each entry is like a button that knows everything it needs to perform its action." + aSymbolOrValuable isSymbol + ifTrue: + [ self + add: aString + target: defaultTarget + selector: aSymbolOrValuable + argumentList: Array empty ] + ifFalse: + [ self + add: aString + target: aSymbolOrValuable + selector: #value + argumentList: Array empty ]! - aSymbolOrValuable isSymbol ifTrue:[ - self add: aString - target: defaultTarget - selector: aSymbolOrValuable - argumentList: EmptyArray. - ] ifFalse:[ - self add: aString - target: aSymbolOrValuable - selector: #value - argumentList: EmptyArray. - ] - ! Item was changed: ----- Method: MenuMorph>>add:help:action: (in category 'construction') ----- add: wordingString help: helpString action: aSymbol "Append a menu item with the given label. If the item is selected, it will send the given selector to the default target object." "Details: Note that the menu item added captures the default target object at the time the item is added; the default target can later be changed before added additional items without affecting the targets of previously added entries. The model is that each entry is like a button that knows everything it needs to perform its action." self add: wordingString target: defaultTarget selector: aSymbol + argumentList: Array empty. + self balloonTextForLastItem:helpString! - argumentList: EmptyArray. - self balloonTextForLastItem:helpString! Item was changed: ----- Method: MenuMorph>>add:target:action: (in category 'construction') ----- + add: aString target: aTarget action: aSymbol + self + add: aString - add: aString target: aTarget action: aSymbol - self add: aString target: aTarget selector: aSymbol + argumentList: Array empty! - argumentList: EmptyArray - ! Item was changed: ----- Method: MenuMorph>>add:target:selector: (in category 'construction') ----- + add: aString target: anObject selector: aSymbol - add: aString target: anObject selector: aSymbol "Append a menu item with the given label. If the item is selected, it will send the given selector to the target object." + self + add: aString - - self add: aString target: anObject selector: aSymbol + argumentList: Array empty! - argumentList: EmptyArray. - ! Item was changed: ----- Method: MenuMorph>>addUpdating:action: (in category 'construction') ----- + addUpdating: aWordingSelector action: aSymbol + self + addUpdating: aWordingSelector + target: defaultTarget + selector: aSymbol + argumentList: Array empty! - addUpdating: aWordingSelector action: aSymbol - - self addUpdating: aWordingSelector target: defaultTarget selector: aSymbol argumentList: EmptyArray - ! Item was changed: ----- Method: MenuMorph>>addUpdating:enablement:action: (in category 'construction') ----- + addUpdating: aWordingSelector enablement: anEnablementSelector action: aSymbol + self + addUpdating: aWordingSelector + enablementSelector: anEnablementSelector + target: defaultTarget + selector: aSymbol + argumentList: Array empty! - addUpdating: aWordingSelector enablement: anEnablementSelector action: aSymbol - - self addUpdating: aWordingSelector enablementSelector: anEnablementSelector target: defaultTarget selector: aSymbol argumentList: EmptyArray - ! Item was changed: ----- Method: MenuMorph>>addUpdating:target:action: (in category 'construction') ----- + addUpdating: aWordingSelector target: aTarget action: aSymbol + self + addUpdating: aWordingSelector + target: aTarget + selector: aSymbol + argumentList: Array empty! - addUpdating: aWordingSelector target: aTarget action: aSymbol - - self addUpdating: aWordingSelector target: aTarget selector: aSymbol argumentList: EmptyArray - ! Item was changed: ----- Method: MenuMorph>>addWithLabel:enablement:action: (in category 'construction') ----- + addWithLabel: aLabel enablement: anEnablementSelector action: aSymbol + self + addWithLabel: aLabel + enablementSelector: anEnablementSelector + target: defaultTarget + selector: aSymbol + argumentList: Array empty! - addWithLabel: aLabel enablement: anEnablementSelector action: aSymbol - - self addWithLabel: aLabel enablementSelector: anEnablementSelector target: defaultTarget selector: aSymbol argumentList: EmptyArray - ! Item was changed: Object subclass: #Morph instanceVariableNames: 'bounds owner submorphs fullBounds color extension' + classVariableNames: '' - classVariableNames: 'EmptyArray' poolDictionaries: '' category: 'Morphic-Kernel'! !Morph commentStamp: 'efc 2/26/2003 20:01' prior: 0! A Morph (from the Greek "shape" or "form") is an interactive graphical object. General information on the Morphic system can be found at http://minnow.cc.gatech.edu/squeak/30. Morphs exist in a tree, rooted at a World (generally a PasteUpMorph). The morphs owned by a morph are its submorphs. Morphs are drawn recursively; if a Morph has no owner it never gets drawn. To hide a Morph and its submorphs, set its #visible property to false using the #visible: method. The World (screen) coordinate system is used for most coordinates, but can be changed if there is a TransformMorph somewhere in the owner chain. My instance variables have accessor methods (e.g., #bounds, #bounds:). Most users should use the accessor methods instead of using the instance variables directly. Structure: instance var Type Description bounds Rectangle A Rectangle indicating my position and a size that will enclose me. owner Morph My parent Morph, or nil for the top-level Morph, which is a or nil world, typically a PasteUpMorph. submorphs Array My child Morphs. fullBounds Rectangle A Rectangle minimally enclosing me and my submorphs. color Color My primary color. Subclasses can use this in different ways. extension MorphExtension Allows extra properties to be stored without adding a or nil storage burden to all morphs. By default, Morphs do not position their submorphs. Morphs may position their submorphs directly or use a LayoutPolicy to automatically control their submorph positioning. Although Morph has some support for BorderStyle, most users should use BorderedMorph if they want borders.! Item was changed: ----- Method: Morph class>>initialize (in category 'class initialization') ----- initialize "Morph initialize" - - "this empty array object is shared by all morphs with no submorphs:" - EmptyArray := Array new. FileList registerFileReader: self! Item was changed: ----- Method: Morph>>basicInitialize (in category 'initialization') ----- basicInitialize "Do basic generic initialization of the instance variables: Set up the receiver, created by a #basicNew and now ready to be initialized, by placing initial values in the instance variables as appropriate" + owner := nil. + submorphs := Array empty. - owner := nil. - submorphs := EmptyArray. bounds := self defaultBounds. - color := self defaultColor! Item was changed: ----- Method: Morph>>initialize (in category 'initialization') ----- initialize "initialize the state of the receiver" + owner := nil. + submorphs := Array empty. - owner := nil. - submorphs := EmptyArray. bounds := self defaultBounds. - color := self defaultColor! Item was changed: ----- Method: Morph>>models (in category 'model access') ----- models "Answer a collection of whatever models I may have." + ^ self modelOrNil + ifNil: [ Array empty ] + ifNotNil: [ Array with: self modelOrNil ]! - - self modelOrNil ifNil: [ ^EmptyArray ]. - ^Array with: self modelOrNil! Item was changed: ----- Method: Morph>>removeAllMorphs (in category 'submorphs-add/remove') ----- removeAllMorphs | oldMorphs myWorld | myWorld := self world. + (fullBounds notNil or: [ myWorld notNil ]) ifTrue: [ self invalidRect: self fullBounds ]. + submorphs do: + [ : m | myWorld ifNotNil: [ m outOfWorld: myWorld ]. + m privateOwner: nil ]. - (fullBounds notNil or:[myWorld notNil]) ifTrue:[self invalidRect: self fullBounds]. - submorphs do: [:m | myWorld ifNotNil: [ m outOfWorld: myWorld ]. m privateOwner: nil]. oldMorphs := submorphs. + submorphs := Array empty. + oldMorphs do: [ : m | self removedMorph: m ]. + self layoutChanged! - submorphs := EmptyArray. - oldMorphs do: [ :m | self removedMorph: m ]. - self layoutChanged. - ! Item was changed: ----- Method: MovieMorph>>initialize (in category 'initialization') ----- initialize "initialize the state of the receiver" super initialize. - "" - - playMode := #stop. "#stop, #playOnce, or #loop" + playMode := #stop. msecsPerFrame := 200. rotationDegrees := 0. scalePoint := 1.0 @ 1.0. + frameList := Array empty. - frameList := EmptyArray. currentFrameIndex := 1. dwellCount := 0! Item was changed: ----- Method: PopUpChoiceMorph>>initialize (in category 'initialization') ----- initialize "initialize the state of the receiver" super initialize. - "" self contents: 'PopUpChoice of Colors'. target := Color. actionSelector := nil. + arguments := Array empty. - arguments := EmptyArray. getItemsSelector := #colorNames. + getItemsArgs := Array empty! - getItemsArgs := EmptyArray! Item was changed: ----- Method: SimpleButtonMorph>>initializeAllButLabel (in category 'initialization') ----- initializeAllButLabel - super initialize. + self + borderWidth: 1 ; + color: (Color r: 0.4 g: 0.8 b: 0.6) ; + borderColor: self color darker ; + borderStyle: BorderStyle thinGray. - self borderWidth: 1. - self color: (Color r: 0.4 g: 0.8 b: 0.6). - self borderColor: self color darker. - self borderStyle: BorderStyle thinGray. target := nil. actionSelector := #flash. + arguments := Array empty. + actWhen := #buttonUp! - arguments := EmptyArray. - actWhen := #buttonUp - ! Item was changed: ----- Method: ThreePhaseButtonMorph>>initialize (in category 'initialization') ----- initialize - super initialize. state := #off. target := nil. actionSelector := #flash. + arguments := Array empty. + actWhen := #buttonUp - arguments := EmptyArray. - actWhen := #buttonUp. "self on: #mouseStillDown send: #dragIfAuthoring: to: self." "real move should include a call on dragIfAuthoring: "! |
Free forum by Nabble | Edit this page |