'From etoys4.0 of 9 October 2008 [latest update: #2237] on 4 August 2009 at 11:09:20 pm'! "Change Set: fullScreenCheckbox-sw Date: 5 August 2009 Author: Scott Wallace Makes the full-screen/non-full-screen control in the scaling menu be a checkbox, just like all the other toggles in that menu. Make a click on the checkbox representing the current screen-mode deslelect and select another screen mode in its place."! !ProjectNavigationMorph methodsFor: 'the actions' stamp: 'sw 7/7/2009 07:06'! toggleFullScreen "Toggle the setting of fullScreen" self inFullScreenMode ifTrue: [self fullScreenOff] ifFalse: [self fullScreenOn]! ! !SugarNavigatorBar methodsFor: 'buttons creation' stamp: 'sw 8/4/2009 21:55'! availableDisplayModes "Answer an array of available screen modes. The full-screen item is not included now." | ret actual desired | ret _ OrderedCollection new: 3. ret add: #physical. actual _ DisplayScreen actualScreenSize. desired _ OLPCVirtualScreen virtualScreenExtent. actual = desired ifTrue: [^ ret]. ret add: #scaledVirtual. (actual x > desired x and: [actual y > desired y]) ifTrue: [ret add: #centeredVirtual]. ^ ret asArray! ! !SugarNavigatorBar methodsFor: 'buttons creation' stamp: 'sw 8/4/2009 23:01'! chooseScreenSetting "Put up a menu allowing the user to choose between virtual-olpc-display mode and normal-display mode." | aMenu availableModes | aMenu _ MenuMorph new defaultTarget: self. aMenu addTitle: 'display mode' translated. Preferences noviceMode ifFalse: [aMenu addStayUpItem]. availableModes _ self availableDisplayModes. availableModes do: [:mode | aMenu addUpdating: #stringForDisplayModeIs: target: self selector: #toggleScreenSetting: argumentList: {mode}. (self balloonTextForMode: mode) ifNotNilDo: [:help | aMenu balloonTextForLastItem: help translated]]. aMenu addLine. aMenu addUpdating: #stringForFullScreenToggle target: self action: #toggleFullScreen. aMenu popUpInWorld "(Flaps globalFlapTabWithID: 'Sugar Navigator Flap' translated) referent chooseScreenSetting"! ! !SugarNavigatorBar methodsFor: 'buttons creation' stamp: 'sw 8/4/2009 23:06'! stringForDisplayModeIs: aSymbol "Answer the description of the scaling mode represented by the given symbol." | currentMode | currentMode := self currentDisplayMode. #( (physical 'No Scaling') (scaledVirtual 'Scaled Virtual Extent') (centeredVirtual 'Centered Virtual Extent')) translatedNoop do: [:pair | aSymbol = pair first ifTrue: [^ (currentMode = aSymbol ifTrue: [''] ifFalse: ['']), pair second translated]]. ^ 'error'! ! !SugarNavigatorBar methodsFor: 'buttons creation' stamp: 'sw 8/4/2009 22:04'! stringForFullScreenToggle "Answer the wording forf the full-screen toggle." ^ (self inFullScreenMode ifTrue: [''] ifFalse: ['']), 'Full Screen' translated! ! !SugarNavigatorBar methodsFor: 'button actions' stamp: 'sw 8/4/2009 23:06'! changeDisplayModeTo: aSymbol "If the user's display mode is not already the one indicated by the input parameter, switch to that mode." aSymbol == #physical ifTrue: [ OLPCVirtualScreen virtualScreenExtent: nil. ^ OLPCVirtualScreen unInstall. ]. aSymbol == #scaledVirtual ifTrue: [ ^ OLPCVirtualScreen install. ]. aSymbol == #centeredVirtual ifTrue: [ OLPCVirtualScreen install. ^ Display zoomOut: true. ].! ! !SugarNavigatorBar methodsFor: 'button actions' stamp: 'sw 8/4/2009 23:01'! toggleScreenSetting: aSymbol "The user requested toggling of the display-mode item representing the given symbol" | currentMode | currentMode := self currentDisplayMode. aSymbol = currentMode ifTrue: [#( (physical scaledVirtual) (scaledVirtual physical) (centeredVirtual scaledVirtual)) do: [:pair | currentMode = pair first ifTrue: [^ self changeDisplayModeTo: pair second]]]. self changeDisplayModeTo: aSymbol! !