This is Ruler.h in view mode; [Download] [Up]
// Ruler.h
// A general ruler class designed to be used with the RuledScrollView class
#import <appkit/Text.h> // required for alignment manifests
#import <appkit/Font.h>
#define TEXTBASELINE 2
#define HORIZONTAL 0.0
#define VERTICAL 90.0
@interface Ruler:View
{
NXCoord scaleSpacing;
float scale, scaleOffset;
NXCoord border;
float orientation;
BOOL inverted,mirrored;
int alignment;
id font;
NXColor backgroundColor;
float backgroundGray;
id image;
int unitsLength;
char *units;
BOOL draggableRuler;
NXCoord ascender, descender, lineHeight;
NXCoord leftOrBottomMargin, rightOrTopMargin;
}
/* instance methods */
/* Initializing and freeing an instance */
- initFrame:(NXRect *)frameRect;
- free;
/* Drawing the view */
- drawSelf:(NXRect *)rects :(int)count;
/* Event handling */
- (BOOL) acceptsFirstMouse;
- mouseDown:(NXEvent *)theEvent;
/* Sizing the rulers */
- setSize;
/* Setting/returning Ruler attributes */
- setScaleSpacing:(NXCoord)points;
- (NXCoord)scaleSpacing;
- setScale:(float)scaleIncrement;
- (float)scale;
- setScaleOffset:(float)origin;
- (float)scaleOffset;
- setBorder:(NXCoord)theBorder;
- (NXCoord)border;
- setOrientation:(float)angle;
- (float)orientation;
- setInverted:(BOOL)invertFlag;
- (BOOL)inverted;
- setMirrored:(BOOL)mirrorFlag;
- (BOOL)mirrored;
- setAlignment:(int)alignType;
- (int)alignment;
- setUnits:(char *)name;
- (const char *)units;
- setFont:aFont;
- (Font *)font;
- setBackgroundColor:(NXColor)bColor;
- (NXColor)backgroundColor;
- setBackgroundGray:(float)value;
- (float)backgroundGray;
- setImage:anImage;
- image;
- setDraggableRuler:(BOOL)yesOrNo;
- (BOOL)draggableRuler;
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.