This is SubViewFramer.m in view mode; [Download] [Up]
// // A View that Frames its Subview // Randy NelsonÐCopyright NeXT 1990 // Not for release or reuse // #import "SubViewFramer.h" #import <dpsclient/wraps.h> #import <appkit/graphics.h> #import "VisibleOne.h" @implementation SubViewFramer //factory methodÐsets clipping off + newFrame:(NXRect *)r { self = [super newFrame:r]; [self setClipping:NO]; return self; } //called by the visible view to frame itÐtransparently if requested - frameMe:sender { NXRect aRect; float subViewsFrameAngle; [self lockFocus]; PSsetgray(0.5); //gets the subview's frame and rotation [sender getFrame:&aRect]; subViewsFrameAngle = [sender frameAngle]; //necessary to rotate around the same point the subview used if rotated if(subViewsFrameAngle != 0){ PStranslate(aRect.origin.x, aRect.origin.y); PSrotate(subViewsFrameAngle); PStranslate(-aRect.origin.x, -aRect.origin.y); } //sets the alpha if sender wants a transparent superview if ([sender wantsTransparency]){ PSsetalpha(NX_DKGRAY); } //a very ugly hack to frame the subviewÐanybody remember Trig? //left side PScompositerect(-1000.0, -1000.0, (1000.0 + aRect.origin.x), 2000.0, NX_SOVER); //top middle PScompositerect(aRect.origin.x, (aRect.origin.y + aRect.size.height), aRect.size.width, (2000.0 - (aRect.origin.y + aRect.size.height)), NX_SOVER); //right side PScompositerect((aRect.origin.x + aRect.size.width), -1000.0, (2000.0 - (aRect.origin.x + aRect.size.width)), 2000.0, NX_SOVER); //bottom middle PScompositerect(aRect.origin.x, -1000.0, aRect.size.width, (1000.0 + aRect.origin.y), NX_SOVER); //enclose the subview's frame PSsetgray(NX_BLACK); PSsetalpha(1.0); NXFrameRect(&aRect); [self unlockFocus]; return self; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.