'From Moshi of 3 March 2007 [latest update: #253] on 20 July 2007 at 3:41:41 am'! "Change Set: magnifiers-sw Date: 20 July 2007 Author: Scott Wallace Only offer a single magnifier in the objects catalog. Expose three magnifier options in etoy Viewers. Cross-published from moshi update 0257magnifiers-sw. "! !MagnifierMorph methodsFor: 'magnifying' stamp: 'sw 7/20/2007 03:40'! magnification "Answer the value of my magnification." ^ magnification! ! !MagnifierMorph methodsFor: 'menu' stamp: 'sw 7/20/2007 03:39'! showingPointerString "Answer a string characterizing whether or not I'm showing the pointer." ^ (self showPointer ifTrue: [''] ifFalse: ['']), 'show pointer' translated! ! !MagnifierMorph methodsFor: 'menu' stamp: 'sw 7/20/2007 03:39'! trackingPointerString "Answer a string describing whether or not I'm currently tracking the pointer." ^ (trackPointer ifTrue: [''] ifFalse: ['']), 'track pointer' translated! ! !MagnifierMorph methodsFor: 'menu' stamp: 'sw 7/20/2007 03:40'! trackPointer "Answer the value of my trackPointer." ^ trackPointer! ! !MagnifierMorph methodsFor: 'menu' stamp: 'sw 7/20/2007 03:39'! trackPointer: aBoolean "Set the value of my trackPointer." trackPointer := aBoolean! ! !MagnifierMorph methodsFor: 'round view' stamp: 'sw 7/20/2007 03:40'! toggleRoundString "Answer a string describing whether the receiver is currently round." ^ (self isRound ifTrue: [''] ifFalse: ['']), 'round' translated! ! !MagnifierMorph class methodsFor: 'parts bin' stamp: 'sw 7/20/2007 03:41'! supplementaryPartsDescriptions "Answer extra parts-bin info. Currently, we add none..." true ifTrue: [^ {}]. ^ {DescriptionForPartsBin formalName: 'RoundGlass' categoryList: #('Just for Fun') documentation: 'A round magnifying glass' globalReceiverSymbol: #MagnifierMorph nativitySelector: #newRound. DescriptionForPartsBin formalName: 'Hand Magnifier' categoryList: #() documentation: 'A magnifying glass that also shows Morphs in the Hand and displays the Hand position.' globalReceiverSymbol: #MagnifierMorph nativitySelector: #newShowingPointer }! ! !MagnifierMorph class methodsFor: 'class initialization' stamp: 'sw 7/20/2007 02:52'! additionsToViewerCategories "Answer a list of ( ) pairs that characterize the phrases this kind of morph wishes to add to various Viewer categories." ^ #( (magnifier ( (slot magnification 'The factor by which the tool magnifies whatever it is looking at' Number readWrite Player getMagnification Player setMagnification:) (slot trackPointer 'Whether or not the pointer should track the cursor location' Boolean readWrite Player getTrackPointer Player setTrackPointer:) (slot showPointer 'Whether or not the pointer should show the cursor location' Boolean readWrite Player getShowPointer Player setShowPointer:) )))! ! !Player methodsFor: 'slot getters/setters' stamp: 'sw 7/20/2007 02:53'! getMagnification "Answer the bottom coordinate, in the cartesian sense (decreases towards bottom of screen)" ^ self costume renderedMorph magnification! ! !Player methodsFor: 'slot getters/setters' stamp: 'sw 7/20/2007 03:01'! getShowPointer "Answer the setting of my costume's showPointer" ^ self costume renderedMorph showPointer! ! !Player methodsFor: 'slot getters/setters' stamp: 'sw 7/20/2007 03:00'! getTrackPointer "Answer the setting of my costume's trackPointer" ^ self costume renderedMorph trackPointer! ! !Player methodsFor: 'slot getters/setters' stamp: 'sw 7/20/2007 03:28'! setMagnification: aNumber "Set the magnification" ^ self costume renderedMorph magnification: aNumber! ! !Player methodsFor: 'slot getters/setters' stamp: 'sw 7/20/2007 03:01'! setShowPointer: aBoolean "Set the value of my costume's showPointer" ^ self costume renderedMorph showPointer: aBoolean! ! !Player methodsFor: 'slot getters/setters' stamp: 'sw 7/20/2007 03:00'! setTrackPointer: aBoolean "Set the value of my costume's trackPointer" ^ self costume renderedMorph trackPointer: aBoolean! !