• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Markers below baseline in NSRulerView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Markers below baseline in NSRulerView


  • Subject: Markers below baseline in NSRulerView
  • From: Anders Lassen <email@hidden>
  • Date: Mon, 31 Aug 2009 22:15:52 +0200

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 (email@hidden)

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:
This email sent to email@hidden


  • Prev by Date: Core Data? -beginUndoGrouping does not always increment -groupingLevel
  • Next by Date: Re: What sound plays after an Installer runs? [OT]
  • Previous by thread: Core Data? -beginUndoGrouping does not always increment -groupingLevel
  • Next by thread: NSMenuItem's selectors messages not sent
  • Index(es):
    • Date
    • Thread