'From etoys2.3 of 28 November 2007 [latest update: #1863] on 24 December 2007 at 9:04:26 pm'! "Change Set: SugarNav24-yo Date: 24 December 2007 Author: Yoshiki Ohshima Put findButton but make it invisible in Sugar."! ProjectNavigationMorph subclass: #SugarNavigatorBar instanceVariableNames: 'sugarLib highLightColor undoButton shareButton zoomButton supplies listener suppliesFlap projectNameField findButton ' classVariableNames: '' poolDictionaries: '' category: 'Sugar'! !SugarNavigatorBar methodsFor: 'initialization' stamp: 'yo 12/24/2007 17:17'! findButtonAppearance findButton ifNotNilDo: [:n | n visible: SugarLauncher isRunningInSugar not]. ! ! !SugarNavigatorBar methodsFor: 'initialization' stamp: 'yo 12/24/2007 17:19'! makeTheSimpleButtons "Add the buttons for use in normal kids' mode." ^ {self buttonHelp}, ( true "SugarLauncher current isRunningInSugar" ifTrue: [{self makeProjectNameLabel}] ifFalse: [#()] ), { "self buttonNewProject." self buttonPrev. "self buttonNext." "self buttonFind." self buttonPaint. self buttonSupplies. }, " ( Preferences includeSoundControlInNavigator ifTrue: [{self buttonSound}] ifFalse: [#()] )," { self buttonUndo. self buttonLanguage. self buttonShare. }, (((DisplayScreen actualScreenSize = OLPCVirtualScreen virtualScreenExtent) ifFalse: [{self buttonZoom}] ifTrue: [#()])), { #spacer. self buttonFind. self buttonPublish. self buttonStop. } ! ! !SugarNavigatorBar methodsFor: 'morphic interaction' stamp: 'yo 12/24/2007 21:00'! checkForResize | shouldResize h worldBounds inset | shouldResize _ false. worldBounds _ self world bounds. (self layoutInset ~= (inset _ SugarLauncher isRunningInSugar ifTrue: [75@0] ifFalse: [0@0])) ifTrue: [self layoutInset: inset]. worldBounds width ~= self width ifTrue: [shouldResize _ true]. (h _ submorphs first submorphs first height) ~= self height ifTrue: [shouldResize _ true]. (owner notNil and: [owner isFlapTab]) ifTrue: [ owner edgeToAdhereTo == #top ifTrue: [ self topLeft ~= worldBounds topLeft ifTrue: [shouldResize _ true]. ]. owner edgeToAdhereTo == #bottom ifTrue: [ self bottomLeft ~= worldBounds bottomLeft ifTrue: [shouldResize _ true]. ]. shouldResize ifTrue: [ owner edgeToAdhereTo == #top ifTrue: [ self bounds: (0@0 corner: (worldBounds width@h)). ]. owner edgeToAdhereTo == #bottom ifTrue: [ self bounds: (0@(worldBounds height - h) corner: (worldBounds bottomRight)). ]. self resizeProjectNameField. ]. ].! ! !SugarNavigatorBar methodsFor: 'morphic interaction' stamp: 'yo 12/24/2007 17:17'! step self checkForResize. self undoButtonAppearance. self zoomButtonAppearance. self findButtonAppearance. ! ! !SugarNavigatorBar methodsFor: 'buttons creation' stamp: 'yo 12/24/2007 17:16'! buttonFind ^ findButton _ super buttonFind. ! ! !SugarNavigatorBar methodsFor: 'the actions' stamp: 'yo 12/24/2007 17:21'! resizeProjectNameField "The height should be 45 according to the Sugar guilde line, but an odd number makes the circle distorted. To be general, it uses 60% of the height of bar." | h | h _ (self height * 0.6) roundTo: 2. projectNameField ifNotNil: [projectNameField extent: (Display width >= 1200 ifTrue: [240] ifFalse: [130])@h.]. ! ! ProjectNavigationMorph subclass: #SugarNavigatorBar instanceVariableNames: 'sugarLib highLightColor undoButton shareButton zoomButton supplies listener suppliesFlap projectNameField findButton' classVariableNames: '' poolDictionaries: '' category: 'Sugar'!