Copyright ã1994 by NeXT Computer, Inc.  All Rights Reserved.

NSPageLayout 

Inherits From:	NSPanel : NSWindow : NSResponder : NSObject

Conforms To:	NSCoding (NSResponder)
NSObject (NSObject)

Declared In:	AppKit/NSPageLayout.h 

Class Description

NSPageLayout is a type of NSPanel 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 clicks the Page Layout menu item.

Typically, you access an NSPageLayout panel by invoking the pageLayout method. When the class receives a pageLayout message, it tries to reuse 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 Page Layout panels may be reused, you shouldn't modify the instance returned by pageLayout, except through the methods listed below. If you must modify the Page Layout panel in other ways than those allowed by its methods, create and manage your own instance using the alloc... and init... methods rather than the pageLayout method.

You can add your own controls to the Page Layout panel through the setAccessoryView: method. The panel is automatically resized to accommodate the NSView that you've added. Note that you can't retrieve the NSPageLayout's settings through messages to the page layout panel objectÐ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 the existing controls in the page layout panel (or vice versa), access NSPageLayout's controls using the tags defined in AppKit/NSPageLayout.h as arguments to viewWithTag: messages to the page layout panel object. Controls thus returned can then be queried for their state.

Creating an NSPageLayout Instance 

+ (NSPageLayout *)pageLayout	Returns a default NSPageLayout object.

Running the Panel 

- (int)runModal	Displays the panel and begins its event loop. The panel's values are recorded in the shared NSPrintInfo object.

- (int)runModalWithPrintInfo:(NSPrintInfo *)pInfo	
	Displays the panel and begins its event loop. The panel's values are recorded in the pInfo, the supplied NSPrintInfo object.

Customizing the Panel 

- (NSView *)accessoryView	Returns the NSPageLayout's accessory View.

- (void)setAccessoryView:(NSView *)aView	Adds a View to the panel.

Updating the Panel's Display 

- (void)convertOldFactor:(float *)old	 Returns by reference the ratio between a point and the
newFactor:(float *)new	 	currently chosen unit of measurement. If invoked within the pickedUnits: method, old refers to the ratio before the user's choice and new refers to the new ratio.

- (void)pickedButton:(id)sender	Stops the event loop.

- (void)pickedOrientation:(id)sender	Updates the panel with the selected orientation.

- (void)pickedPaperSize:(id)sender	Updates the panel when a paper size is selected.

- (void)pickedUnits:(id)sender	Updates the panel when a new unit is selected.

Communicating with the NSPrintInfo Object 

- (NSPrintInfo *)printInfo	Returns the NSPrintInfo object that used when the panel is run.

- (void)readPrintInfo	Reads the NSPageLayout's values from the NSPrintInfo object.

- (void)writePrintInfo	Writes the NSPageLayout's values to the NSPrintInfo object.