home *** CD-ROM | disk | FTP | other *** search
- // -------------------------------------------------------------------------------------
- // Pie Chart view
- // Martin D. Flynn, NeXT Computer, Inc.
- // -------------------------------------------------------------------------------------
-
- #import <sys/types.h>
-
- // -------------------------------------------------------------------------------------
- @interface PieChart : View
- {
-
- // archived variables
- id currentFont; // current font id
- NXColor backgroundColor; // background color
- NXColor outlineColor; // pie outline color
- NXColor labelColor; // pie label (& tick) color
- id sliceColors; // slice color table
- int dftSliceCount; // default number of slices
-
- struct _pieFlags {
- u_short transparent:1; // background transparent
- u_short showPercent:1; // show percent values for slice
- u_short useCellTags:1; // use matrix cell tags for slice number
- u_short drawOutline:1; // draw pie slice outline
- u_short drawLabels:1; // draw labels
- u_short drawInColor:1; // draw in color if true
- u_short acceptColor:1; // accept color from color panel
- u_short _RESERVED:9; // future use
- } pFlags; // pie flags
-
- // work variables
- id delegate; // pie chart delegate
- id dataId; // dataset storage
- id labelMatrix; // outlet: matrix holding labels
- id valueMatrix; // outlet: matrix holding values
- id outputPercent; // outlet: matrix to send percent output to
- id actionMatrix; // outlet: slice selection action matrix
- BOOL isFirstResponder; // first responder flag
- NXPoint pieCenter; // pie center
- float pieRadius; // pie radius
-
- }
-
- // -------------------------------------------------------------------------------------
-
- - setValue:(float)value forSlice:(int)slice;
- - setValue:(float)value andLabel:(const char*)label forSlice:(int)slice;
-
- - setBackgroundTransparent:(BOOL)flag;
- - (BOOL)backgroundTransparent;
- - setBackgroundGray:(float)aGray;
- - (float)backgroundGray;
- - setBackgroundColor:(NXColor)aColor;
- - (NXColor)backgroundColor;
- - setOutlineGray:(float)aGray;
- - (float)outlineGray;
- - setLabelGray:(float)aGray;
- - (float)labelGray;
- - setSliceColor:(NXColor)color at:(int)slice;
- - (NXColor)sliceColorAt:(int)slice;
- - setAcceptColor:(BOOL)flag;
- - setDelegate:aDelegate;
- - delegate;
-
- - setShowPercent:(BOOL)flag;
- - (BOOL)showPercent;
- - setDrawSliceOutline:(BOOL)flag;
- - (BOOL)drawSliceOutline;
- - setDrawLabels:(BOOL)flag;
- - (BOOL)drawLabels;
- - setDefaultSliceCount:(int)count;
- - (int)defaultSliceCount;
-
- - update:sender;
- - setLabelMatrix:anObject;
- - setValueMatrix:anObject;
- - setFormMatrix:anObject;
- - setPercentMatrix:anObject;
-
- /* delegate methods */
- - selectedPieSlice:(int)slice;
-
- @end
-