NSRulerView flexibility

  • hi,

    Is it possible to

    (a) have multiple zero points for vertical ruler views within a scroll view?
    ---
    My application has multiple pages that accumulate vertically in an extending scroll view.  I'd like to have the top of each page correspond to a zero on the vertical ruler view, or start new ruler views at the top of each page.

    (b) end horizontal ruler views?
    ---
    I'd like the horizontal rules to end at the right side of the page.  That is, go from 0 to 8.5" for a standard letter page instead of stretching as wide as the user decides to make the window.

    I have a feeling I'm going to have to make a subclass of a generic NSView to accomplish this.  If there are any other options I'd appreciate your input.

    Thanks again,
    -Dave H.
  • It is possible to do what you are asking (see the rulers in Storyist),
    but there is some work involved. The class to subclass is NSRulerView
    and you'll do most of your custom drawing in
    drawHashMarksAndLabelsInRect:

    I had to override some private methods to get this to draw without
    artifacts when scrolled.

    -Steve
    www.storyist.com

    On 10/17/07, David Harper <dave.harper...> wrote:
    > hi,
    >
    > Is it possible to
    >
    > (a) have multiple zero points for vertical ruler views within a scroll view?
    > ---
    > My application has multiple pages that accumulate vertically in an extending scroll view.  I'd like to have the top of each page correspond to a zero on the vertical ruler view, or start new ruler views at the top of each page.
    >
    > (b) end horizontal ruler views?
    > ---
    > I'd like the horizontal rules to end at the right side of the page.  That is, go from 0 to 8.5" for a standard letter page instead of stretching as wide as the user decides to make the window.
    >
    > I have a feeling I'm going to have to make a subclass of a generic NSView to accomplish this.  If there are any other options I'd appreciate your input.
    >
    >
    > Thanks again,
    > -Dave H.
    >
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today