'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 5 January 2009 at 11:43:03 am'!
!classDefinition: #OldPasteUpMorph category: #'Morphic-OldWorlds'!
OldBorderedMorph subclass: #OldPasteUpMorph
	instanceVariableNames: 'cursor backgroundMorph worldState'
	classVariableNames: 'DisableDeferredUpdates'
	poolDictionaries: ''
	category: 'Morphic-OldWorlds'!
!classDefinition: #ScrollingLabel2LW category: #'LightWidgets-Kernel'!
LabelLW subclass: #ScrollingLabel2LW
	instanceVariableNames: 'scrollPos hideTime'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'LightWidgets-Kernel'!

!ScrollingLabel2LW commentStamp: 'jmv 12/22/2008 16:50' prior: 0!
Examples:

SqueakSTB current applicationManager 
	textScrollerShow; 
	textScrollerMessage: 'Pongamos algo un poco mas largo para que esto del scroll tenga un poco mas de interes del que puede tener solamente asdlkjdfhlajsdfha asdkjfaslkdjfh lkjasdhf jasdfh lkjasdhflkjahsdlkfjhasdlkjf hasldkjf halsdkjf hlaksdjfh lakjsdhfl kjhasdlkj fhalskdjf hlkasdjfhlkajsdhf lkjasdh lkjasdh lkasdjhflkjasdhfl'
	
SqueakSTB current applicationManager textScrollerShow
SqueakSTB current applicationManager textScrollerHide
SqueakSTB current applicationManager textScrollerShowFor: 4

To alternate between ScrollingLabelLW (nice, takes a lot of cpu) and ScrollingLabel2LW (not so nice, cheap), change class references and restart system!

!classDefinition: #ScrollingLabelLW category: #'LightWidgets-Kernel'!
LabelLW subclass: #ScrollingLabelLW
	instanceVariableNames: 'scrollPos labelWidth hideTime'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'LightWidgets-Kernel'!

!ScrollingLabelLW commentStamp: 'jmv 12/22/2008 16:50' prior: 0!
Examples:

SqueakSTB current applicationManager 
	textScrollerShow; 
	textScrollerMessage: 'Pongamos algo un poco mas largo para que esto del scroll tenga un poco mas de interes del que puede tener solamente asdlkjdfhlajsdfha asdkjfaslkdjfh lkjasdhf jasdfh lkjasdhflkjahsdlkfjhasdlkjf hasldkjf halsdkjf hlaksdjfh lakjsdhfl kjhasdlkj fhalskdjf hlkasdjfhlkajsdhf lkjasdh lkjasdh lkasdjhflkjasdhfl'
	
SqueakSTB current applicationManager textScrollerShow
SqueakSTB current applicationManager textScrollerHide
SqueakSTB current applicationManager textScrollerShowFor: 4

To alternate between ScrollingLabelLW (nice, takes a lot of cpu) and ScrollingLabel2LW (not so nice, cheap), change class references and restart system!


!LightWidget methodsFor: 'stepping and presenter' stamp: 'jmv 12/21/2008 23:35'!
startStepping
	"Start getting sent the 'step' message."
	self startStepping: #stepAt: at: Time millisecondClockValue arguments: nil stepTime: nil.! !

!LightWidget methodsFor: 'stepping and presenter' stamp: 'jmv 12/21/2008 23:37'!
step
	"Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message. "
! !

!LightWidget methodsFor: 'stepping and presenter' stamp: 'jmv 12/21/2008 23:36'!
stepAt: millisecondClockValue
	"Do some periodic activity. Use startStepping/stopStepping to start and stop getting sent this message. The time between steps is specified by this morph's answer to the stepTime message.
	The millisecondClockValue parameter gives the value of the millisecond clock at the moment of dispatch.
	Default is to dispatch to the parameterless step method for the morph, but this protocol makes it possible for some morphs to do differing things depending on the clock value"
	
	self step! !

!LightWidget methodsFor: 'stepping and presenter' stamp: 'jmv 12/21/2008 23:36'!
stopStepping
	"Stop getting sent the 'step' message."

	| w |
	w _ self world.
	w ifNotNil: [w stopStepping: self]! !


