Article View: comp.sys.mac
Article #16627Re: changing the defaults in the page setup dialog
From: stew
Date: Mon, 08 Jun 1987 02:29
Date: Mon, 08 Jun 1987 02:29
74 lines
4108 bytes
4108 bytes
In article <933@apple.UUCP> han@apple.UUCP (Byron Han) writes:
>In article <3654@osu-eddie.UUCP>, sarrel@osu-eddie.UUCP (Scoop) writes:
>> I am writing a short program that will, as part of its function, print out
>> a standard form. However, the form is 'sideways' on the page. I have the
>> form in a window, but now I want to print it out. I figured the best way
>> to print something sideways is to change the default orientation switch in
>> the Page Setup dialog.
>>
>> What's the best way to do this? Can I just save a copy of the dialog resource
>> (with the switch set the way I want) in the application's resource fork? Is
>> it that easy, or am I hallucinating? I'm not _that_ expierienced a
>> MacProgrammer, so have some mercy with your answers.
>>
>> advTHANKSance
>
>The easiest way is to store the print record. In your program you probably
>have
> hPrint = THPrint(NewHandle(SIZEOF(TPrint)));
> if PrValidate(hPrint) then begin
> end;
[remainder of this probably irrelevant reply deleted]
You folks are missing the point, I think. Read Scoop's message again.
He is asking the same question thousands of Macintosh developers have
asked before, "How do I change or override the Standard Print Dialogs?"
In this case, he wants the dialog to default to landscape mode.
The right way to do this would be a SetRotn opcode to the new
PrGeneral procedure. Unfortunately, Apple forgot to implement
this. I hope it was only a correctable oversight.
Apple's response has always been, "Don't do this. Let the user select
the desired options from the standard dialogs." Quoting from TN 122:
Summary
To be compatible with future printer-like devices, it is essential
that your application print in a device-independant manner. Avoid
testing undocumented fields, setting fields in the print record
directly and bypassing the existing print dialogs. Use the Printing
Manager dialogs, PrintDefault and PrValidate to set up the print
record for you.
There is great virtue in consistency; I am certainly a big fan of the
consistent Macintosh user interface and regard the User Interface
Guidelines as gospel. However, the lack of a programmatic interface
to the print manager is a longstanding deficiency. In recent
TechNotes, Apple has sactioned methods to add to Print Dialogs (TN 95)
and added some further print manager functions (TN 128). One of the
added functions is the GetRotn opcode to PrGeneral, which will let you
test whether the user has selected Landscape mode, after the fact. So
the best you can do, if you want to be compatible with future printer
drivers, is put up a window saying, "Please select Landscape Mode"
along with the standard Style Dialog, and then issue an error or
warning message if Landscape mode has not been selected.
In my opinion, this looks like a real kludge to the end user; it's
confusing and it's unnecessarily time consuming. The PrGeneral call
is a step in the right direction, but it's not complete. Please add a
SetRotn opCode to the next release of PrGeneral.
Stew Rubenstein
Cambridge Scientific Computing, Inc.
UUCPnet: seismo!harvard!rubenstein
Internet: rubenstein@harvard.harvard.edu
CompuServe: 76525,421
MCIMail: CSC
Stew Rubenstein
Cambridge Scientific Computing, Inc.
UUCPnet: seismo!harvard!rubenstein
Internet: rubenstein@harvard.harvard.edu
CompuServe: 76525,421
MCIMail: CSC
Technical Details
Message-ID:
<2234@husc6.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!husc6!endor!stewReferences:
<3654@osu-eddie.UUCP> <933@apple.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!husc6!endor!stew From: stew@endor.UUCP Newsgroups: comp.sys.mac Subject: Re: changing the defaults in the page setup dialog Message-ID: <2234@husc6.UUCP> Date: Sun, 7-Jun-87 22:29:42 EDT Article-I.D.: husc6.2234 Posted: Sun Jun 7 22:29:42 1987 Date-Received: Mon, 8-Jun-87 05:39:25 EDT References: <3654@osu-eddie.UUCP> <933@apple.UUCP> Sender: news@husc6.UUCP Reply-To: stew@endor.UUCP (Stew Rubenstein) Organization: Aiken Computation Lab Harvard, Cambridge, MA Lines: 74 Keywords: orientation