'From Squeakland 3.8-05 of 1 September 2005 [latest update: #527] on 23 June 2006 at 2:01:34 pm'! !DamaMathPhraseTile methodsFor: 'event' stamp: 'ko 6/23/2006 12:54'! mouseDown: evt "Handle a mouse-down on the receiver" | argTile phraseTile editor tilepad | self isPartsDonor ifTrue: [^super mouseDown: evt]. submorphs isEmpty ifTrue: [^ super mouseDown: evt]. ( owner isKindOf: TilePadMorph ) ifTrue: [ tilepad _ owner. argTile _ DamaUtil makeDefaultTile: owner type. argTile _ (TilePadMorph new setType: owner type) addMorph: argTile. "ObjectMorph(引数タイル)に新しいタイルをセットする" ( phraseTile _ self ownerThatIsA: DamaMathPhraseTile) ifNotNil: [ phraseTile code subjectMorph = self ifTrue: [ phraseTile code subjectMorph: argTile. argTile receiverOfCodeChange: ( ReceiverOfMathCodeChange new place: #left ; mathPhraseTile: phraseTile ). ] ifFalse: [ phraseTile code objectMorph: argTile. argTile receiverOfCodeChange: ( ReceiverOfMathCodeChange new place: #right ; mathPhraseTile: phraseTile ). ]. ] ifNil: [ (self ownerThatIsA: DamaPhraseTileMorph) objectMorph: argTile. argTile receiverOfCodeChange: ( ReceiverOfPhraseCodeChange new phraseTile: (self ownerThatIsA: DamaPhraseTileMorph ) ). ]. owner addMorphBack: argTile. owner removeMorph: self. (editor := tilepad topEditor) ifNotNil: [editor install]. ^evt hand grabMorph: self. ]. ^super mouseDown: evt.!]lang[(402 20 874)0,5,0! ! !DamaPhraseTileMorph methodsFor: 'event handling' stamp: 'ko 6/23/2006 13:45'! mouseDown: evt "Handle a mouse-down on the receiver" | argTile booleanScriptEditor editor tilepad phraseTile | self isPartsDonor ifTrue: [^super mouseDown: evt]. submorphs isEmpty ifTrue: [^ super mouseDown: evt]. "どこかの引数タイルとして埋め込まれていたときにマウスで掴まれたら 命令タイル(DamaPhraseTile)の見た目を更新する" ( owner isKindOf: TilePadMorph ) ifTrue: [ tilepad _ owner. "代わりのタイルを作成する" argTile _ DamaUtil makeDefaultTile: owner type. argTile _ (TilePadMorph new setType: owner type) addMorph: argTile. "ObjectMorph(引数タイル)に新しいタイルをセットする" ( phraseTile _ self ownerThatIsA: DamaMathPhraseTile) ifNotNil: [ phraseTile code subjectMorph = self ifTrue: [ phraseTile code subjectMorph: argTile. argTile receiverOfCodeChange: ( ReceiverOfMathCodeChange new place: #left ; mathPhraseTile: phraseTile ). ] ifFalse: [ phraseTile code objectMorph: argTile. argTile receiverOfCodeChange: ( ReceiverOfMathCodeChange new place: #right ; mathPhraseTile: phraseTile ). ]. ] ifNil: [ (self ownerThatIsA: DamaPhraseTileMorph) objectMorph: argTile. argTile receiverOfCodeChange: ( ReceiverOfPhraseCodeChange new phraseTile: (self ownerThatIsA: DamaPhraseTileMorph ) ). ]. "代わりのタイルをaddする" owner addMorphBack: argTile. "自分をremoveする" owner removeMorph: self. (editor := tilepad topEditor) ifNotNil: [editor install]. ^evt hand grabMorph: self. ]. "テストタイルにて調べる対象になっていた時に掴まれたら テストタイルの見た目を更新する" ( owner owner isKindOf: DamaBooleanScriptEditor ) ifTrue: [ booleanScriptEditor _ owner owner. "自分をremoveする" owner removeMorph: self. "テストタイルの見た目を更新する" booleanScriptEditor initializeView. ^evt hand grabMorph: self. ]. ^super mouseDown: evt.!]lang[(224 32 3 6 14 10 70 12 137 20 698 8 3 2 37 3 6 2 127 26 3 15 104 3 6 2 33 15 98)0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0,5,0! !