!ScrollingLabel2LW methodsFor: 'stepping and presenter' stamp: 'jmv 12/22/2008 16:37'!
step

	(hideTime notNil and: [
		TimeStamp now asSeconds > hideTime ])
			ifTrue: [
				^self hide ].

	scrollPos _ scrollPos + 1.
	scrollPos > contents size ifTrue: [
		scrollPos _ 1 ].
	self comeToFront.
	self changed! !

!ScrollingLabel2LW methodsFor: 'stepping and presenter' stamp: 'jmv 12/22/2008 16:48'!
stepTime

	^ 400! !

!ScrollingLabel2LW methodsFor: 'testing' stamp: 'jmv 12/21/2008 23:33'!
wantsSteps

	^isVisible! !

!ScrollingLabel2LW methodsFor: 'initialization' stamp: 'jmv 12/22/2008 16:36'!
initialize
	super initialize.
	scrollPos _ 1! !

!ScrollingLabel2LW methodsFor: 'drawing' stamp: 'jmv 12/22/2008 16:46'!
drawOn: aCanvas

	aCanvas fillRectangle: bounds color: Color blue.

	aCanvas
		drawString: contents
		from: scrollPos
		to: (scrollPos + 70 min: contents size )
		at: bounds topLeft
		font: font 
		color: self fontColor! !

!ScrollingLabel2LW methodsFor: 'drawing' stamp: 'jmv 12/22/2008 00:30'!
visible: aBoolean

	super visible: aBoolean.
	hideTime _ nil.
	aBoolean
		ifTrue: [ self startStepping ]
		ifFalse: [ self stopStepping ]! !

!ScrollingLabel2LW methodsFor: 'accessing' stamp: 'jmv 12/22/2008 00:27'!
hideIn: seconds

	hideTime _ TimeStamp now asSeconds + seconds! !

!ScrollingLabel2LW methodsFor: 'accessing' stamp: 'jmv 12/22/2008 16:37'!
label: aString
	super label: aString.
	scrollPos _ 1.
	self changed! !


!ScrollingLabelLW methodsFor: 'stepping and presenter' stamp: 'jmv 12/22/2008 16:47'!
step

	(hideTime notNil and: [
		TimeStamp now asSeconds > hideTime ])
			ifTrue: [
				^self hide ].

	scrollPos _ scrollPos + 1.
	scrollPos > labelWidth ifTrue: [
		self initializeScroll].
	self comeToFront.
	self changed! !

!ScrollingLabelLW methodsFor: 'stepping and presenter' stamp: 'jmv 12/22/2008 00:20'!
stepTime

	^ 20! !

!ScrollingLabelLW methodsFor: 'testing' stamp: 'jmv 12/21/2008 23:33'!
wantsSteps

	^isVisible! !

!ScrollingLabelLW methodsFor: 'initialization' stamp: 'jmv 12/22/2008 00:24'!
initialize
	super initialize.
	self initializeScroll.
	labelWidth _ 0! !

!ScrollingLabelLW methodsFor: 'initialization' stamp: 'jmv 12/22/2008 00:24'!
initializeScroll

	scrollPos _ -200! !

!ScrollingLabelLW methodsFor: 'drawing' stamp: 'jmv 12/22/2008 00:17'!
drawOn: aCanvas

	aCanvas fillRectangle: bounds color: (Color blue alpha: 0.4).

	aCanvas
		drawString: contents
		at: bounds topLeft - (scrollPos @ 0)
		font: font 
		color: self fontColor! !

!ScrollingLabelLW methodsFor: 'drawing' stamp: 'jmv 12/22/2008 00:30'!
visible: aBoolean

	super visible: aBoolean.
	hideTime _ nil.
	aBoolean
		ifTrue: [ self startStepping ]
		ifFalse: [ self stopStepping ]! !

!ScrollingLabelLW methodsFor: 'accessing' stamp: 'jmv 12/22/2008 00:27'!
hideIn: seconds

	hideTime _ TimeStamp now asSeconds + seconds! !

!ScrollingLabelLW methodsFor: 'accessing' stamp: 'jmv 12/22/2008 00:25'!
label: aString
	super label: aString.
	self initializeScroll.
	labelWidth _ self labelWidth.
	self changed! !

OldPasteUpMorph class removeSelector: #MinCycleLapse:!
IndeterminatePogressBarLW removeSelector: #startStepping!
