home *** CD-ROM | disk | FTP | other *** search
- #import "Tank.h"
- #import "InspectMeDoc.h"
- #import "PSWraps.h"
- #import <dpsclient/wraps.h>
-
- @implementation Tank
-
- /* instance methods */
-
- - initFrame:(NXRect *)frameRect
- {
- [super initFrame:frameRect];
- [self setOpaque:YES];
- selected = NO;
- holding = 25;
- capacity = 100;
- return self;
- }
-
- - drawSelf:(NXRect *)rects :(int)rectCount
- {
- PSsetgray(.666);
- NXRectFill(&rects[0]);
- PStank(bounds.size.width, bounds.size.height, selected);
-
- return self;
- }
-
- - (BOOL)acceptsFirstMouse
- {
- return YES;
- }
-
- - mouseDown:(NXEvent *)e
- {
- [[window delegate] setSelectedObject:self];
- return self;
- }
-
- - setSelected:(BOOL)yesOrNo
- {
- selected = yesOrNo;
- [self display];
- // note: if the outline is different if selected,
- // the above should be displayFromOpaqueAncestor:::
-
- return self;
- }
-
-
- // ---------------------------
- // set/get attributes
- // ---------------------------
- - setHolding:(float)aFloat;
- {
- holding = aFloat;
- [self display];
- return self;
- }
-
- - (float)holding {return holding; }
-
- - setCapacity:(float)aFloat;
- {
- capacity = aFloat;
- [self display];
- return self;
- }
-
- - (float)capacity {return capacity; }
-
-
- @end
-