feedback on printing strategy
feedback on printing strategy
- Subject: feedback on printing strategy
- From: Eric Friedman <email@hidden>
- Date: Fri, 29 Aug 2003 09:44:17 -0700
I'd appreciate some feedback on the following strategy for doing custom printing.
I'd like to know if this is a common approach or if there's a Better Way.
I have a document-based application. A document is comprised of a collection of
records, each of which has several attributes that are displayed and which should
be printed. The screen UI is a pretty conventional master-detail setup. For
printing, I'd like people to be able to print the details for all or a subset
of records in their document's collection. Since the master view supports
multiple row selection, that should be easy enough.
From reading Anguish/Hillegass' books, I see that it's customary to create an
offscreen NSView subclass that knows its page range and can produce rectangles
for a given page (presumably the same rectangles that will be passed to drawRect).
In Hillegass' example, which is very similar to my application, he implements uses
the various drawing methods on NSString and the like in an implementation of
drawRect:
This is fine, but I'd like my print output to contain non-textual elements, such as
checkbox matrices. I also would like to have IB handle the actual positioning of
those elements if possible.
so, I was thinking that I'd create a special nib with controls layed out just for
printing. The printable view in that nib would be a borderless NSBox subclass.
The subclass would respond to knowsPageRange and so on, and its drawRect: implementation
would set up the state of the nib-provided controls before invoking [super drawRect:whatever]
Since the nib-provided controls would all be subviews of my NSBox subclass, I'd expect them
to be put in the right state before any subviews are asked to draw themselves.
Does this approach make sense or am I missing something important?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.