Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Defaults in Page Setup dialog--HOW? Message-ID: <16368@hoptoad.uucp> Date: 22 Mar 91 19:07:15 GMT References: <1991Mar15.195601.314@husc3.harvard.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Electronics for Imaging, San Bruno CA Lines: 29 In article <1991Mar15.195601.314@husc3.harvard.edu> reiss@husc9.harvard.edu (Peter Reiss) writes: >I am writing a program which lets the user print data (bridge scores, but >that's not important), but rarely, if ever, would one print the data in the >standard vertical mode, but rather horizontally. Currently I am calling the >Page Setup dialog and forcing the user to change to horizontal mode. Is there >any way to make this a default in the dialog? Or even change this without >bringing up the dialog? Thanks. To do it from the dialog, read the Tech Note on adding items to the print dialogs. Instead of adding any items, just do the hard-way initialization sequence, and after the dialog is created, walk the dialog item list or the window control list looking for a button with the appropriate title. Then from your item or event filter procedure, return a fake hit on that button. This probably seems nastier than it is. Notice that it should have no problems even if the print dialog changes (it will be a no-op if it can't find the right button) and that it can readily be internationalized. You *can* change the print record directly, but that is much nastier and much more sensitive to printer driver changes. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com FROM THE FOOL FILE: "As the expert on stupid, I'll take your word for it." -- Richard Sexton, richard@gryphon.COM