This is NSPrintPanel.rtf in view mode; [Download] [Up]
paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc. All Rights Reserved. s4 li100 fi0 ri1007 ql f0 b fs36 fs100 fs36 NSPrintPanel pard s11 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSPanel : NSWindow : NSResponder : NSObject fs20 fs28 s6 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCoding (NSResponder) fi0 NSObject (NSObject) fs20 fs28 s7 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 AppKit/NSPrintPanel.h fs20 fs28 pard s16 li100 fi0 ri1007 ql f0 b fs28 fs20 fs28 Class Description fs14 fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 fs28 NSPrintPanel creates a Print panel. The Print panel queries the user for information about a print job, such as which pages to print and how many copies. fs16 fs28 When a b print:b0 message is sent to an NSView or NSWindow, an NSPrintOperation object is created to control the print operation, which includes deciding whether or not to use an NSPrintPanel. The NSPrintPanel will be used unless the b setShowPanels:NOb0 message is sent to the NSPrintOperation. If you'27re subclassing NSPrintPanel, send the b setPrintPanelb0 message to the NSPrintOperation object to ensure that an instance of your subclass is the unique NSPrintPanel for that operation. fs16 fs28 Short of subclassing NSPrintPanel, you can augment its display by adding a custom NSView through the b setAccessoryView:b0 method. The panel is automatically resized to accommodate the NSView that you add. Note, however, that you don'27t have to create controls for special printer features. If a printer includes features in the 'aaOpenUI'ba field of its PostScript Printer Description (PPD) table, these features will be displayed in a separate panel that'27s brought up when the user clicks the Print panel'27s Options button. For more information on a printer'27s PPD table, see the NSPrinter class description. fs16 fs28 Typically, you access an NSPrintPanel by invoking the b printPanelb0 method. When the class receives a b printPanelb0 message, it tries to reuse an existing panel rather than create a new one. When a panel is reused, its attributes are reset to the default values so that the effect is the same as receiving a new panel. Because a Print panel may be reused, you shouldn'27t modify the instance returned by b printPanelb0 , except through the methods listed below. For example, you can set the accessory view, but not the arrangement of the buttons within the panel. If you must modify the Print panel substantially, create and manage your own instance using the b alloc...b0 and b init...b0 methods rather than the b printPanelb0 method. fs16 fs28 An application stores printing information in an NSPrintInfo object. NSPrintPanel'27s b updateFromPrintInfob0 reads the NSPrintInfo object'27s information into the Print panel. b finalWritePrintInfob0 updates the NSPrintInfo object if the user changes the information on the Print panel. When the NSPrintOperation object is created, an NSPrintInfo object is also selected for the operation. The NSPrintOperation creates a copy of the NSPrintInfo. b finalWritePrintInfob0 actually writes to that copy. fs16 fs28 pard s16 li100 fi0 ri1007 ql f0 b fs24 fs28 Creating an NSPrintPanel fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 + (NSPrintPanel *)b printPanelb0 tab Returns a default NSPrintPanel object. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Customizing the Panel fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (void)b setAccessoryView:b0 (NSView *)i aViewi0 tab Adds an NSView to the panel. fi-6552 fs16 fs28 fi-6552 {f3 -} (NSView *)b accessoryViewb0 tab Returns the accessory NSView. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Running the Panel fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (int)b runModalb0 tab Displays the Print panel and begins its event loop. If it is necessary to resize the panel in order to accommodate the list of printers, this method posts the notification NSWindowDidResizeNotification with the receiving object to the default notification center. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b pickedButton:b0 (id)i senderi0 tab Stops the event loop. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Updating the Panel'27s Display fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (void)b pickedAllPages:b0 (id)i senderi0 tab Updates the panel when the user chooses all pages. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b pickedLayoutList:b0 (id)i senderi0 tab Updates the panel when the user chooses a new layout. pard s16 li100 fi0 ri1007 ql f0 b fs48 fs28 Communicating with the NSPrintInfo Object fs14 fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (void)b updateFromPrintInfob0 tab Reads NSPrintPanel'27s values from the NSPrintInfo object. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b finalWritePrintInfob0 tab Writes NSPrintPanel'27s values to the NSPrintInfo object. }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.