# HG changeset patch # User Claus Gittinger # Date 1081346870 -7200 # Node ID 3901166c295e7b9a71c99127a848c6ab2b5d8ac4 # Parent 025c3119062b9af8293f45a4c40ea7324019b5c0 *** empty log message *** diff -r 025c3119062b -r 3901166c295e TransparentBox.st --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TransparentBox.st Wed Apr 07 16:07:50 2004 +0200 @@ -0,0 +1,93 @@ +'From Smalltalk/X, Version:5.2.2 on 07-04-2004 at 04:07:23 PM' ! + +"{ Package: 'stx:libview2' }" + +View subclass:#TransparentBox + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'Views-Basic' +! + + +!TransparentBox methodsFor:'events'! + +sizeChanged:how + + self computeShape. +"/ self clear;redraw. + + ^super sizeChanged: how. + + + +! ! + +!TransparentBox methodsFor:'initialization'! + +initialize + + super initialize. + self computeShape. + self viewBackground: Color green. + + +" +| tv | + +tv := TopView new. + +gbox := GBOX origin:0.0@0.0 corner: 1.0@1.0 in: tv. +gbox viewBackground: Color green. + +tv open + +" + + + + + +! ! + +!TransparentBox methodsFor:'queries'! + +isTransparentBox + + ^true +! + +specClass + ^ TransparentBoxSpec +! ! + +!TransparentBox methodsFor:'shape computation'! + +computeShape + | borderForm subViews w h | + + device supportsArbitraryShapedViews ifFalse:[^self]. + + w := self extent x. + h := self extent y. + borderForm := Form width:w height:h. + borderForm fill:(Color colorId:0). + + borderForm foreground:(Color colorId:1). + + subViews := self subViews. + subViews isEmptyOrNil ifTrue:[ + self fillFormWithBorderShape:borderForm. + ] ifFalse:[ + subViews do:[:aSubView| + aSubView fillFormWithBorderShape:borderForm. + ] + ]. + self borderShape:borderForm. +! ! + +!TransparentBox class methodsFor:'documentation'! + +version + ^ '$Header: /cvs/stx/stx/libview2/TransparentBox.st,v 1.1 2004-04-07 14:07:50 cg Exp $' +! !