Hi,

I have some problems with the NSRulerView that I hope to solve by this request.

The NSRulerView I am using is a horizontal ruler view in a NSScrollView.

In most examples seen in the developer documentation, the markers on the ruler are located above the baseline. In my opinon, this does not look very nice. Therefore I am triying to put the markes below the baseline of the ruler view. I think this is not standard, and it gives me a lot of troubles.

In other words, I would like to make a ruler view, that is like the ruler seen in the apple program "Pages". Here the markers are located on the ruler itself.

So far, I am able to put the markers below the baseline by offseting them and hiding the area above the baseline. This makes it looks like the ruler in "Pages".

The problems begin, when I want to move the markers.

First the handleMouseDown function is called. This works fine:

- (void)rulerView:(NSRulerView*)aRulerView handleMouseDown: (NSEvent*)event
        {
                [ruler trackMarker:marker withMouseEvent:event];
        }

Hereafter, I expect these functions to be called.

- (BOOL)rulerView:(NSRulerView *)aRulerView didMoveMarker: (NSRulerMarker *)aMarker
        {
                return YES;
        }

- (CGFloat)rulerView:(NSRulerView *)aRulerView willMoveMarker: (NSRulerMarker *)aMarker toLocation:(CGFloat)location
        {
                return location;
        }

- (BOOL)rulerView:(NSRulerView *)aRulerView shouldMoveMarker: (NSRulerMarker *)aMarker
        {
                return YES;
        }

BUT, this will only happens, if the mouse pointer is above the baseline of the ruler.

If the mouse pointer is below the baseline, none of these delegates are called.

Any ideas for solving this are most welcome.


Kind regard,

Anders Lassen






_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to