'From Squeakland 3.8.5976 of 25 August 2004 [latest update: #388] on 2 February 2005 at 3:32:28 pm'! "Change Set: MoreTranslation Date: 14 January 2005 Author: Yoshiki Ohshima Add a few more #translated message."! !BooklikeMorph methodsFor: 'page controls' stamp: 'yo 1/14/2005 19:25'! fullControlSpecs ^ { #spacer. #variableSpacer. {'-'. #deletePage. 'Delete this page' translated}. #spacer. {'«'. #firstPage. 'First page' translated}. #spacer. {'<'. #previousPage. 'Previous page' translated}. #spacer. {'·'. #invokeBookMenu. 'Click here to get a menu of options for this book.' translated}. #spacer. {'>'. #nextPage. 'Next page' translated}. #spacer. { '»'. #lastPage. 'Final page' translated}. #spacer. {'+'. #insertPage. 'Add a new page after this one' translated}. #variableSpacer. {'³'. #fewerPageControls. 'Fewer controls' translated} } ! ! !ButtonPropertiesMorph methodsFor: 'as yet unclassified' stamp: 'yo 1/14/2005 19:52'! valueForMouseDownHaloWidth ^ 'mouse-down halo width: ' translated, self targetProperties mouseDownHaloWidth printString ! ! !ButtonPropertiesMorph methodsFor: 'as yet unclassified' stamp: 'yo 1/14/2005 19:53'! valueForMouseOverHaloWidth ^ 'mouse-over halo width: ' translated, self targetProperties mouseOverHaloWidth printString ! ! !Lexicon methodsFor: 'vocabulary' stamp: 'yo 1/14/2005 19:57'! chooseVocabulary "Put up a dialog affording the user a chance to choose a different vocabulary to be installed in the receiver" | aMenu | aMenu _ MenuMorph new defaultTarget: self. aMenu addTitle: 'Choose a vocabulary blue = current red = imperfect' translated. aMenu addStayUpItem. Vocabulary allStandardVocabularies do: [:aVocabulary | (targetClass implementsVocabulary: aVocabulary) ifTrue: [aMenu add: aVocabulary vocabularyName selector: #switchToVocabulary: argument: aVocabulary. (targetClass fullyImplementsVocabulary: aVocabulary) ifFalse: [aMenu lastItem color: Color red]. aVocabulary == currentVocabulary ifTrue: [aMenu lastItem color: Color blue]. aMenu balloonTextForLastItem: aVocabulary documentation]]. aMenu popUpInWorld: self currentWorld! ! !MPEGMoviePlayerMorph class methodsFor: 'scripting' stamp: 'yo 1/14/2005 19:17'! additionsToViewerCategories "Answer a list of ( ) pairs that characterize the phrases this kind of morph wishes to add to various Viewer categories." ^ #( (basic ( (command play 'Start playing the movie/sound') (command stop 'Stop playing the movie/sound') (command rewind 'Rewind the movie/sound'))) (#'movie controls' ( (slot videoFileName 'The name for the video file' String readWrite Player getVideoFileName Player setVideoFileName:) (slot subtitlesFileName 'The name for the subtitles file' String readWrite Player getSubtitlesFileName Player setSubtitlesFileName:) (slot position 'A number representing the current position of the movie/sound.' Number readWrite Player getPosition Player setPosition:) (slot volume 'A number representing the volume of the movie.' Number readWrite Player getVolume Player setVolume:) (command play 'Start playing the movie/sound') (command playUntilPosition: 'Play until the given position, then stop' Number) (command stop 'Stop playing the movie/sound') (command rewind 'Rewind the movie/sound') (slot isRunning 'Whether the movie/sound is being played' Boolean readOnly Player getIsRunning unused unused) (slot repeat 'Whether the movie/sound will play in an endless loop' Boolean readWrite Player getRepeat Player setRepeat:) (slot totalFrames 'Length of this movie in number of frames' Number readOnly Player getTotalFrames unused unused) (slot totalSeconds 'Length of this movie in seconds' Number readOnly Player getTotalSeconds unused unused) (slot frameGraphic 'A graphic for the current frame' Graphic readOnly Player getFrameGraphic unused unused) ) ) )! ! !NaturalLanguageTranslator methodsFor: 'translation' stamp: 'yo 1/14/2005 16:25'! rawRemoveUntranslated: untranslated self class allKnownPhrases removeKey: untranslated ifAbsent: []. self changed: #untranslated.! ! !NaturalLanguageTranslator methodsFor: 'translation' stamp: 'yo 1/14/2005 16:25'! removeUntranslated: untranslated self class allKnownPhrases removeKey: untranslated ifAbsent: []. ! ! !Presenter methodsFor: 'standardPlayer etc' stamp: 'yo 1/14/2005 19:37'! createStandardPlayer | aMorph | aMorph _ ImageMorph new image: (ScriptingSystem formAtKey: 'standardPlayer'). associatedMorph addMorphFront: aMorph. standardPlayer _ aMorph assuredPlayer renameTo: 'dot' translated. aMorph setBalloonText: '...'. self positionStandardPlayer. ^ standardPlayer! ! !SimpleButtonMorph methodsFor: 'menu' stamp: 'yo 1/14/2005 19:43'! addCustomMenuItems: aCustomMenu hand: aHandMorph super addCustomMenuItems: aCustomMenu hand: aHandMorph. self addLabelItemsTo: aCustomMenu hand: aHandMorph. (target isKindOf: BookMorph) ifTrue: [aCustomMenu add: 'set page sound' translated action: #setPageSound:. aCustomMenu add: 'set page visual' translated action: #setPageVisual:] ifFalse: [aCustomMenu add: 'change action selector' translated action: #setActionSelector. aCustomMenu add: 'change arguments' translated action: #setArguments. aCustomMenu add: 'change when to act' translated action: #setActWhen. aCustomMenu add: 'change target' translated action: #setTarget. ((self world rootMorphsAt: aHandMorph targetOffset) size > 1) ifTrue: [aCustomMenu add: 'set target' translated action: #setTarget:]]. ! ! !SimpleButtonMorph methodsFor: 'menu' stamp: 'yo 1/14/2005 19:49'! setTarget | newLabel | newLabel := FillInTheBlank request: 'Enter an expression that create the target' translated initialAnswer: 'World'. newLabel isEmpty ifFalse: [self target: (Compiler evaluate: newLabel)]! ! !Viewer methodsFor: 'commands' stamp: 'yo 1/14/2005 19:57'! chooseVocabulary "Put up a menu allowing the user to specify which protocol to use in this viewer" | aMenu | aMenu _ MenuMorph new defaultTarget: self. aMenu addTitle: 'Choose a vocabulary' translated. "aMenu addStayUpItem." "For debugging only" Vocabulary allStandardVocabularies do: [:aVocabulary | (scriptedPlayer class implementsVocabulary: aVocabulary) ifTrue: [aMenu add: aVocabulary vocabularyName selector: #switchToVocabulary: argument: aVocabulary. aVocabulary == self currentVocabulary ifTrue: [aMenu lastItem color: Color blue]. aMenu balloonTextForLastItem: aVocabulary documentation]]. aMenu popUpInWorld: self currentWorld! ! !CategoryViewer methodsFor: 'entries' stamp: 'yo 1/14/2005 19:41'! phraseForCommandFrom: aMethodInterface "Answer a phrase for the non-slot-like command represented by aMethodInterface - classic tiles" | aRow resultType cmd names argType argTile selfTile aPhrase balloonTextSelector stat inst aDocString universal tileBearingHelp | aDocString _ aMethodInterface documentation. names _ scriptedPlayer class namedTileScriptSelectors. resultType _ aMethodInterface resultType. cmd _ aMethodInterface selector. (universal _ scriptedPlayer isUniversalTiles) ifTrue: [aPhrase _ scriptedPlayer universalTilesForInterface: aMethodInterface] ifFalse: [cmd numArgs == 0 ifTrue: [aPhrase _ PhraseTileMorph new vocabulary: self currentVocabulary. aPhrase setOperator: cmd type: resultType rcvrType: #Player] ifFalse: ["only one arg supported in classic tiles, so if this is fed with a selector with > 1 arg, results will be very strange" argType _ aMethodInterface typeForArgumentNumber: 1. aPhrase _ PhraseTileMorph new vocabulary: self currentVocabulary. aPhrase setOperator: cmd type: resultType rcvrType: #Player argType: argType. argTile _ ScriptingSystem tileForArgType: argType. (#(bounce: wrap:) includes: cmd) ifTrue: ["help for the embattled bj" argTile setLiteral: #silence translated]. argTile position: aPhrase lastSubmorph position. aPhrase lastSubmorph addMorph: argTile]]. (scriptedPlayer slotInfo includesKey: cmd) ifTrue: [balloonTextSelector _ #userSlot]. (scriptedPlayer belongsToUniClass and: [scriptedPlayer class includesSelector: cmd]) ifTrue: [aDocString ifNil: [aDocString _ (scriptedPlayer class userScriptForPlayer: scriptedPlayer selector: cmd) documentation]. aDocString ifNil: [balloonTextSelector _ #userScript]]. tileBearingHelp _ universal ifTrue: [aPhrase submorphs second] ifFalse: [aPhrase operatorTile]. aDocString ifNotNil: [tileBearingHelp setBalloonText: aDocString] ifNil: [balloonTextSelector ifNil: [tileBearingHelp setProperty: #inherentSelector toValue: cmd. balloonTextSelector _ #methodComment]. tileBearingHelp balloonTextSelector: balloonTextSelector]. aPhrase markAsPartsDonor. cmd == #emptyScript ifTrue: [aPhrase setProperty: #newPermanentScript toValue: true. aPhrase setProperty: #newPermanentPlayer toValue: scriptedPlayer. aPhrase submorphs second setBalloonText: 'drag and drop to add a new script' translated]. universal ifFalse: [selfTile _ self tileForSelf. selfTile position: aPhrase firstSubmorph position. aPhrase firstSubmorph addMorph: selfTile]. aRow _ ViewerLine newRow borderWidth: 0; color: self color. aRow elementSymbol: cmd asSymbol. aRow addMorphBack: (ScriptingSystem tryButtonFor: aPhrase). aRow addMorphBack: (Morph new extent: 2@2; beTransparent). aRow addMorphBack: (self infoButtonFor: cmd). aRow addMorphBack: aPhrase. aPhrase on: #mouseEnter send: #addCommandFeedback to: aRow. aPhrase on: #mouseLeave send: #removeHighlightFeedback to: aRow. aPhrase on: #mouseLeaveDragging send: #removeHighlightFeedback to: aRow. (names includes: cmd) ifTrue: [aPhrase userScriptSelector: cmd. cmd numArgs == 0 ifTrue: [aPhrase beTransparent. aRow addMorphBack: AlignmentMorph newVariableTransparentSpacer. aRow addMorphBack: (stat _ (inst _ scriptedPlayer scriptInstantiationForSelector: cmd) statusControlMorph). inst updateStatusMorph: stat]]. aRow beSticky; disableDragNDrop. ^ aRow! !