'From etoys2.2 of 25 September 2007 [latest update: #1775] on 14 November 2007 at 2:01:16 pm'! "Change Set: classicNaviTrans-KR Date: 14 November 2007 Author: Korakurider translate buttons of classic etoys navigator, NebraskaNavigator, and InternalThreadNavigator"! !InternalThreadNavigationMorph methodsFor: 'initialization' stamp: 'KR 11/14/2007 14:01'! addButtons | marginPt i sz data images pageNumber f m b1 b2 dot arrowWidth arrowCenter vertices arrowHeight nameMorph sizeRatio controlsColor | sizeRatio _ self sizeRatio. controlsColor _ Color orange lighter. self changeNoLayout. self hResizing: #rigid. self vResizing: #rigid. marginPt _ (4 @ 4 * sizeRatio) rounded.. i _ self currentIndex. sz _ self myThumbnailSize. arrowWidth _ (14 * sizeRatio) rounded. arrowHeight _ (14 * sizeRatio) rounded. data _ { {i - 1. 'Previous:' translated. #previousPage. #leftCenter. arrowWidth. 'Prev' translated}. {i + 1. 'Next:' translated. #nextPage. #rightCenter. arrowWidth negated. 'Next' translated} }. images _ data collect: [ :tuple | pageNumber _ tuple first. (pageNumber between: 1 and: listOfPages size) ifTrue: [ f _ self makeThumbnailForPageNumber: pageNumber scaledToSize: sz default: tuple sixth. f _ f deepCopy. "we're going to mess it up" arrowCenter _ f boundingBox perform: tuple fourth. vertices _ { arrowCenter + (tuple fifth @ arrowHeight negated). arrowCenter + (tuple fifth @ arrowHeight). arrowCenter. }. f getCanvas drawPolygon: vertices color: controlsColor borderWidth: 0 borderColor: Color transparent. m _ ImageMorph new image: f. m setBalloonText: tuple second,' ',(listOfPages at: pageNumber) first. m addMouseUpActionWith: ( MessageSend receiver: self selector: tuple third ). ] ifFalse: [ f _ (Form extent: sz depth: 16) fillColor: Color lightGray. m _ ImageMorph new image: f. ]. m ]. b1 _ images first. b2 _ images second. dot _ EllipseMorph new extent: (18@18 * sizeRatio) rounded; color: controlsColor; borderWidth: 0. self addMorph: (b1 position: self position + marginPt). self addMorph: (b2 position: b1 topRight + (marginPt x @ 0)). self extent: (b1 bottomRight max: b2 bottomRight) - self position + marginPt. self addMorph: dot. dot align: dot center with: b1 bounds rightCenter + ((marginPt x @ 0) // 2). dot setBalloonText: threadName,'more commands' translated. dot on: #mouseDown send: #moreCommands to: self. self fullBounds. self addMorph: (nameMorph _ SquishedNameMorph new). nameMorph target: self getSelector: #threadName setSelector: nil; color: Color transparent; width: self width; height: (15 * sizeRatio) rounded; align: nameMorph bottomLeft with: self bottomLeft. ! ! !InternalThreadNavigationMorph methodsFor: 'navigation' stamp: 'KR 11/14/2007 13:21'! buttonForMenu ^self makeButton: '?' balloonText: 'More commands' translated for: #moreCommands. ! ! !ProjectNavigationMorph methodsFor: 'as yet unclassified' stamp: 'KR 11/14/2007 12:26'! makeButton: aString balloonText: anotherString for: aSymbol self flag: #yo. "In principle, this method shouldn't call #translated." ^ SimpleButtonDelayedMenuMorph new target: self; borderColor: #raised; color: self colorForButtons; label: aString font: self fontForButtons; setBalloonText: anotherString; actionSelector: aSymbol! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'KR 11/7/2007 14:40'! buttonFind "Answer a button for finding/loading projects" ^ self makeButton: 'FIND' translated balloonText: 'Click here to find a project. Hold down this button to reveal additional options.' translated for: #findAProjectSimple ! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'KR 11/14/2007 12:47'! buttonFlaps ^self inFlapsSuppressedMode ifTrue: [ self makeButton: 'Show tabs' translated balloonText: 'Show tabs' translated for: #toggleFlapsSuppressed ] ifFalse: [ self makeButton: 'Hide tabs' translated balloonText: 'Hide tabs' translated for: #toggleFlapsSuppressed ]. ! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'KR 11/14/2007 12:47'! buttonFullScreen ^self inFullScreenMode ifTrue: [ self makeButton: 'Browser Reentry' translated balloonText: 'Re-enter the browser' translated for: #fullScreenOff ] ifFalse: [ self makeButton: 'Escape Browser' translated balloonText: 'Use the full screen' translated for: #fullScreenOn ] ! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'KR 11/14/2007 12:38'! buttonGoTo ^self makeButton: 'GO TO' translated balloonText: 'Go to another project' translated for: #gotoAnother ! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'KR 11/7/2007 14:40'! buttonNewProject ^self makeButton: 'NEW' translated balloonText: 'Start a new project' translated for: #newProject ! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'KR 11/14/2007 12:38'! buttonNewer ^self makeButton: 'Newer?' translated balloonText: 'Is there a newer version of this project ?' translated for: #getNewerVersionIfAvailable! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'KR 11/14/2007 12:37'! buttonNext ^self makeButton: 'NEXT >' translated balloonText: 'Next project' translated for: #nextProject! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'KR 11/14/2007 12:43'! buttonPaint | pb oldArgs brush myButton m | myButton _ self makeButton: '' balloonText: 'Make a painting' translated for: #doNewPainting. pb _ PaintBoxMorph new submorphNamed: #paint:. pb ifNil: [ (brush _ Form extent: 16@16 depth: 16) fillColor: Color red ] ifNotNil: [ oldArgs _ pb arguments. brush _ oldArgs third. brush _ brush copy: (2@0 extent: 42@38). brush _ brush scaledToSize: brush extent // 2. ]. myButton addMorph: (m _ brush asMorph lock). myButton extent: m extent + (myButton borderWidth + 6). m position: myButton center - (m extent // 2). ^myButton "brush _ (ScriptingSystem formAtKey: 'Painting')." ! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'KR 11/7/2007 14:41'! buttonPrev ^self makeButton: '< PREV' translated balloonText: 'Previous project' translated for: #previousProject! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'KR 11/14/2007 12:37'! buttonQuit ^self makeButton: 'QUIT' translated balloonText: 'Quit Squeak altogether' translated for: #quitSqueak ! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'KR 11/14/2007 12:36'! buttonTell ^self makeButton: 'Tell!!' translated balloonText: 'Tell a friend about this project' translated for: #tellAFriend ! ! !NebraskaNavigationMorph methodsFor: 'as yet unclassified' stamp: 'KR 11/14/2007 13:29'! buttonBuffered ^self makeButton: 'B' balloonText: 'Request buffered Nebraska session' translated for: #bufferNebraska ! ! !NebraskaNavigationMorph methodsFor: 'as yet unclassified' stamp: 'KR 11/14/2007 13:28'! buttonScale ^self makeButton: '1x1' balloonText: 'Switch between 1x1 and scaled view' translated for: #toggleFullView ! ! !NebraskaNavigationMorph methodsFor: 'the buttons' stamp: 'KR 11/14/2007 13:30'! buttonQuit ^self makeButton: 'Quit' translated balloonText: 'Quit this Nebraska session' translated for: #quitNebraska ! !