'From etoys2.1 of 8 August 2007 [latest update: #1614] on 11 September 2007 at 11:54:22 am'! "Change Set: NewProjWithBalloon-yo Date: 11 September 2007 Author: Yoshiki Ohshima A mechanism to put up balloon helps upon entering a new project."! BorderedMorph subclass: #DoCommandOnceMorph instanceVariableNames: 'target command actionBlock innerArea deleteAfterExecution ' classVariableNames: '' poolDictionaries: '' category: 'Morphic-Basic'! !DoCommandOnceMorph methodsFor: 'as yet unclassified' stamp: 'yo 9/11/2007 11:43'! deleteAfterExecution: aBoolean deleteAfterExecution _ aBoolean. ! ! !DoCommandOnceMorph methodsFor: 'initialization' stamp: 'yo 9/11/2007 11:34'! initialize "initialize the state of the receiver" super initialize. "" "self useRoundedCorners" deleteAfterExecution _ false. ! ! !DoCommandOnceMorph methodsFor: 'stepping and presenter' stamp: 'yo 9/11/2007 11:43'! step | goForIt | actionBlock ifNil: [^self stopStepping]. goForIt _ actionBlock. actionBlock _ nil. [ goForIt value. ] on: ProgressTargetRequestNotification do: [ :ex | ex resume: innerArea]. "in case a save/load progress display needs a home" deleteAfterExecution == true ifTrue: [ owner removeMorph: self ]. ! ! !Project class methodsFor: 'instance creation' stamp: 'yo 9/11/2007 11:51'! enterNewWithInitialBalloons | newP | newP := Project newMorphicOn: nil. newP world addMorph: (DoCommandOnceMorph new extent: 1@1; actionBlock: [SugarNavigatorBar putUpInitialBalloonHelp]; deleteAfterExecution: true; yourself). newP enter. ! ! !SugarNavigatorBar methodsFor: 'initialization' stamp: 'yo 9/11/2007 11:52'! putUpInitialBalloonHelp " SugarLauncher basicNew putUpInitialBalloonHelp " | paintButton suppliesButton b1 b2 p b | paintButton _ undoButton owner submorphs detect: [:e | e isButton and: [e actionSelector = #doNewPainting]]. suppliesButton _ undoButton owner submorphs detect: [:e | e isButton and: [e actionSelector = #toggleSupplies]]. b1 _ BalloonMorph string: self paintButtonInitialExplanation for: paintButton. b2 _ BalloonMorph string: self suppliesButtonInitialExplanation for: suppliesButton. p _ PasteUpMorph new. p clipSubmorphs: false. p color: Color transparent. p borderWidth: 0. p addMorph: b1. p addMorph: b2. b _ BalloonMorph contentsMorph: p for: World corner: #bottomLeft. b color: Color transparent. b borderWidth: 0. [(Delay forSeconds: 1) wait. b popUpForHand: ActiveHand] fork. ! ! !SugarNavigatorBar class methodsFor: 'utilitity' stamp: 'yo 9/11/2007 11:46'! putUpInitialBalloonHelp | flap | flap _ Flaps globalFlapTabWithID: 'Sugar Navigator Flap' translated. flap ifNil: [^ self]. (flap referent isMemberOf: SugarNavigatorBar) ifFalse: [^ self]. flap referent putUpInitialBalloonHelp ! ! !SugarNavigatorBar class reorganize! ('instance creation' newWith: refreshButRetainOldContents) ('utilitity' putUpInitialBalloonHelp) ! SugarLauncher removeSelector: #putUpInitialBalloonHelp! Project class removeSelector: #deleteWelcomeAndEnterNew! BorderedMorph subclass: #DoCommandOnceMorph instanceVariableNames: 'target command actionBlock innerArea deleteAfterExecution' classVariableNames: '' poolDictionaries: '' category: 'Morphic-Basic'!