This is HitPointView.m in view mode; [Download] [Up]
/* * (a) (C) 1990 by Adobe Systems Incorporated. All rights reserved. * * (b) If this Sample Code is distributed as part of the Display PostScript * System Software Development Kit from Adobe Systems Incorporated, * then this copy is designated as Development Software and its use is * subject to the terms of the License Agreement attached to such Kit. * * (c) If this Sample Code is distributed independently, then the following * terms apply: * * (d) This file may be freely copied and redistributed as long as: * 1) Parts (a), (d), (e) and (f) continue to be included in the file, * 2) If the file has been modified in any way, a notice of such * modification is conspicuously indicated. * * (e) PostScript, Display PostScript, and Adobe are registered trademarks of * Adobe Systems Incorporated. * * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO * CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED * AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED. * ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY * OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO * WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY) * WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY * DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY, * FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT * OF THIRD PARTY RIGHTS. */ /* * HitPointView.m * * This class is used to draw the hit sensitivity rectangle in the drawing * options window. * * Version: 2.0 * Author: Ken Fromm * History: * 03-07-91 Added this comment. */ #import "HitPointView.h" #import "DetectApp.h" #import <appkit/View.h> #import <appkit/Control.h> #import <dpsclient/wraps.h> @implementation HitPointView - drawHitSetting:sender { [NXApp setHitSetting:(float) [sender selectedTag]]; [self display]; return self; } /* Clear the view and then draw the correctly-sized hit point in the center of the view. */ -drawSelf:(NXRect *)r :(int) count { float hitSetting; hitSetting = [NXApp hitSetting]; PSsetgray(NX_LTGRAY); PSrectfill(0.0, 0.0, bounds.size.width, bounds.size.height); PSsetgray(NX_DKGRAY); PSrectfill((bounds.size.width - hitSetting)/2, (bounds.size.height - hitSetting)/2, hitSetting, hitSetting); return self; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.