This is MiscCircularSlider.m in view mode; [Download] [Up]
// // MiscCircularSlider.m -- a cover for the MiscCircularSliderCell class // Written by Vince DeMarco and Don Yacktman // Copyright (c) 1994 by Vince DeMarco and Don Yacktman. // Version 1.0 All rights reserved. // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the author // and its use is governed by the MiscKit license, found in the file // "LICENSE.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // // This was created by modifying Vince's CircularSlider class and // merging it with Don's RotationSlider class. Here's the info // from the original files. /* * Filename: CircularSlider.m * Created : Sat 24 21:25:44 1991 * Author : Vince DeMarco <vince@whatnxt.cuc.ab.ca> * LastEditDate Was "Mon Sep 6 16:32:15 1993" * * Version 2.0 */ // RotationSlider.m -- written by Don Yacktman // Copyright 1993 by Don Yacktman. All rights reserved. // Modified by Laurent Daudelin <laurent@planon.qc.ca> to add // support for the lower and upper stop values and // the boundary flag. #import "MiscCircularSlider.h" static id MiscCircularSliderCellClass; @implementation MiscCircularSlider + initialize { if (self == [MiscCircularSlider class]) { MiscCircularSliderCellClass = [MiscCircularSliderCell class]; // the default class } return self; } + setCellClass:classId { MiscCircularSliderCellClass = classId; return self; } - initFrame:(NXRect *)nf { [super initFrame:nf]; [[self setCell:[[MiscCircularSliderCellClass alloc] init]] free]; return self; } - setBezeled:(BOOL)value { // BOOL old = [cell isBezeled]; // [cell setBezeled:value]; // if (old != value) [self display]; return self; } - (BOOL)isBezeled { return [cell isBezeled]; } - setBordered:(BOOL)value { // BOOL old = [cell isBordered]; // [cell setBordered:value]; // if (old != value) [self display]; return self; } - (BOOL)isBordered { return [cell isBordered]; } - setJumpToMousePoint:(BOOL)aBOOL { [cell setJumpToMousePoint:aBOOL]; return self; } - (BOOL)jumpToMousePoint { return [cell jumpToMousePoint]; } - setHidden:(BOOL)aBOOL { BOOL old = [cell hidden]; [cell setHidden:aBOOL]; if (aBOOL != old) [self display]; return self; } - (BOOL)hidden { return (BOOL)[cell hidden]; } - setUpperStopValue:(float)aValue { float oldValue = [cell upperStopValue]; [cell setUpperStopValue:aValue]; if (aValue != oldValue) [self display]; return self; } - (float)upperStopValue { return [cell upperStopValue]; } - setLowerStopValue:(float)aValue { float oldValue = [cell lowerStopValue]; [cell setLowerStopValue:aValue]; if (aValue != oldValue) [self display]; return self; } - (float)lowerStopValue { return [cell lowerStopValue]; } - setUseBoundaries:(BOOL)flag { [cell setUseBoundaries:flag]; return self; } - (BOOL)useBoundaries { return [cell useBoundaries]; } - setSliderStyle:(MiscCircularSliderStyle)style { MiscCircularSliderStyle old = [cell sliderStyle]; [cell setSliderStyle:style]; if (style != old) [self display]; return self; } - (MiscCircularSliderStyle)sliderStyle { return (MiscCircularSliderStyle)[cell sliderStyle]; } - setSliderPathWidth:(float)value { [cell setSliderPathWidth:value]; return self; } - (float)sliderPathWidth { return [cell sliderPathWidth]; } - setBorderType:(int)type { int old = [cell sliderStyle]; [cell setBorderType:type]; if (type != old) [self display]; return self; } - (int)borderType { return [cell borderType]; } - setBackgroundColor:(NXColor)aColor { NXColor old = [cell backgroundColor]; [cell setBackgroundColor:aColor]; if (!NXEqualColor(old,aColor)) [self display]; return self; } - (NXColor)backgroundColor { return [cell backgroundColor]; } - (float)startAngle { return [cell startAngle]; } - setStartAngle:(float)ang { [cell setStartAngle:ang]; [self display]; return self; } - (BOOL)isClockwise { return [cell isClockwise]; } - setClockwise:(BOOL)clockwise { [cell setClockwise:clockwise]; [self display]; return self; } @end @implementation MiscCircularSlider(Compatability) // Two covers to make sure we implement the methods that were used by Vince's // CircularSlider. This way, code that used that slider will still work as // it did before with this new class dropped in instead. - setDrawAsPieChart:(BOOL)aBOOL { return [self setSliderStyle: (aBOOL ? MISC_PIECHART_STYLE : MISC_DIAL_STYLE)]; } - (BOOL)drawAsPieChart { return (BOOL)([self sliderStyle] == MISC_PIECHART_STYLE); } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.