ThingLab fix

Bruce Cohen cohenb at gemstone.com
Thu Jan 28 19:45:06 UTC 1999


The delete fix mentioned in my last message:

I found a couple of problems when attempting to delete a botch in
building the Quad example, and hacked DisplayRegionHack a little to
fix them; code is below.
-----------------------------------------------------------------------------
Engineering is never having to say you're finished.
-----------------------------------------------------------------------------
Bruce Cohen,                               |  email: cohenb at gemstone.com
GemStone Systems, Inc.                     |  phone: (503)533-3602
20575 NW Von Neumann Drive                 |  fax:   (503)629-8556
Beaverton, OR USA 97006                    |  web:   http://www.gemstone.com
-----------------------------------------------------------------------------


'From Squeak 2.3 of January 14, 1999 on 26 January 1999 at 2:17:12 pm'!
Form subclass: #DisplayRegionHack
	instanceVariableNames: 'clippingRectangle translation bitBlt '
	classVariableNames: ''
	poolDictionaries: ''
	category: 'ThingLab-Windows'!
!DisplayRegionHack commentStamp: '<historical>' prior: 0!
I am similar to the RegionMedium class in the Xerox research image; I just have the minimum
functionality needed to do the job.!


!DisplayRegionHack methodsFor: 'initialization'!
clippingRectangle: c translation: t
	clippingRectangle _ c.
	translation _ t.
	bitBlt _ BitBlt destForm: Display sourceForm: nil halftoneForm: nil combinationRule: nil destOrigin: t
		sourceOrigin: 0 at 0 extent: 0 at 0 clipRect: c! !

!DisplayRegionHack methodsFor: 'initialization' stamp: 'di 1/21/1999 20:10'!
depth
	^ bitBlt destForm depth! !


!DisplayRegionHack methodsFor: 'display medium protocol' stamp: 'bc 1/26/1999 14:06'!
boundingBox
	^ clippingRectangle! !

!DisplayRegionHack methodsFor: 'display medium protocol'!
computeBoundingBox
	^clippingRectangle! !

!DisplayRegionHack methodsFor: 'display medium protocol' stamp: 'di 1/21/1999 20:15'!
copyBits: sourceRect from: sourceForm at: destOrigin clippingBox: ignore rule: rule fillColor: aForm map: colorMapOrNil
	bitBlt sourceForm: sourceForm;
		sourceRect: sourceRect;
		destOrigin: destOrigin+translation;
		combinationRule: rule;
		fillColor: aForm;
		colorMap: colorMapOrNil.
	bitBlt copyBits! !

!DisplayRegionHack methodsFor: 'display medium protocol'!
copyBits: sourceRect from: sourceForm at: destOrigin clippingBox: ignore rule: rule mask: mask 
	bitBlt sourceForm: sourceForm;
		sourceRect: sourceRect;
		destOrigin: destOrigin+translation;
		combinationRule: rule;
		mask: mask.
	bitBlt copyBits! !

!DisplayRegionHack methodsFor: 'display medium protocol' stamp: 'di 1/21/1999 20:34'!
drawLine: sourceForm from: beginPoint to: endPoint rule: rule fillColor: aColor
	bitBlt sourceForm: sourceForm;
		sourceRect: sourceForm computeBoundingBox;
		combinationRule: rule;
		fillColor: aColor.
	bitBlt drawFrom: beginPoint+translation to: endPoint+translation! !

!DisplayRegionHack methodsFor: 'display medium protocol' stamp: 'di 1/21/1999 20:16'!
fill: rect rule: rule fillColor: aColor
	bitBlt sourceForm: nil;
		sourceOrigin: 0 at 0;
		destRect: (rect translateBy: translation);
		combinationRule: rule;
		fillColor: aColor.
	bitBlt copyBits! !

!DisplayRegionHack methodsFor: 'display medium protocol'!
fill: rect rule: rule mask: mask
	bitBlt sourceForm: nil;
		sourceOrigin: 0 at 0;
		destRect: (rect translateBy: translation);
		combinationRule: rule;
		mask: mask.
	bitBlt copyBits! !

!DisplayRegionHack methodsFor: 'display medium protocol' stamp: 'bc 1/26/1999 14:08'!
highLight
	"Color fromUser"
	"A default color that will at least reverse most bits"
	^ Color quickHighLight: self depth! !


!DisplayRegionHack methodsFor: 'paragraph hack'!
displayParagraph: para at: pt
	para displayOn: Display at: pt+translation clippingBox: clippingRectangle! !





More information about the Squeak-dev mailing list