home *** CD-ROM | disk | FTP | other *** search
- /*
- * Filename: CircularSliderInspector.m
- * Created : Sat Aug 24 21:25:44 1991
- * Author : Vince DeMarco
- * <vince@whatnxt.cuc.ab.ca>
- *
- * Version 1.0.1
- */
-
-
- /* Generated by Interface Builder */
-
- #import "CircularSliderInspector.h"
- #import "CircularSlider.h"
- #import <appkit/Application.h>
- #import <appkit/TextFieldCell.h>
- #import <appkit/TextField.h>
- #import <appkit/Button.h>
-
- #import <stdio.h>
-
- @implementation CircularSliderInspector
-
- - init
- {
- char buf[MAXPATHLEN + 1];
-
- if (maxField == nil){
- [super init];
-
- [[NXBundle bundleForClass:[CircularSlider class]] getPath:buf forResource:"CircularSliderInspector" ofType:"nib"];
-
- [NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]];
-
- }
- [maxField setIntValue:(int)[object theMaxValue]];
- [tagField setIntValue:[object tag]];
-
- [continuousButton setState:(currentcontinuous == 1 ? YES : NO)];
- [disabledButton setState:(currentdisabled == 1 ? YES : NO)];
- [maxField setIntValue:currentMax];
- [tagField setIntValue:currentTag];
- [currentField setIntValue:currentValue];
- return self;
- }
-
- - continuous:sender
- {
- currentcontinuous = ([sender state] ? 1: 0);
- return(self);
- }
-
- - disabled:sender
- {
- currentdisabled = ([sender state] ? 1: 0);
- return(self);
- }
-
- - ok:sender
- {
- currentMax = [maxField intValue];
- currentTag = [tagField intValue];
- currentValue = [currentField intValue];
-
- [object setContinuous: (currentcontinuous == 1 ? YES : NO)];
- [object setTag: currentTag];
-
- [object setTheMaxValue:currentMax];
- [object setIntValue:currentValue];
- [object setEnabled:(currentdisabled == 0 ? YES : NO)];
- return [super ok:sender];
- }
-
- - revert:sender
- {
- currentTag = [object tag];
- currentMax = (int)[object theMaxValue];
- currentValue = [object intValue];
-
- [maxField setIntValue:currentMax];
- [currentField setIntValue:currentValue];
- [tagField setIntValue:currentTag];
- [continuousButton setState:[object isContinuous]];
- if ([object isContinuous])
- currentcontinuous =1;
- else
- currentcontinuous =0;
-
- [disabledButton setState:([object isEnabled] ? NO: YES)];
- if ([object isEnabled])
- currentdisabled =0;
- else
- currentdisabled =1;
-
- return [super revert:sender];
- }
- @end
-