'From etoys2.1 of 26 July 2007 [latest update: #1568] on 29 August 2007 at 2:10:22 pm'! "Change Set: icon Date: 22 August 2007 Author: Takashi Yamamiya Better next and previous button for BookMorph. " ScriptingSystem formDictionary at: #NextPage put: ( (GIFReadWriter on: (Base64MimeConverter mimeDecodeToBytes: 'R0lGODlhHgAeAJEAAAAAAP///8zMzP//vyH5BAUUAAMALAAAAAAeAB4AAAJ7nI8jy5sP1Qq0 UhahsJyLfEzdeH3RRqaXpraBiaAuCRtyCrTwjeeqySMBhj/bbEikKYTIJjIl6jinvk6UQ52O rpas1hOkeJ3WcGD8LDPHNDMaunQ14fFWWllXJel5oS5hNvPyEDhTEyJolcGlc8hiCALIWOIY adOAAVIAADs=' readStream) readStream) nextImage). ScriptingSystem formDictionary at: #PrevPage put: ( (GIFReadWriter on: (Base64MimeConverter mimeDecodeToBytes: 'R0lGODlhHgAeAJEAAAAAAP///8zMzP//vyH5BAUUAAMALAAAAAAeAB4AAAJ6nI8jy5sP1Qq0 UhahsJyLfEzdeH3RRqaXpraBiaAuCRsyCbjwPQK5blP5fi0TzzIkqj7HSvLpozUDUKi0V31e OVnrSITsJrdccfQ7NSst4I6ZpkiNgXH5uRgUruF5OT00k1LTF+jBUsiW0aYzePgHYrNYgQGp 0UCZUQAAOw==' readStream) readStream) nextImage). ! !BooklikeMorph methodsFor: 'page controls' stamp: 'tak 8/27/2007 15:25'! makePageControlsFrom: controlSpecs allowDragging: aBoolean "From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver." | c col row b lastGuy pageNumberItem | c _ (color saturation > 0.1) ifTrue: [color slightlyLighter] ifFalse: [color slightlyDarker]. col _ AlignmentMorph newColumn. col color: c; borderWidth: 0; layoutInset: 0. col hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5. row _ AlignmentMorph newRow beTransparent. row borderWidth: 0; layoutInset: 0. row hResizing: #spaceFill; vResizing: #shrinkWrap; extent: 5@5. aBoolean ifTrue: [row on: #mouseDown send: #moveViaTitle to: self]. controlSpecs do: [:spec | spec == #pageNumber ifTrue: [pageNumberItem := UpdatingStringMorph new. pageNumberItem target: self; getSelector: #pageNumberReport. pageNumberItem useStringFormat. pageNumberItem font: Preferences standardMenuFont. row addMorphBack: pageNumberItem ] ifFalse: [spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (3 @ 0)] ifFalse: [spec == #variableSpacer ifTrue: [row addMorphBack: AlignmentMorph newVariableTransparentSpacer] ifFalse: [spec first isSymbol ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first] ifFalse: [b := SimpleButtonMorph new borderWidth: 2; borderColor: Color black; color: c darker. b label: spec first font: Preferences standardMenuFont]. b target: self; actionSelector: spec second; borderWidth: 0; setBalloonText: spec third. row addMorphBack: b. (((lastGuy _ spec last asLowercase) includesSubString: 'menu') or: [lastGuy includesSubString: 'designations']) ifTrue: [b actWhen: #buttonDown]]]]]. "pop up menu on mouseDown" col addMorphBack: row. ^ col! ! !BookMorph methodsFor: 'page controls' stamp: 'tak 8/27/2007 14:36'! fullControlSpecs ^ { {#DownCaret. #fewerPageControls. 'Fewer controls' translated}. #spacer. #variableSpacer. {'-'. #deletePage. 'Delete this page' translated}. #spacer. {'«'. #firstPage. 'First page' translated}. #spacer. {#PrevPage. #previousPage. 'Previous page' translated}. #spacer. {#MenuIcon. #invokeBookMenu. 'Click here to get a menu of options for this book.' translated}. #spacer. {#NextPage. #nextPage. 'Next page' translated}. #spacer. { '»'. #lastPage. 'Final page' translated}. #spacer. {'+'. #insertPage. 'Add a new page after this one' translated}. #variableSpacer. #pageNumber. } ! ! !BookMorph methodsFor: 'page controls' stamp: 'tak 8/27/2007 14:35'! shortControlSpecs "Answer specs defining the widgets in the short form of the control panel." ^ { {#RightCaret. #showMoreControls. 'More controls' translated}. #spacer. #variableSpacer. {#PrevPage. #previousPage. 'Previous page' translated}. #spacer. {#MenuIcon. #invokeShortBookMenu. 'Click here to get a menu of options for this book.' translated}. #spacer. {#NextPage. #nextPage. 'Next page' translated}. #spacer. #variableSpacer. #pageNumber. } ! ! !BookMorph class methodsFor: 'scripting' stamp: 'tak 8/27/2007 14:26'! nextPageButton "Answer a button that will take the user to the next page of its enclosing book" | aButton | aButton := ThreePhaseButtonMorph labelSymbol: #NextPage. aButton target: aButton. aButton actionSelector: #nextOwnerPage. aButton arguments: EmptyArray. aButton setNameTo: 'previous'. ^ aButton! ! !BookMorph class methodsFor: 'scripting' stamp: 'tak 8/27/2007 14:26'! previousPageButton "Answer a button that will take the user to the previous page of its enclosing book" | aButton | aButton := ThreePhaseButtonMorph labelSymbol: #PrevPage. aButton target: aButton. aButton actionSelector: #previousOwnerPage. aButton arguments: EmptyArray. aButton setNameTo: 'previous'. ^ aButton! !