home *** CD-ROM | disk | FTP | other *** search
- #import <appkit/View.h>
-
- #define MAX_CHARS_PER_FONT_NAME 100
- #define MAX_CHARS_PER_WEDGE_LABEL 100
- #define MAX_WEDGES 100
-
- @interface PieChartView:View
- {
- // ids for outlets
- id numWedgesText;
- id pieSizeText;
- id labelLineLengthText;
- id pieFontText;
- //
- id fontID;
- float pieSize; // holds the size of the chart (in ps coords)
- float pieFontSize; // holds the font size
- char pieFont[MAX_CHARS_PER_FONT_NAME]; // holds the font name
- int numWedges; // holds the number of wedges to be drawn
- float wedgeValue[MAX_WEDGES]; // holds the data
- float grays[MAX_WEDGES]; // holds the gray shade for each wedge
- float normData[MAX_WEDGES]; // holds the data normalized so that the sum is 360
- char labels[MAX_WEDGES][MAX_CHARS_PER_WEDGE_LABEL]; // holds the labels
- }
-
- // action methods for use with Interface Builder
- -takeValueFromMatrix:sender;
- -takeLabelFromMatrix:sender;
- -takeGraysFromMatrix:sender;
- -takePieSizeFrom:sender;
- -takeFontSizeFrom:sender;
- -takeNumWedgesFrom:sender;
-
- // outlets
- -setNumWedges:anObject;
- -setPieSizeText:anObject;
- -setLabelLineLengthText:anObject;
- -setPieFontText:anObject;
-
- // Objective C methods
- -setPieSize: (float) size;
- -setPieFontSize: (float) size;
- -setPieFont: (char *) fontName;
- -addPieWedge: (float)value: (char *)label: (float)gray;
- -removePieWedge: (int)index;
- -setPieWedge: (int)wedgeNumber: (float)value: (char *)label: (float)gray;
- -normalize;
-
- @end
-