'From etoys3.0 of 24 February 2008 [latest update: #2081] on 15 September 2008 at 9:07:52 pm'! "Change Set: basicRevert1 Date: 15 September 2008 Author: Yoshiki Ohshima The methods that will be overwritten by this changeset have very little (if any) differences from the version before them.This changeset just brings in the these previous versions."! !HandMorph methodsFor: 'nil' stamp: 'di 3/14/1999 10:03'! cursorBounds temporaryCursor == nil ifTrue: [^ self position extent: NormalCursor extent] ifFalse: [^ self position + temporaryCursorOffset extent: temporaryCursor extent]! ! !Interval methodsFor: 'nil' stamp: 'di 11/10/97 12:22'! includes: aNumber ^ aNumber between: self first and: self last! ! !ListView methodsFor: 'nil'! isSelectionBoxClipped "Answer whether there is a selection and whether the selection is visible on the screen." ^selection ~= 0 & (self selectionBox intersects: self clippingBox) not! ! !MIDIScore methodsFor: 'nil' stamp: 'di 10/21/2000 13:41'! durationInTicks | t | t _ 0. tracks, {ambientTrack} do: [:track | track do: [:n | (n isNoteEvent) ifTrue: [t _ t max: n endTime] ifFalse: [t _ t max: n time]]]. ^ t ! ! !Number methodsFor: 'nil'! raisedTo: aNumber "Answer the receiver raised to aNumber." (aNumber isInteger) ifTrue: ["Do the special case of integer power" ^self raisedToInteger: aNumber]. aNumber = 0 ifTrue: [^1]. "Special case of exponent=0" aNumber = 1 ifTrue: [^self]. "Special case of exponent=1" ^(aNumber * self ln) exp "Otherwise raise it to the power using logarithms"! ! !ParagraphEditor methodsFor: 'nil' stamp: 'yo 7/16/2003 15:00'! browseIt "Launch a browser for the current selection, if appropriate" | aSymbol anEntry brow | self flag: #yoCharCases. Preferences alternativeBrowseIt ifTrue: [^ self browseClassFromIt]. self lineSelectAndEmptyCheck: [^ self]. (aSymbol _ self selectedSymbol) isNil ifTrue: [^ view flash]. self terminateAndInitializeAround: [aSymbol first isUppercase ifTrue: [anEntry _ (Smalltalk at: aSymbol ifAbsent: [ self systemNavigation browseAllImplementorsOf: aSymbol. ^ nil]). anEntry isNil ifTrue: [^ view flash]. (anEntry isKindOf: Class) ifFalse: [anEntry _ anEntry class]. brow _ Preferences browseToolClass new. brow setClass: anEntry selector: nil. brow class openBrowserView: (brow openEditString: nil) label: 'System Browser'] ifFalse: [ self systemNavigation browseAllImplementorsOf: aSymbol]] ! ! !Random methodsFor: 'nil' stamp: 'sma 5/12/2000 12:25'! nextInt: anInteger "Answer a random integer in the interval [1, anInteger]." ^ (self next * anInteger) truncated + 1! ! !SelectorBrowser methodsFor: 'nil' stamp: 'tk 5/6/1999 13:57'! selectorMenu: aMenu ^ aMenu labels: 'senders implementors copy selector to clipboard' lines: #() selections: #(senders implementors copyName)! ! !SerialPort methodsFor: 'nil' stamp: 'jm 5/18/1998 15:37'! openPort: portNumber "Open the given serial port, using the settings specified by my instance variables." self close. self primClosePort: portNumber. self primOpenPort: portNumber baudRate: baudRate stopBitsType: stopBitsType parityType: parityType dataBits: dataBits inFlowControlType: inputFlowControlType outFlowControlType: outputFlowControlType xOnByte: xOnByte xOffByte: xOffByte. port _ portNumber. ! ! !TextInput methodsFor: 'nil' stamp: 'ls 8/5/1998 09:02'! reset textMorph setText: defaultValue! ! !TextPlusMorph methodsFor: 'nil' stamp: 'RAA 5/3/2001 17:47'! keyboardFocusChange: aBoolean | parent | "we basically ignore loss of focus unless it is going to one of our siblings" aBoolean ifFalse: [^self]. "A hand is wanting to send us characters..." self hasFocus ifFalse: [self editor "Forces install"]. "Inform our siblings we have taken the focus" parent _ self parentGeeMail ifNil: [^self]. parent allTextPlusMorphs do: [ :each | each == self ifFalse: [each keyboardFocusLostForSure] ]. ! ! !WatchMorph methodsFor: 'nil' stamp: 'di 5/16/2000 21:42'! createLabels | numeral font h r | self removeAllMorphs. font _ StrikeFont familyName: fontName size: (h _ self height min: self width)//8. r _ 1.0 - (1.4 * font height / h). 1 to: 12 do: [:hour | numeral _ romanNumerals ifTrue: [#('I' 'II' 'III' 'IV' 'V' 'VI' 'VII' ' VIII' 'IX' 'X' 'XI' 'XII') at: hour] ifFalse: [hour asString]. self addMorphBack: ((StringMorph contents: numeral font: font emphasis: 1) center: (self radius: r hourAngle: hour)) lock]. ! !