Important: The information in this document is obsolete and should not be used for new development.
Inherits from | |
Package | com.apple.cocoa.application |
Companion guide |
NSPageLayout is a panel that queries the user for information such as paper type and orientation. It is normally displayed in response to the user selecting the Page Setup menu item. You obtain an instance with the pageLayout
class method. The pane can then be run as a sheet using beginSheetWithPrintInfo
or modally using runModal
or runModalWithPrintInfo
.
Returns a newly created NSPageLayout object.
public static NSPageLayout pageLayout
()
Returns the receiver’s accessory view (used to customize the receiver).
public NSView accessoryView
()
Presents a page layout sheet for printInfo, document modal relative to docWindow.
public void beginSheetWithPrintInfo
(NSPrintInfo printInfo, NSWindow docWindow, Object delegate, NSSelector didEndSelector, Object contextInfo)
When the modal session ends, if neither delegate nor didEndSelector is null
, didEndSelector is invoked on delegate, passing contextInfo, among others, as an argument.
The didEndSelector argument must have the same signature as:
public void pageLayoutDidEnd (NSPageLayout pageLayout, int returnCode, void contextInfo) |
The value passed as returnCode will be either PLCancelButton
or PLOKButton
.
public void pickedButton
(Object sender)
This method has been deprecated.
public void pickedOrientation
(Object sender)
This method has been deprecated.
public void pickedPaperSize
(Object sender)
This method has been deprecated.
public void pickedUnits
(Object sender)
This method has been deprecated.
Returns the NSPrintInfo object used when the receiver is run.
public NSPrintInfo printInfo
()
The NSPrintInfo object is set using the beginSheetWithPrintInfo
or runModalWithPrintInfo
method. The shared NSPrintInfo object is used if the receiver is run using runModal
.
Sets the receiver’s values to those stored in the NSPrintInfo object used when the receiver is run.
public void readPrintInfo
()
Do not invoke this method directly; it is invoked automatically before the receiver is displayed.
Displays the receiver and begins the modal loop.
public int runModal
()
The receiver’s values are recorded in the shared NSPrintInfo object. Returns PLCancelButton
if the user clicks the Cancel button; otherwise returns PLOKButton
.
Displays the receiver and begins the modal loop.
public int runModalWithPrintInfo
(NSPrintInfo printInfo)
The receiver’s values are recorded in printInfo. Returns PLCancelButton
if the user clicks the Cancel button; otherwise returns PLOKButton
.
Adds an NSView to the receiver.
public void setAccessoryView
(NSView aView)
Invoke this method to add a custom view containing your controls. aView is added to the receiver’s Settings popup menu with your application’s name as its menu item. The receiver is automatically resized to accommodate aView. This method can be invoked repeatedly to change the accessory view depending on the situation. If aView is null
, then the receiver’s current accessory view, if any, is removed.
Writes the receiver’s values to the NSPrintInfo object used when the receiver is run.
public void writePrintInfo
()
Do not invoke this method directly; it is invoked automatically when the receiver is dismissed.
© 1997, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-01)