'From Squeak3.0 of 4 February 2001 [latest update: #3414] on 4 February 2001 at 11:19:17 am'! "Change Set: ACGV3Stuff1.cs Date: 4 February 2001 Author: Andrew C. Greenberg 1) Fixes layout bug in SpectrumAnalyzerMorph. 2) Command-m shortcut in World brings up the 'Add a new morph' menu "! !PasteUpMorph methodsFor: 'world menu' stamp: 'acg 2/4/2001 10:52'! keystrokeInWorld: evt "A keystroke was hit when no keyboard focus was in set, so it is sent here to the world instead. This current implementation is regrettably hard-coded; until someone cleans this up, you may be tempted to edit this method to suit your personal taste in interpreting cmd-keys issued to the desktop." | aChar isCmd | aChar _ evt keyCharacter. isCmd _ evt commandKeyPressed and: [Preferences cmdKeysInText]. isCmd ifTrue: [(aChar == $z) ifTrue: [^ self commandHistory undoOrRedoCommand]. (aChar == $w) ifTrue: [^ SystemWindow closeTopWindow]. (aChar == $\) ifTrue: [^ SystemWindow sendTopWindowToBack]. (aChar == $t) ifTrue: [^ self findATranscript: evt]. (aChar == $b) ifTrue: [^ Browser openBrowser]. (aChar == $k) ifTrue: [^ Workspace open]. (aChar == $m) ifTrue: [^ TheWorldMenu new adaptToWorld: World; newMorph]. (aChar == $C) ifTrue: [^ self findAChangeSorter: evt]. (aChar == $R) ifTrue: [^ self openRecentSubmissionsBrowser: evt]. (aChar == $r) ifTrue: [^ Display restoreMorphicDisplay]. (aChar == $W) ifTrue: [^ self invokeWorldMenu: evt]] "This last item is a weirdo feature requested by the Open School in Fall of 2000 as a keyhole to the world menu in systems that normally do not offer a world menu"! ! !SpectrumAnalyzerMorph methodsFor: 'private' stamp: 'acg 2/4/2001 11:01'! initialize super initialize. borderWidth _ 2. self listDirection: #topToBottom. soundInput _ SoundInputStream new samplingRate: 22050. fft _ FFT new: 512. displayType _ 'sonogram'. self hResizing: #shrinkWrap. self vResizing: #shrinkWrap. self addButtonRow. self addLevelSlider. self addMorphBack: self makeLevelMeter. self addMorphBack: (Morph new extent: 10@10; color: Color transparent). "spacer" self resetDisplay. "adds the display morph" ! !