'From etoys2.3 of 28 November 2007 [latest update: #1834] on 12 December 2007 at 4:35:26 pm'! "Change Set: BookPickable-yo Date: 12 December 2007 Author: Yoshiki Ohshima A book should be pickable at its title bar, and the sticky bit of the title bar should be honored."! !BooklikeMorph methodsFor: 'misc' stamp: 'yo 8/29/2007 11:48'! moveViaTitle (self isSticky not) ifTrue: [self activeHand grabMorph: self] ! ! !BooklikeMorph methodsFor: 'misc' stamp: 'yo 12/12/2007 16:28'! moveViaTitle: arg event: evt from: aMorph (arg isSticky not) ifTrue: [self activeHand grabMorph: self] ! ! !BooklikeMorph methodsFor: 'page controls' stamp: 'yo 12/12/2007 16:27'! makePageControlsFrom: controlSpecs "From the controlSpecs, create a set of page control and return them -- this method does *not* add the controls to the receiver." | col row b lastGuy barColor buttonColor | barColor _ (color brightness > 0.5) ifTrue: [color darker] ifFalse: [color lighter]. buttonColor _ (color brightness > 0.5) ifTrue: [color twiceDarker] ifFalse: [color twiceLighter]. col _ AlignmentMorph newColumn. col color: barColor; 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. controlSpecs do: [:spec | spec == #showDescription ifTrue: [row addMorphBack: self makeDescriptionViewer]. spec == #pageNumber ifTrue: [row addMorphBack: self makePageNumberItem]. spec == #spacer ifTrue: [row addTransparentSpacerOfSize: (3 @ 0)]. spec == #variableSpacer ifTrue: [ row addMorphBack: AlignmentMorph newVariableTransparentSpacer]. spec class == Array ifTrue: [ spec first isSymbol ifTrue: [b := ThreePhaseButtonMorph labelSymbol: spec first] ifFalse: [b := SimpleButtonMorph new borderWidth: 2; borderColor: Color black; color: buttonColor. b label: spec first font: Preferences standardMenuFont]. b target: self; actionSelector: spec second; setBalloonText: spec third. (spec atPin: 4) = #border ifTrue: [b actWhen: #buttonDown] ifFalse: [b borderWidth: 0]. "default is none" 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! ! !BooklikeMorph methodsFor: 'page controls' stamp: 'yo 12/12/2007 16:28'! showPageControls: controlSpecs allowDragging: aBoolean "Remove any existing page controls, and add fresh controls at the top of the receiver (or in position 2 if the receiver's first submorph is one with property #header). Add a single column of controls." | pageControls column | self hidePageControls. column _ AlignmentMorph newColumn beTransparent. pageControls _ self makePageControlsFrom: controlSpecs. pageControls borderWidth: 0; layoutInset: 4. pageControls beSticky. pageControls setNameTo: 'Page Controls'. aBoolean ifTrue: [pageControls on: #mouseDown send: #moveViaTitle:event:from: to: self withValue: column]. column addMorphBack: pageControls. self addPageControlMorph: column! ! BooklikeMorph removeSelector: #makePageControlsFrom:allowDragging:!