Inherits from: NSObject
Package: com.apple.yellow.application
On Mach platforms, NSPageLayout inherits from NSPanel.
NSPageLayout is a panel that queries the user for information such as paper type and orientation. This information is stored in an NSPrintInfo object, and is later used when printing. The NSPageLayout panel is created, displayed, and run (in a modal loop) when a runPageLayout: message is sent to the NSApplication object. By default, this message is sent up the responder chain when the user chooses the Page Setup menu item (on Mach platforms the menu item is called Page Layout).
Typically, you access an NSPageLayout panel by invoking the pageLayout method. When the class receives a pageLayout message, it returns an existing panel rather than create a new one. If 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 the NSPageLayout object returned by pageLayout may be reused, you should only modify it using methods explicitly declared by NSPageLayout. If you must modify an NSPageLayout object in other ways, don't modify the object returned by pageLayout; instead, create and manage your own instance.
In most cases it is unnecessary to subclass NSPageLayout-you
can customize an NSPageLayout by specifying your own accessory view.
You can add your own controls to an NSPageLayout through the setAccessoryView: method.
The panel is automatically resized to accommodate the NSView that
you've added. Note that NSPageLayout does not have accessor methods
to obtain the state of its controls. If controls you add through
an accessory view need to know the values of existing controls (or
vice versa) use the viewWithTag: method.
You obtain a specific control object by sending viewWithTag: to
the NSPageLayout object passing one of the following tags (enumerated
in AppKit/NSPageLayout.h
):
The value can then be obtained by sending an appropriate accessor message to the returned control object.
- Creating an NSPageLayout
- pageLayout
- Running an NSPageLayout
- runModal
- runModalWithPrintInfo
- Customizing an NSPageLayout
- accessoryView
- setAccessoryView
- Accessing the NSPrintInfo
- printInfo
- readPrintInfo
- writePrintInfo
- Updating the display
- convertOldFactor:newFactor:
- pickedButton
- pickedOrientation
- pickedPaperSize
- pickedUnits
public NSPageLayout()
public NSPageLayout(NSRect aNSRect, int anInt, int anInt, boolean aBoolean)
public NSPageLayout(NSRect aNSRect, int anInt, int anInt, boolean aBoolean, NSScreen aNSScreen)
public static NSPageLayout pageLayout()
public NSView accessoryView()
See Also: setAccessoryView
public void pickedButton(Object sender)
See Also: pickedOrientation, pickedPaperSize, pickedUnits
public void pickedOrientation(Object sender)
See Also: pickedButton, pickedPaperSize, pickedUnits
public void pickedPaperSize(Object sender)
See Also: pickedButton, pickedOrientation, pickedUnits
public void pickedUnits(Object sender)
Subclasses should override this method to update controls in the accessory view that contain unit values. The ratios returned by the convertOldFactor:newFactor: method should be used to calculate the new values.
See Also: pickedButton, pickedOrientation, pickedPaperSize
public NSPrintInfo printInfo()
See Also: readPrintInfo, writePrintInfo
public void readPrintInfo()
See Also: printInfo, writePrintInfo, runModal, runModalWithPrintInfo
public int runModal()
See Also: pickedButton, runModalWithPrintInfo
public int runModalWithPrintInfo(NSPrintInfo printInfo)
See Also: pickedButton, runModal
public void setAccessoryView(NSView aView)
null
,
then the receiver's current accessory view, if any, is removed.See Also: accessoryView
public void writePrintInfo()
See Also: printInfo, readPrintInfo, runModal, runModalWithPrintInfo