Re: Controlling zoom level of an NSRulerView?
Re: Controlling zoom level of an NSRulerView?
- Subject: Re: Controlling zoom level of an NSRulerView?
- From: Volker Runkel <email@hidden>
- Date: Tue, 14 Mar 2006 23:42:16 +0100
Hi,
as Scott mentioned, one way is to change the rulers units. I use
NSRuler for a time axis and it works like charm (just the units
dipslayed are sometimes a bit untypical, like 256,512,768 in
samples... :-( ). In code it looks for example like:
[NSRulerView registerUnitWithName:@"milliseconds" abbreviation:@"ms"
unitToPointsConversionFactor:(1/reductionFactor)*(srate/(1000*
[[NSUserDefaults standardUserDefaults] integerForKey:@"timebase"]))
stepUpCycle:[NSArray arrayWithObjects:[NSNumber numberWithFloat:2.0],
[NSNumber numberWithFloat:4.0],nil] stepDownCycle:[NSArray
arrayWithObjects:[NSNumber numberWithFloat:0.5],[NSNumber
numberWithFloat:0.2],nil]]
This code is called whenever my zoom factor changes, the
reductionFactor gives the amount of zoom in my case. Now I just hope
that was what Scott understood when he said altering the unit ....
Volker
The NSRulerView zoom level seems to depend on the ratio between the
document view's frame and bounds.
However, I'm controlling the document's zoom level separately from
the bounds, scaling everything within it by hand. So my bounds are
always equal to the frame size, so the rulerview stays at a scaling
of 1.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden