NSRulerView

NSRulerView Mac OS X 10.0

This is a subclass of NSView and is used to draw rulers in an NSScrollView. A ruler view keeps track of the units used to convert measurements between pixels and whatever unit the client specifies should be displayed by the ruler view. A ruler view may contain ruler markers, which are instances of the class NSRulerMarker.

figs/cocn_1579.gif

@interface NSRulerView : NSView
 // Initializers
   - (id)initWithScrollView:(NSScrollView *)scrollView orientation:(NSRulerOrientation)orientation;
 // Accessor Methods
   - (void)setReservedThicknessForAccessoryView:(float)thickness;
   - (float)reservedThicknessForAccessoryView;
   - (void)setScrollView:(NSScrollView *)scrollView;
   - (NSScrollView *)scrollView;
   - (void)setOriginOffset:(float)offset;
   - (float)originOffset;
   - (void)setOrientation:(NSRulerOrientation)orientation;
   - (NSRulerOrientation)orientation;
   - (void)setClientView:(NSView *)client;
   - (NSView *)clientView;
   - (void)setReservedThicknessForMarkers:(float)thickness;
   - (float)reservedThicknessForMarkers;
   - (void)setMarkers:(NSArray *)markers;
   - (NSArray *)markers;
   - (void)setRuleThickness:(float)thickness;
   - (float)ruleThickness;
   - (void)setAccessoryView:(NSView *)accessory;
   - (NSView *)accessoryView;
   - (void)setMeasurementUnits:(NSString *)unitName;
   - (NSString *)measurementUnits;
 // Class Methods
   + (void)registerUnitWithName:(NSString *)unitName abbreviation:(NSString *)abbreviation
        unitToPointsConversionFactor:(float)conversionFactor tepUpCycle:(NSArray *)stepUpCycle
        stepDownCycle:(NSArray *)stepDownCycle;
 // Instance Methods
   - (void)addMarker:(NSRulerMarker *)marker;
   - (float)baselineLocation;
   - (void)drawHashMarksAndLabelsInRect:(NSRect)rect;
   - (void)drawMarkersInRect:(NSRect)rect;
   - (void)invalidateHashMarks;
   - (BOOL)isFlipped;
   - (void)moveRulerlineFromLocation:(float)oldLocation toLocation:(float)newLocation;
   - (void)removeMarker:(NSRulerMarker *)marker;
   - (float)requiredThickness;
   - (BOOL)trackMarker:(NSRulerMarker *)marker withMouseEvent:(NSEvent *)event;



    Part II: API Quick Reference
    Chapter 13. Foundation Classes