• 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
Re: Is it acceptable to use -knowsPageRange to generate page rects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it acceptable to use -knowsPageRange to generate page rects?


  • Subject: Re: Is it acceptable to use -knowsPageRange to generate page rects?
  • From: Matt Neuburg <email@hidden>
  • Date: Thu, 29 Nov 2007 17:09:27 -0800
  • Thread-topic: Is it acceptable to use -knowsPageRange to generate page rects?

On Thu, 29 Nov 2007 14:30:02 -0500, Paul Bruneau
<email@hidden> said:
>Hi-
>
>In the continuing saga of my production scheduling program (which has
>benefited so much from the kind help of this list), I am currently
>implementing printing of production schedules with custom pagination.
>I have a list of work centers each with order steps that must appear
>on the printout. Several related work centers (or just one) may
>appear on one or more pages, followed by a page break before the next
>group of work centers.
>
>Work Center A
> -some work to be done
> -some more work to be done
>
>Work Center B
> -B's work to be done
> -some more work
>
>---------- page break ----------
>
>...more work centers, etc
>
>
>It seems to me that since the -knowsPageRange method of my print view
>(which I have just written) must go through all of my work center
>data to determine when the pages should break in order to count them,
>it could also generate and store aside the rect for each page in an
>array as it does so.
>
>Then my -rectForPage method could access that information to return
>the correct rect for the requested page without having to go through
>the nearly identical computations again.
>
>Does this make sense and not violate anything? If this is commonly
>done (I can't be the first to think of this), did I miss discussion
>of it Apple's printing docs? Their custom pagination example is very
>simple (which they admitted) and to my mind didn't really discuss the
>issues that arise in an actual custom pagination situation.
>
>http://developer.apple.com/documentation/Cocoa/Conceptual/Printing/
>Tasks/PaginatingViews.html#//apple_ref/doc/uid/20000912-BBCHHAHI

Well, judging from answers I've given on this topic before, I'd say that
what you're thinking of doing is exactly what you're *supposed* to do:

http://www.cocoabuilder.com/archive/message/cocoa/2006/12/14/175913

http://www.cocoabuilder.com/archive/message/cocoa/2002/12/4/51570

Now, of course, what I've said on the topic could be wrong; but it certainly
has allowed me to print without calculating all the page breaks twice. m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>



_______________________________________________

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: Re: Leopard NSTableView Cell and single click editing
  • Next by Date: Re: [idea] a wiki page per method in the cocoa docs
  • Previous by thread: Is it acceptable to use -knowsPageRange to generate page rects?
  • Next by thread: [idea] a wiki page per method in the cocoa docs
  • Index(es):
    • Date
    • Thread