Copyright ©1995 by NeXT Computer, Inc.  All Rights Reserved.

View



Inherits From: Responder : Object
Declared In: appkit/View.h



Class Description

View is an abstract class that provides its subclasses with a structure for drawing and handling events.  Any application that needs to display, print, or receive events must use View objects.

To be displayed, a View must be placed in a Window.  All the Views within a Window are arranged in a hierarchy, with each View having a single superview and zero or more subviews.  Each View has its own area to draw in and its own coordinate system, expressed as a transformation of its superview's coordinate system.  A View can scale, translate, or rotate its coordinates, flip the polarity of its y-axis, or use the same coordinate system as its superview.

A View keeps track of its size and location in two ways:  as a frame rectangle (expressed in its superview's coordinate system) and as a bounds rectangle (expressed in its own coordinate system).  Both are represented by NXRect structures.



Instance Variables

NXRect frame;

NXRect bounds;

id superview;

id subviews;

id window;

struct _ _vFlags {
unsigned int  noClip:1;
unsigned int  translatedDraw:1;
unsigned int  drawInSuperview:1;
unsigned int  alreadyFlipped:1;
unsigned int  needsFlipped:1;
unsigned int  rotatedFromBase:1;
unsigned int  rotatedOrScaledFromBase:1;
unsigned int  opaque:1;
unsigned int  disableAutodisplay:1;
unsigned int  needsDisplay:1;
unsigned int  validGState:1;
unsigned int  newGState:1;

} vFlags;


frame The size and location of the View in its superview's coordinate system.
bounds The size and location of the View in its own coordinate system.
superview The View's parent in the view hierarchy.
subviews A list of the View's immediate children in the view hierarchy.
window The Window in which the View is displayed.
vFlags.noClip YES if drawing isn't clipped to the frame.
vFlags.translatedDraw YES if the bounds rectangle origin isn't (0,0).
vFlags.drawInSuperview YES if the bounds origin equals the frame origin.
vFlags.alreadyFlipped YES if the View's superview is flipped.
vFlags.needsFlipped YES if the View is flipped.
vFlags.rotatedFromBase YES if the View's coordinates are rotated from base coordinates.
vFlags.rotatedOrScaledFromBase
YES if the View's coordinates are rotated or scaled from base coordinates.
vFlags.opaque YES if the View is opaque.
vFlags.disableAutodisplay YES if automatic display is disabled.
vFlags.needsDisplay YES if the View has changed since it was last displayed.
vFlags.validGState YES if the View's graphics state is valid.
vFlags.newGState YES if the View has a new graphics state.



Method Types

Initializing and freeing View objects
initFrame:
init
free
Managing the View hierarchy addSubview:
addSubview::relativeTo:
findAncestorSharedWith:
isDescendantOf:
opaqueAncestor
removeFromSuperview
replaceSubview:with:
subviews
superview
window
windowChanged:
Modifying the frame rectangle frameAngle
getFrame:
moveBy::
moveTo::
rotateBy:
rotateTo:
setFrame:
sizeBy::
sizeTo::
Modifying the coordinate system
boundsAngle
drawInSuperview
getBounds:
isFlipped
isRotatedFromBase
isRotatedOrScaledFromBase
rotate:
scale::
setDrawOrigin::
setDrawRotation:
setDrawSize::
setFlipped:
translate::
Converting coordinates centerScanRect:
convertPoint:fromView:
convertPoint:toView:
convertPointFromSuperview:
convertPointToSuperview:
convertRect:fromView:
convertRect:toView:
convertRectFromSuperview:
convertRectToSuperview:
convertSize:fromView:
convertSize:toView:
Notifying ancestor Views descendantFlipped:
descendantFrameChanged:
notifyAncestorWhenFrameChanged:
notifyWhenFlipped:
suspendNotifyAncestorWhenFrameChanged:
Resizing subviews resizeSubviews:
setAutoresizeSubviews:
setAutosizing:
autosizing
superviewSizeChanged:
Graphics state objects allocateGState
freeGState
gState
initGState
renewGState
notifyToInitGState:
Focusing clipToFrame:
doesClip
setClipping:
isFocusView
lockFocus
unlockFocus
Displaying canDraw
display
display::
display:::
displayFromOpaqueAncestor:::
displayIfNeeded
drawSelf::
getVisibleRect:
isAutodisplay
setAutodisplay:
isOpaque
setOpaque:
needsDisplay
setNeedsDisplay:
shouldDrawColor
update
Scrolling adjustScroll:
autoscroll:
calcUpdateRects::::
invalidate::
scrollPoint:
scrollRect:by:
scrollRectToVisible:
Managing the cursor addCursorRect:cursor:
discardCursorRects
removeCursorRect:cursor:
resetCursorRects
Assigning a tag findViewWithTag:
tag
Aiding event handling acceptsFirstMouse
hitTest:
mouse:inRect:
performKeyEquivalent:
shouldDelayWindowOrderingForEvent:
Dragging dragFile:fromRect:slideBack:event:
dragImage:at:offset:event:pasteboard:source:slideBack:
registerForDraggedTypes:count:
unregisterDraggedTypes
Printing printPSCode:
faxPSCode:
faxPSCode:toList:numberList:sendAt:wantsCover:
wantsNotify:wantsHires:faxName:
copyPSCodeInside:to:
writePSCodeInside:to:
openSpoolFile:
spoolFile:
canPrintRIB
Setting up pages knowsPagesFirst:last:
getRect:forPage:
placePrintRect:offset:
heightAdjustLimit
widthAdjustLimit
Writing conforming PostScript beginPSOutput
beginPrologueBBox:creationDate:createdBy:
fonts:forWhom:pages:title:
endHeaderComments
endPrologue
beginSetup
endSetup
adjustPageWidthNew:left:right:limit:
adjustPageHeightNew:top:bottom:limit:
beginPage:label:bBox:fonts:
beginPageSetupRect:placement:
drawSheetBorder::
drawPageBorder::
addToPageSetup
endPageSetup
endPage
beginTrailer
endTrailer
endPSOutput
Archiving awake
read:
write:



Instance Methods

acceptsFirstMouse
(BOOL)acceptsFirstMouse

This returns YES if an initial mouse-down event in the View--an event that causes the View's Window to become the key window--is sent to the View (through a mouseDown: message).  If only those mouse-downs that occur when the View's Window is already key are sent, this returns NO (the default).  The only way to change the default behavior is to implement this method in a View subclass.



addCursorRect:cursor:
addCursorRect:(const NXRect *)aRect cursor:anNXCursor

Creates a cursor rectangle, an area within the View that has its own cursor:  When the user moves the mouse within the rectangle specified by aRect, the cursor object that the mouse controls changes to anNXCursor, which must be an NXCursor object.  The rectangle is given in the View's coordinate system; however, the rectangle isn't automatically clipped to the View's frame--it's possible to create a cursor rectangle that extends beyond the View.  You should also note that cursor rectangles don't work well in rotated Views.

You never invoke this method directly from your application.  It should only be used as part of the implementation of the resetCursorRects method.

Returns self.

See also:  resetCursorRects



addSubview:
addSubview:aView

Adds aView to the View's list of subviews such that new subview will be displayed on top of its siblings.  The receiving View is also made aView's next responder.  Returns aView (or nil if it isn't a View).

See also:  addSubview::relativeTo:, subviews, removeFromSuperview, setNextResponder: (Responder)



addSubview::relativeTo:
addSubview:aView
:(int)place
relativeTo:otherView

Injects aView into the receiving View's list of subviews, such that it will be displayed immediately above or below otherView, as place is NX_ABOVE or NX_BELOW.  If otherView is nil (or isn't in the subview list), aView is added above or below all its siblings.  Returns aView (or nil if it isn't a View).

See also:  addSubview:, subviews, removeFromSuperview, initFrame:, setNextResponder:



addToPageSetup
addToPageSetup

Allows applications to add a scaling operator to the PostScript code generated when printing; if you must add a scaling operator, this is the correct place to do so.  This method is invoked by printPSCode: and faxPSCode:.  By default, this method simply returns self; this method can be overridden by applications that implement their own pagination.

See also:  beginPageSetupRect:placement:



adjustPageHeightNew:top:bottom:limit:
adjustPageHeightNew:(float *)newBottom
top:(float)oldTop
bottom:(float)oldBottom
limit:(float)bottomLimit

Adjusts page height for automatic pagination when printing the View.  This method is invoked by printPSCode: and faxPSCode: to set newBottom, which will be the new bottom of the strip to be printed for the current page.  oldTop and oldBottom are the current values for the horizontal strip to be printed.  bottomLimit is the topmost value newBottom can be set to.  If this limit is exceeded, newBottom is set to oldBottom.  By default this method tries to not let the View be cut in two.  All parameters are in the View's own coordinate system.  Returns self.



adjustPageWidthNew:left:right:limit:
adjustPageWidthNew:(float *)newRight
left:(float)oldLeft
right:(float)oldRight
limit:(float)rightLimit

Adjusts page width for automatic pagination when printing the View.  This method is invoked by printPSCode: and faxPSCode: to set newRight, which will be the new right edge of the strip to be printed for the current page.  oldLeft and oldRight are the current values for the vertical strip to be printed.  rightLimit is the leftmost value newRight can be set to.  If this limit is exceeded, newRight is set to oldRight.  By default this method tries to not let the View be cut in two.  All parameters are in the View's own coordinate system.  Returns self.



adjustScroll:
adjustScroll:(NXRect *)newVisible

Allows you to correct the scroll position of a document.  This method is invoked by a ClipView immediately prior to scrolling its document view.  You may want to override it to provide specific scrolling behavior.  newVisible will be the visible rectangle after the scroll.  You might use this for scrolling through a table as in a spreadsheet.  You could modify newVisible->origin such that the scroll would fall on column or row boundaries.  Returns self.



allocateGState
allocateGState

Explicitly tells the View to allocate a graphics state object.  Graphics state objects are Display PostScript objects that contain the entire state of the graphics environment.  They are used by the Application Kit as a caching mechanism to save PostScript code used for focusing, purely as a performance optimization.  You can allocate a graphics state object for Views that will be focused on repeatedly, but you should exercise some discretion as they can take a fair amount of memory.  The graphics state object will be freed automatically when the View is freed.  Returns self.

See also:  freeGState



autoscroll:
autoscroll:(NXEvent *)theEvent

Scrolls the View when the cursor is dragged to a position outside its superview.  You invoke this method from within a modal responder loop to cause scrolling to occur when the cursor is outside the View's superview.  The receiving View must be the document view of a ClipView for this method to have any effect.  theEvent->location must be in window base coordinates. You can invoke this method repeatedly so that scrolling continues even when there is no mouse movement.  Returns nil if no scrolling occurs; otherwise returns self.

See also:  autoscroll: (ClipView), beginModalSession:for: (Application)



autosizing
(unsigned int)autosizing

Returns the View's autosizing mask.  The mask is used to determine how the View is automatically resized when its superview is resized.  For the mask to have an effect, the superview must be set to resize its subviews; this is done through the setAutoresizeSubviews: method.  The autosizing masks are listed under the setAutosizing: method.

See also:  setAutosizing:, setAutoresizeSubviews:



awake
awake

Invoked after unarchiving to allow the View to perform additional initialization.  Returns self.



beginPage:label:bBox:fonts:
beginPage:(int)ordinalNum
label:(const char *)aString
bBox:(const NXRect *)pageRect
fonts:(const char *)fontNames

Writes a conforming Postscript page separator.  This method is invoked by printPSCode: and faxPSCode:.

ordinalNum specifies the page's position in the document's page sequence (from 1 through n for an n-page document).

aString is a string that contains no white space characters.  It identifies the page according to the document's internal numbering scheme.  If aString is NULL, the ASCII equivalent of ordinalNum is used.

pageRect is the rectangle enclosing all the drawing on the page about to be printed in the default PostScript coordinate system of the page.  If pageRect is NULL, "(atend)" is output instead of a description of the bounding box, and the bounding box is output at the end of the page.

fontNames is a string containing the names of the fonts used in this page.  Each name should be separated by a space.  If the fonts used are unknown before the page is printed, fontNames can be NULL.  They will then be listed automatically at the end of the page description.  Returns self.



beginPageSetupRect:placement:
beginPageSetupRect:(const NXRect *)aRect
placement:(const NXPoint *)location

Writes the page setup section for a page.  This method is invoked by printPSCode: and faxPSCode: after the starting comments for the page have been written.  It outputs a PostScript save, and generates the initial coordinate transformation to set this View up for printing the aRect rectangle within the View.  This method does a lockFocus on the View, which must be balanced in endPage by an unlockFocus.  The save output here should be balanced by a PostScript restore in endPageaRect is the rectangle in the View's coordinates that is being printed.  location is the offset in page coordinates of the rectangle on the physical page.  Returns self.

See also:  printPSCode, endPage, lockFocus, addToPageSetup



beginPrologueBBox:creationDate:createdBy:
fonts:forWhom:pages:title:
beginPrologueBBox:(const NXRect *)boundingBox
creationDate:(const char *)dateCreated
createdBy:(const char *)anApplication
fonts:(const char *)fontNames
forWhom:(const char *)user
pages:(int)numPages
title:(const char *)aTitle

Invoked by printPSCode: and faxPSCode: to write the start of a conforming PostScript header.

boundingBox is the bounding box of the document.  This rectangle should be in the default PostScript coordinate system on the page.  If it is unknown boundingBox should be NULL and the system will accumulate it as pages are printed.

dateCreated is an ASCII string containing a human readable date.  If dateCreated is NULL the current date is used.

anApplication is a string containing the name of the document creator.  If anApplication is NULL then the string returned by Application's appName method is used.

fontNames is a string holding the names of the fonts used in the document.  Names should be separated by a space.  If the fonts used are unknown before the document is printed, fontNames should be NULL.  In this case each font that is referenced by a findFont is written in the trailer.

user is a string containing the name of the person the document is being printed for.  If NULL the login name of the user is used.

numPages specifies the number of pages in the document.  If unknown at the beginning of printing, numPages should have a value of -1.  In this case the pages are counted as they are generated and the resulting count is written in the trailer.

aTitle is a string specifying the title of the document.  If aTitle is NULL, then the title of the View's Window is used.  If the Window has no title, "Untitled" is output.  Returns self.

See also:  appName (Application)



beginPSOutput
beginPSOutput

Performs various initializations before actual PostScript generation begins.  This method makes the Display PostScript context stored in the Application object's global PrintInfo object into the current context.  This has the effect of redirecting all PostScript output from the Window Server to the spool file or printer.  This method is invoked by printPSCode: and faxPSCode: just before any PostScript is generated.  Returns self.



beginSetup
beginSetup

Writes the beginning of the document setup section, which begins with a %%BeginSetup comment and includes a %%PaperSize comment declaring the type of paper being used.  This method is invoked by printPSCode: and faxPSCode: at the start of the setup section of the document, which occurs after the prologue of the document has been written, but before any pages are written.  This section of the output is intended for device setup or general initialization code.  Returns self.



beginTrailer
beginTrailer

Writes the start of a conforming PostScript trailer.  This method is invoked by printPSCode: and faxPSCode: immediately after all pages have been written.  Returns self.



boundsAngle
(float)boundsAngle

Returns the angle of the View's bounds rectangle relative to its frame rectangle.  If the View's coordinate system has been rotated, this angle will be the accumulation of all rotate: messages; otherwise, it will be 0.0.

See also:  rotate:, setDrawRotation:



calcUpdateRects::::
(BOOL)calcUpdateRects:(NXRect *)rects
:(int *)rectCount
:(NXRect *)enclRect
:(NXRect *)goodRect

You invoke this method to generate update rectangles for a subsequent display invocation.  rects is an array of 3 rectangles, and rectCount will be set to the number of rectangles in rects that have been filled in, which will be either 0, 1, or 3.  enclRect is a rectangle that contains the entire area subject to update, and goodRect is a rectangle that contains the area that does not need to be updated.  goodRect will be set to the intersection of goodRect and enclRect, or to a rectangle with an origin and size of zero if they do not intersect.  The update rectangles are computed by finding the area in enclRect that isn't included in goodRect.  After the method invocation, if rectCount is 0, no update rectangles were generated.  If rectCount is 1, the area that needs to be updated is in rects[0].  If rectCount is 3, the areas that need to be updated are in rects[1] and rects[2], and rects[0] is the same as enclRect.

Returns YES if any update rectangles were generated (in other words, if rectCount is greater than zero); otherwise returns NO.

See also:  scrollRect:by:, NXIntersectionRect()



canDraw
(BOOL)canDraw

Informs you of whether drawing will have any result.  You only need to send this message when you want to do drawing, but are not invoking one of the display methods.  You should not draw or send the lockFocus: message if this returns NO.  This method returns YES if your View has a Window object, your View's Window object has a corresponding window on the Window Server, and your Window object is enabled for display; otherwise it returns NO.

See also:  isDisplayEnabled (Window)



canPrintRIB
(BOOL)canPrintRIB

Indicates whether the View can print RIB files.



centerScanRect:
centerScanRect:(NXRect *)aRect

Converts the corners of a rectangle to lie on the center of device pixels.  This is useful in compensating for PostScript overscanning when the coordinate system has been scaled.  This routine converts the given rectangle to device coordinates, adjusts the rectangle to lie in the center of the pixels, and converts the resulting rectangle back to the View's coordinate system. Returns self.



clipToFrame:
clipToFrame:(const NXRect *)frameRect

Allows the View to do arbitrary clipping during focusing.  This method is invoked from within the focusing mechanism if clipping is required.  If you override this method, you must use frameRect rather than the View's frame instance variable, because the origins may not be the same due to focusing.  The following example demonstrates clipping the View to a circular region:

- clipToFrame:(const NXRect *)frameRect
{
float x, y, radius;

// Center the circle and pick an appropriate radius
x = frameRect->origin.x + frameRect->size.width/2.0;
y = frameRect->origin.y + frameRect->size.height/2.0;
radius = frameRect->size.height/2.0;

// Create a circular clipping path
PSnewpath();
PSarc(x, y, radius, 0.0, 360.0);
PSclosepath();
PSclip();

return self;
}

If you override this method, you will probably need to send a setCopyOnScroll:NO to the View's subviews to make them scroll properly.  Returns self.

See also:  setCopyOnScroll: (ClipView)



convertPoint:fromView:
convertPoint:(NXPoint *)aPoint fromView:aView

Converts a point from aView's coordinate system to the coordinate system of the receiving View.  If aView is nil, then this method converts from window base coordinates.  Both aView and the receiving View must belong to the same Window.  Returns self.



convertPoint:toView:
convertPoint:(NXPoint *)aPoint toView:aView

Converts a point from the receiving View's coordinate system to the coordinate system of aView.  If aView is nil, then this method converts to window base coordinates.  Both aView and the receiving View must belong to the same Window.  Returns self.



convertPointFromSuperview:
convertPointFromSuperview:(NXPoint *)aPoint

Converts a point from the coordinate system of the receiving View's superview to the coordinate system of the receiving View. Returns self.

See also:  convertRectFromSuperview:, convertPointToSuperview:



convertPointToSuperview:
convertPointToSuperview:(NXPoint *)aPoint

Converts a point from the View's coordinate system to that of its superview.  Returns self.

See also:  convertPointFromSuperview:, convertPoint:fromView:



convertRect:fromView:
convertRect:(NXRect *)aRect fromView:aView

Converts aRect from aView's coordinate system to the coordinate system of the receiving View.  Both aView and the receiving View must belong to the same Window.  Returns self.



convertRect:toView:
convertRect:(NXRect *)aRect toView:aView

Converts aRect from the receiving View's coordinate system to the coordinate system of aView.  Both aView and the receiving View must belong to the same Window.  Returns self.



convertRectFromSuperview:
convertRectFromSuperview:(NXRect *)aRect

Converts aRect from the coordinate system of the receiving View's superview to the coordinate system of the receiving View. Returns self.

See also:  convertRectToSuperview:



convertRectToSuperview:
convertRectToSuperview:(NXRect *)aRect

Converts aRect from the receiving View's coordinate system to the coordinate system of its superview.  Returns self.

See also:  convertRectFromSuperview:



convertSize:fromView:
convertSize:(NXSize *)aSize fromView:aView

Converts aSize from the coordinate system of aView to the coordinate system of the receiving View.  Both aView and the receiving View must belong to the same Window.  Returns self.

See also:  convertSize:toView:



convertSize:toView:
convertSize:(NXSize *)aSize toView:aView

Converts aSize from the receiving View's coordinate system to the coordinate system of aView.  Both aView and the receiving View must belong to the same Window.  Returns self.

See also:  convertSize:fromView:



copyPSCodeInside:to:
copyPSCodeInside:(const NXRect *)rect to:(NXStream *)stream

Generates PostScript code for the View and all its subviews for the area indicated by rect.  The PostScript code is written to the NXStream stream.  Returns self, assuming no exception is raised in the generation of PostScript code.  If an exception is raised, control is given to the appropriate error handler, and this method does not return.

See also:  NX_RAISE()



descendantFlipped:
descendantFlipped:sender

Notifies the receiving View that sender, a View below the receiving View in the view hierarchy, had its coordinate system flipped.  A descendantFlipped: message is sent from the setFlipped: method if a notifyWhenFlipped:YES message was previously sent to sender.

View's default implementation of this method simply passes the message to the receiving View's superview, and returns the superview's return value.  View subclasses should override this method to respond to the message as required.  In the Application Kit, ClipView overrides this method to keep its coordinate system aligned with its document view.

See also:  notifyWhenFlipped:, setFlipped:, descendantFlipped: (ClipView)



descendantFrameChanged:
descendantFrameChanged:sender

Notifies the receiving View that sender, a View below the receiving View in the view hierarchy, was resized or moved.  A descendantFrameChanged: message is sent from the sizeTo:: and moveTo:: methods if a notifyAncestorWhenFrameChanged:YES message was previously sent to sender.

View's default implementation of this method simply passes the message to the receiving View's superview, and returns the superview's return value.  View subclasses should override this method to respond to the message as required.  In the Application Kit, the ClipView class overrides this method to notify the ScrollView to reset scroller knobs when the document view's frame is changed.

See also:  notifyAncestorWhenFrameChanged:, sizeTo::, moveTo::



discardCursorRects
discardCursorRects

Removes the View's cursor rectangles.  You never invoke this method directly; it's invoked automatically before the View's cursor rectangles are reset.  Returns self.

See also:  resetCursorRects, discardCursorRects (Window)



display
display

Displays the View and its subviews.  Returns self.  This method is equivalent to:

display:(NXRect *)0 :0 :NO

See also:  display:::, drawSelf::



display::
display:(const NXRect *)rects :(int)rectCount

Displays the View and its subviews.  The rectangles are specified in the receiving View's coordinate system.  Returns self. This method is equivalent to:

display:rects :rectCount :NO

See also:  display:::, drawSelf::



display:::
display:(const NXRect *)rects
:(int)rectCount
:(BOOL)clipFlag

Displays the View and its subviews by invoking the lockFocus, drawSelf::, and unlockFocus methods.  rects is an array of drawing rectangles in the receiving View's coordinate system; they're used to restrict what is displayed.  rectCount is the number of valid rectangles in rects (0, 1, or 3).

If rectCount is 3, then rects[0] should contain the smallest rectangle that completely encloses rects[1] and rects[2], the two rectangles that actually specify the regions to be displayed.

If rectCount is 1, rects[0] should specify the region to be displayed.

If rectCount is 0 or rects is NULL, the View's visible rectangle is substituted for rects[0] and a value of 1 is used for rectCount.

In any case, the rectangles in rects are intersected against the visible rectangle.

This method doesn't display a subview unless it falls at least partially inside rects[0] if rectCount is 1, or inside either rects[1] or rects[2] if rectCount is 3.  When this method is applied recursively to each subview, the drawing rectangles are translated to the subview's coordinate system and intersected with its bounds rectangle to produce a new array.  rects and rectCount are then passed as arguments to each View's drawSelf:: method.

If clipFlag is YES, this method clips to the drawing rectangles.  Clipping isn't done recursively for each subview, however.

If this method succeeds in displaying the View, the flag indicating that the View needs to be displayed is cleared.  Returns self.

See also:  display, display::, drawSelf::, needsDisplay, update, displayFromOpaqueAncestor:::



displayFromOpaqueAncestor:::
displayFromOpaqueAncestor:(const NXRect *)rects
:(int)rectCount
:(BOOL)clipFlag

Correctly displays Views that aren't opaque.  This method searches from the View up the View hierarchy for an opaque ancestor View.  The rectangles specified by rects are copied and then converted to the opaque View's coordinates and display::: is sent to the opaque View.  The third argument, clipFlag, is the same as the third argument to display:::.

If the receiving View is opaque, this method has the same effect as display:::.  Returns self.

See also:  display:::, isOpaque, setOpaque:



displayIfNeeded
displayIfNeeded

Descends the View hierarchy starting at the receiving View and sends a display message to each View that needs to be displayed, as indicated by each View's needsDisplay flag.  This is useful when you wish to disable display in the Window, modify a series of Views, and then display only the ones whose appearance has changed.  Returns self.

See also:  display, needsDisplay



doesClip
(BOOL)doesClip

Returns YES (the default) if the drawing that's generated by the View is clipped to the View's frame; otherwise returns NO.

See also:  setClipping:



dragFile:fromRect:slideBack:event:
dragFile:(const char *)filename
fromRect:(NXRect *)rect
slideBack:(BOOL) aFlag
event:(NXEvent *)event

Allows a file icon to be dragged from the View to any application that accepts files.  This method only makes sense when invoked from within an implementation of the mouseDown: method.  The arguments are:

filename is the complete name (including path) of the file to be dragged.  If there is more than one file to be dragged, you
must separate the filenames with a single tab (`\t') character.

rect describes the position of the icon in the View's coordinates; the width and height of rect must both be 48.0.
aFlag indicates whether the icon should slide back to its position in the View if the file is not accepted.  If aFlag is YES and filename is not accepted and the user has not disabled icon animation, the icon will slide back; otherwise it will not.
event is the mouse-down event record (or a copy).

This method returns self if the View successfully initiated the file dragging session; otherwise it returns nil.

See also:  dragImage:at:offset:event:pasteboard:source:slideBack:



dragImage:at:offset:event:pasteboard:source:slideBack:
dragImage:anImage
at:(NXPoint *)location
offset:(NXPoint *)mouseOffset
event:(NXEvent *)theMouseDown
pasteboard:(Pasteboard *)pboard
source:sourceObject
slideBack:(BOOL)slideFlag

Instigates an image-dragging session.  This method only makes sense when invoked from within an implementation of the mouseDown: method.  The arguments are

anImage is the NXImage (contained within the View) that's being dragged.
location is the NXImage's origin in the View's coordinate system.
mouseOffset gives the mouse's current location relative to the mouse-down location.
theMouseDown is the mouse-down that started the whole thing going (see below).
pboard is the Pasteboard that holds the data that the NXImage represents (see below).
sourceObject is the object that receives NXDraggingSource messages.
slideFlag determines whether the NXImage should slide back if it's rejected.

Before invoking this method, the View must place the data that's being dragged on the drag pasteboard.  To do this, it must get the pasteboard, declare the type of data that it's placing, and then place the data:

/* You always use the NXDragPboard pasteboard when dragging. */
Pasteboard *pboard = [Pasteboard newName:NXDragPboard];

/* Declare the type of data and place it on the pasteboard. */
[pboard declareTypes:... num:... owner:...];
[pboard writeType:... data:... length:...];

/* Now invoke dragImage:.*/
[self dragImage:... at:... offset:... event:...
pasteboard:pboard source:... slideBack:...];

This method returns self if the View successfully initiated the file dragging session; otherwise it returns nil.

Warning: If you ask for events inside the mouseDown: method before invoking this method (if, for example, you're making sure that the image is really being dragged before initiating a dragging session), you must copy the mouse-down event before asking for more events.  You then pass the copy as the argument to the event: keyword of this method.
drawInSuperview
drawInSuperview

Makes the View's coordinate system identical to that of its superview.  This can reduce the amount of PostScript code that's generated to focus on the View.  After invoking this method, the View's bounds rectangle origin is the same as its frame rectangle origin.

Although the View's superview may be flipped, the View's coordinate system won't be flipped unless it receives a setFlipped: message.  You should invoke drawInSuperview after creating the View and before applying any coordinate transformations to it.  Returns self.

See also:  setFlipped:



drawPageBorder::
drawPageBorder:(float)width :(float)height

Allows applications that use the Application Kit pagination facility to draw additional marks on each logical page.  This method is invoked by beginPageSetupRect:placement:, and the default implementation doesn't draw anything.  Returns self.



drawSelf::
drawSelf:(const NXRect *)rects :(int)rectCount

Implemented by subclasses to draw the View.  Each View subclass must override this method to draw itself within its frame rectangle.  The default implementation of this method does nothing.

This method is invoked by the display methods (display, display::, and display:::); you shouldn't send a drawSelf:: message directly to a View.

rects is an array of rectangles indicating the region within the View that needs to be drawn.  rectCount indicates the number of rectangles in the rects array, which is either 1 or 3.  If rectCount is 1, then rects[0] specifies the region to be drawn.  If rectCount is 3, then rects[0] contains the smallest rectangle that completely encloses rects[1] and rects[2], the two rectangles that actually specify the regions that need to be drawn.  Note that if rectCount is 3, you can just draw the contents of rects[0], or you can draw the contents of both rects[1] and rects[2], but there's no need to draw all three rectangles.  For optimum drawing performance, you shouldn't draw anything that doesn't intersect with the rects rectangles, although it is possible to draw the entire contents of the View and simply allow the contents of the View to be clipped.

Your implementation of drawSelf:: doesn't need to invoke lockFocus; focus is already locked on an object when it's told to draw itself.  Returns self.

See also:  display, display::, display:::



drawSheetBorder::
drawSheetBorder:(float)width :(float)height

Allows applications that use the Application Kit pagination facility to draw additional marks on each printed sheet.  This method is invoked by beginPageSetupRect:placement:, and the default implementation doesn't draw anything.  Returns self.



endHeaderComments
endHeaderComments

Writes out the end of a conforming PostScript header.  It prints out the %%EndComments line and then the start of the prologue, including the Application Kit's standard printing package.  The prologue should contain definitions global to a print job.  This method is invoked by printPSCode: and faxPSCode: after beginPrologueBBox:creationDate:createdBy:fonts:forWhom:pages:title: and before endPrologue.  Returns self.



endPage
endPage

Writes the end of a conforming PostScript page.  This method is invoked after each page is printed.  It performs an unlockFocus to balance the lockFocus done in beginPageSetupRect:placement:.  It also generates a PostScript showpage and a restore. Returns self.

See also:  beginPageSetupRect:placement:



endPageSetup
endPageSetup

Writes the end of the page setup section, which begins with a %%EndPageSetup comment.  This method is invoked by printPSCode: and faxPSCode: just after beginPageSetupRect:placement: is invoked.  Returns self.



endPrologue
endPrologue

Writes out the end of the conforming PostScript prologue.  This method is invoked by printPSCode: and faxPSCode: after the prologue of the document has been written.  Applications can override this method to add their own definitions to the prologue. For example:

- endPrologue
{
DPSPrintf(DPSGetCurrentContext(), "/littleProc {pop} def");
return [super endPrologue];
}


endPSOutput
endPSOutput

Ends a print job.  This method is invoked by printPSCode: and faxPSCode:.  It closes the spool file (if any), and restores the old PostScript context so that further PostScript output is directed to the Window Server.  Returns self.

See also:  beginPSOutput



endSetup
endSetup

Writes out the end of the setup section, which begins with a %%EndSetup comment.  This method is invoked by printPSCode: and faxPSCode: just after beginSetup is invoked.  Returns self.



endTrailer
endTrailer

Writes the end of the conforming PostScript trailer.  This method is invoked by printPSCode: and faxPSCode: just after beginTrailer is invoked.  Returns self.

See also:  beginTrailer



faxPSCode:
faxPSCode:sender

Prints the View and all its subviews to a fax modem.  If the user cancels the job, or if there are any errors in generating the PostScript, this method returns nil; otherwise it returns self.

This method normally brings up the Fax panel before actually initiating printing, but if sender implements a shouldRunPrintPanel: method, the View will invoke that method to query sender.  If sender then returns NO, then the Fax panel won't be displayed, and the View will be printed using the last settings of the Fax panel.

See also:  printPSCode:, shouldRunPrintPanel: (Object Additions)



faxPSCode:toList:numberList:sendAt:wantsCover:wantsNotify: wantsHires:faxName:
faxPSCode:sender
toList:(const char *const *)names
numberList:(const char *const *)numbers
sendAt:(time_t)time
wantsCover:(BOOL)coverFlag
wantsNotify:(BOOL)notifyFlag
wantsHires:(BOOL)hiresFlag
faxName:(const char *)string

Sets up a fax session according to the arguments, and then faxes the View (and all its subviews).



findAncestorSharedWith:
findAncestorSharedWith:aView

Returns the closest common ancestor in the View hierarchy shared by aView and the receiving View, or nil if there's no such ancestor.  If aView and the receiving View are identical, this method returns self.

See also:  isDescendantOf:



findViewWithTag:
findViewWithTag:(int)aTag

Returns the View's nearest descendant (including itself) that has the given tag, or nil if no matching tag was found.

See also:  tag



frameAngle
(float)frameAngle

Returns the angle of the View's frame relative to its superview's coordinate system.

See also:  rotateTo:, rotateBy:



free
free

Releases the storage for the View and all its subviews.  This method also invalidates the cursor rectangles for the View's window, frees the View's graphics state object (if any), and removes the View from the view hierarchy; the View will no longer be registered as a subview of any other View.

See also:  + allocFromZone: (Object), initFrame:



freeGState
freeGState

Frees the graphics state object that was previously allocated for the View.  Returns self.

See also:  allocateGState:



getBounds:
getBounds:(NXRect *)theRect

Copies the View's bounds rectangle into the structure specified by theRect.  Returns self.

See also:  boundsAngle



getFrame:
getFrame:(NXRect *)theRect

Copies the View's frame rectangle into the structure specified by theRect.  The frame rectangle is specified in the coordinate system of the View's superview.  Returns self.



getRect:forPage:
(BOOL)getRect:(NXRect *)theRect forPage:(int)page

Implemented by subclasses to determine the rectangle of the View to be printed for page number page.  You should override this method to fill in theRect with the coordinates of the View (in its own coordinate system) that represent the page requested.  The View will later be told to display the theRect region in order to generate the image for this page.  This method is invoked by printPSCode: and faxPSCode: if the View's knowsPagesFirst:last: method returns YES.  The View should not assume that the pages will be generated in any particular order.

This method returns YES if page is a valid page number for the View.  It returns NO if page is outside the View.

See also:  knowsPagesFirst:last:



getVisibleRect:
(BOOL)getVisibleRect:(NXRect *)theRect

Gets the visible portion of the View.  A rectangle enclosing the visible portion is placed in the structure specified by theRect. This method returns YES if part of the View is visible, and NO if none of it is.

Visibility is determined by intersecting the View's frame rectangle against the frame rectangles of each of its ancestors in the view hierarchy, after appropriate coordinate transformations.  Only those portions of the View that lie within the frame rectangles of all its ancestors can be visible.

If the View is in an off-screen window, or is covered by another window, this method may nevertheless return YES.  This method does not take into account any siblings of the receiving View or siblings of its ancestors.

If the View is being printed, this method places the portion of the View that is visible on the page being imaged in the structure specified by theRect.

See also:  isVisible (Window), getDocVisibleRect: (ScrollView), getDocVisibleRect: (ClipView)



gState
(int)gState

Returns the graphics state object allocated to the View.  If no graphics state object has been allocated, or if the View has not been focused on since receiving the allocateGState message, this method will return 0.  Graphics state objects are not immediately allocated by invoking the allocateGState method, but are done in a "lazy" fashion upon subsequent focusing.

See also:  allocateGState, lockFocus



heightAdjustLimit
(float)heightAdjustLimit

Returns the fraction (between 0.0 and 1.0) of the page that can be pushed onto the next page during automatic pagination to prevent items from being cut in half.  This limit applies to vertical pagination.  This method is invoked by printPSCode: and faxPSCode:.  By default, this method returns 0.2.

See also:  adjustPageHeightNew:top:bottom:limit:



hitTest:
hitTest:(NXPoint *)aPoint

Returns the subview of the receiving View that contains the point specified by aPoint.  The lowest subview in the View hierarchy is returned.  Returns the View if it contains the point but none of its subviews do, or nil if the point isn't located within the receiving View.

This method is used primarily by a Window to determine which View in the View hierarchy should receive a mouse-down event.  You'd rarely have reason to invoke this method, but you might want to override it to have a View trap mouse-down events before they get to its subviews.

aPoint is in the receiving View's superview's coordinates.



init
init

Initializes the View, which must be a newly allocated View instance.  This method does not alter the default frame rectangle, which is all zeros.  This method is equivalent to initFrame:NULL.  Note that if you instantiate a custom View from Interface Builder, it will be initialized with the initFrame: method; initialization code in the init method will not be performed.  Returns self.

See also:  initFrame:



initFrame:
initFrame:(const NXRect *)frameRect

Initializes the View, which must be a newly allocated View instance.  The View's frame rectangle is made equivalent to that pointed to by frameRect.  This method is the designated initializer for the View class, and can be used to initialize a View allocated from your own zone.  Programs generally use instances of View subclasses rather than direct instances of the View class.  Returns self.

See also:  init, + alloc (Object), + allocFromZone: (Object), + new (Object)



initGState
initGState

Implemented by subclasses of View to initialize the View's graphics state.  The View will receive this message if you previously sent it a notifyToInitGState:YES message.  By default this method simply returns self, but you can override it to send PostScript code to initialize the View's graphics state.  You could use this method to set a default font or line width for the View.  You should not use this method to send any coordinate transformations or clipping operators.

See also:  allocateGState, gState, notifyToInitGState:



invalidate::
invalidate:(const NXRect *)rects :(int)rectCount

Invalidates the View and its subviews for later display.  This message is sent to the View after scrolling if the View is a subview of a ClipView and the View's parent ClipView previously received a setDisplayOnScroll:NO message.  You can override this method to optimize drawing performance by accumulating the invalid areas for later display.  rects is an array of rectangles in the receiving View's coordinate system, and rectCount is the number of valid rectangles in rects.

If rectCount is 1, rects[0] specifies the region requiring redisplay.  If rectCount is greater than 1, then rects[0] contains the smallest rectangle that completely encloses the remaining rectangles in the rects array, which specify the actual regions requiring redisplay.  Returns self.

See also:  rawScroll: (ClipView), display, display::, display:::, drawSelf::, setDisplayOnScroll: (ClipView)



isAutodisplay
(BOOL)isAutodisplay

This method returns the View's automatic display status.  After you change your data in such a way that it is no longer accurately represented, you should invoke this method to test the View's automatic display status.  If automatic display is enabled, you should send a display message to the View; otherwise you should send it a setNeedsDisplay:YES message.

See also:  update, display, setAutodisplay, needsDisplay, setNeedsDisplay:, displayIfNeeded



isDescendantOf:
(BOOL)isDescendantOf:aView

Returns YES if aView is an ancestor of the receiving View in the view hierarchy or if it's identical to the receiving View. Otherwise, this method returns NO.

See also:  superview, subviews, findAncestorSharedWith:



isFlipped
(BOOL)isFlipped

Returns YES if the receiver uses flipped drawing coordinates or NO if it uses native PostScript coordinates.  By default, Views are not flipped.

See also:  setFlipped:



isFocusView
(BOOL)isFocusView

Returns YES if the receiving View is the View that's currently focused for drawing; otherwise returns NO.  In other words, returns YES if drawing commands will be drawn into this View.

See also:  lockFocus



isOpaque
(BOOL)isOpaque

Returns whether the View is opaque (as set through setOpaque:).  Returns YES if the View guarantees that it will completely cover the area within its frame when it draws itself; otherwise returns NO.

See also:  setOpaque:, opaqueAncestor, displayFromOpaqueAncestor:::



isRotatedFromBase
(BOOL)isRotatedFromBase

Returns YES if the receiving View or any of its ancestors in the View hierarchy have been rotated; otherwise returns NO.



isRotatedOrScaledFromBase
(BOOL)isRotatedOrScaledFromBase

Returns YES if the receiving View or any of its ancestors in the View hierarchy have been rotated or scaled; otherwise returns NO.



knowsPagesFirst:last:
(BOOL)knowsPagesFirst:(int *)firstPageNum last:(int *)lastPageNum

Indicates whether this View can return a rectangle specifying the region that must be displayed to print a specific page.  This method is invoked by printPSCode: and faxPSCode:.  Just before invoking this method, the first page to be printed is set to 1, and the last page to be printed is set to the maximum integer size.  You can therefore override this method to change the first page to be printed, and also the last page to be printed if the View knows where its pages lie.  If this method returns YES, the printing mechanism will later query the View for the rectangle corresponding to a specific page using getRect:forPage:.

See also:  getRect:forPage:



lockFocus
(BOOL)lockFocus

Locks the PostScript focus on the View so that subsequent graphics commands are applied to the View.  This method ensures that the View draws in the correct coordinates and to the correct device.  You must send this message to the View before you draw to it, and you must balance it with an unlockFocus message to the View when you finish drawing.  Returns YES if the focus was already locked on the View, and NO if it wasn't.

lockFocus and unlockFocus are sent for you when you display the View with one of the display methods; you don't have to include lockFocus or unlockFocus in your drawSelf:: method.

See also:  display:::, isFocusView, unlockFocus



mouse:inRect:
(BOOL)mouse:(NXPoint *)aPoint inRect:(NXRect *)aRect

Returns whether the cursor hot spot at the point specified by aPoint lies inside the rectangle specified by aRectaPoint and aRect must be expressed in the same coordinate system.

You should never use the NXPointInRect() function as a substitute for this method.

See also:  convertPoint:fromView:, NXMouseInRect(), NXPointInRect()



moveBy::
moveBy:(NXCoord)deltaX :(NXCoord)deltaY

Moves the origin of the View's frame rectangle by (deltaX, deltaY) in its superview's coordinates.  This method works through the moveTo:: method.  Returns self.

See also:  moveTo::, sizeBy::



moveTo::
moveTo:(NXCoord)x :(NXCoord)y

Moves the origin of the View's frame rectangle to (x, y) in its superview's coordinates.  This method may also send a descendantFrameChanged: message to the View's superview.  Returns self.

See also:  setFrame:, sizeTo::, descendantFrameChanged:



needsDisplay
(BOOL)needsDisplay

Returns whether the View needs to be displayed to reflect changes to its contents.  If automatic display is disabled, the View will not redisplay itself automatically, so you can invoke this method to determine whether you need to send a display message to the View.  The flag indicating that the View needs to be displayed is cleared by the display methods when the View is displayed.

See also:  setNeedsDisplay:, update, setAutodisplay, isAutodisplay, display, displayIfNeeded



notifyAncestorWhenFrameChanged:
notifyAncestorWhenFrameChanged:(BOOL)flag

Determines whether the receiving View will inform its ancestors in the view hierarchy whenever its frame changes.  If flag is YES, subsequent sizeTo:: and moveTo:: messages to the View will send a descendantFrameChanged: message up the view hierarchy.  If flag is NO, no descendantFrameChanged: message will be sent to the View's ancestors.  The descendantFrameChanged: message permits Views to make any necessary adjustments when a subview is resized or moved. Returns self.

See also:  descendantFrameChanged:, sizeTo::, moveTo::



notifyToInitGState:
notifyToInitGState:(BOOL)flag

Determines whether the View will be sent initGState messages to allow it to initialize new graphics state objects.  If flag is YES, initGState messages will be sent to the View at the appropriate time; otherwise, they will not.  By default, the View is not sent messages to initialize its graphics state objects.  Returns self.

See also:  initGState



notifyWhenFlipped:
notifyWhenFlipped:(BOOL)flag

Determines whether the receiving View will inform its ancestors in the View hierarchy whenever its coordinate system is flipped.  If flag is YES, a setFlipped: message to the View will send a descendantFlipped: message up the View hierarchy. If flag is NO, no descendantFlipped: message will be sent to the View's ancestors.  The descendantFlipped: message permits Views to make any necessary adjustments when the orientation of a subview's coordinate system is flipped.  Returns self.

See also:  descendantFlipped:, setFlipped:



opaqueAncestor
opaqueAncestor

Returns the View's closest opaque ancestor (including the receiving View itself).

See also:  isOpaque, displayFromOpaqueAncestor:::



openSpoolFile:
openSpoolFile:(char *)filename

Opens the filename file for print spooling.  This method is invoked by printPSCode: and faxPSCode:; it shouldn't be directly invoked in program code.  However, you can override it to modify its behavior.

If filename is NULL or an empty string, the PostScript code is sent directly to the printing daemon, npd, without opening a file. (However, if the Window is being previewed or saved, a default file is opened in /tmp).

If filename is provided, the file is opened.  The printing machinery will then write the PostScript code to that file and the file will be printed (or faxed) using lpr.

This method opens a Display PostScript context that will write to the spool file, and sets the context of the application's global PrintInfo object to this new context.  It returns nil if the file can't be opened; otherwise it returns self.



performKeyEquivalent:
(BOOL)performKeyEquivalent:(NXEvent *)theEvent

Implemented by subclasses of View to allow them to respond to keyboard input.  If the View responds to the key, it should take the appropriate action and return YES.  Otherwise, it should return the result of passing the message along to super, which will pass the message down the View hierarchy:

return [super performKeyEquivalent:theEvent];

This method returns YES if the View or any of its subviews responds to the key; otherwise it returns NO.

The default implementation of this method simply passes the message down the View hierarchy and returns NO if none of the View's subviews responds to the key.  theEvent points to the event record of a key-down event.

See also:  commandKey: (Window and Panel)



placePrintRect:offset:
placePrintRect:(const NXRect *)aRect offset:(NXPoint *)location

Determines the location of the rectangle being printed on the physical page.  This method is invoked by printPSCode: and faxPSCode:aRect is the rectangle being printed on the current page.  This method sets location to be the offset of the rectangle from the lower left corner of the page.  All coordinates are in the default PostScript coordinate system of the page.

By default, if the flags for centering are YES in the global PrintInfo object, this routine centers the rectangle within the margins. If the flags are NO, it defaults to abutting the rectangle against the top left margin.  Returns self.



printPSCode:
printPSCode:sender

Prints the View and all its subviews.  If the user cancels the job, or if there are any errors in generating the PostScript code, this method returns nil; otherwise it returns self.

This method normally brings up the PrintPanel before actually initiating printing, but if sender implements a shouldRunPrintPanel: method, the View will invoke that method to query sender.  If sender's shouldRunPrintPanel: method returns NO, the PrintPanel will not be brought up as part of the printing process, and the View will be printed using the last settings of the PrintPanel.

See also:  faxPSCode:, copyPSCodeInside:to:, shouldRunPrintPanel: (Object Additions)



read:
read:(NXTypedStream *)stream

Reads the View and its subviews from the typed stream stream.  Returns self.



registerForDraggedTypes:count:
registerForDraggedTypes:(const char *const *)pbTypes count:(int)count

Registers the Pasteboard types that the View will accept in an image-dragging session.   pbTypes is a pointer to an array of the types; count is the number of elements in the array.  Returns self.

Keep in mind that the values in the first argument are Pasteboard types, not file extensions (you can't register for specific file extensions).  For example, the following registers a View as accepting files:

const char *fileType[] = {NXFilenamePboardType};
[aView registerForDraggedTypes:fileType count:1];

Note:  Registering a View for dragged types automatically makes it a candidate destination object during a dragging session. As such, it must implement some or all of the NXDraggingDestination protocol methods.  As a convenience, View provides default implementations of these methods.  See the NXDraggingDestination protocol description for details.

See also:  unregisterDraggedTypes



removeCursorRect:cursor:
removeCursorRect:(const NXRect *)aRect cursor:anNXCursor

Removes a cursor rectangle from the View.  aRect and anNXCursor must match the values that were specified when the cursor rectangle was added (through addCursorRect:cursor:).

You rarely need to use this method; it's usually easier to use Window's invalidateCursorRectsForView: method and let the resetCursorRects mechanism restore the cursor rectangles.  Returns self.

See also:  invalidateCursorRectsForView: (Window), resetCursorRects



removeFromSuperview
removeFromSuperview

Unlinks the View from its superview and its Window, removes it from the responder chain, and invalidates its cursor rectangles. Returns self.

See also:  addSubview:



renewGState
renewGState

Forces the View to reinitialize its graphics state object.  This method is lazy; the graphics state object isn't refreshed until the View actually draws.  Returns self.



replaceSubview:with:
replaceSubview:oldView with:newView

Replace oldView with newView in the View's subview list.  This method does nothing and returns nil if oldView is not a subview of the View or if newView is not a View.  Otherwise, this method returns oldView.

See also:  addSubview:



resetCursorRects
resetCursorRects

Resets the View's cursor rectangles.  Each View subclass that wants to include cursor rectangles--areas in which the cursor is changed--must implement this method.  The implementation must contain invocations of addCursorRect:cursor:, the method that defines the cursor rectangles and associates them with particular NXCursor objects.  The View must clip the cursor rectangles that it adds to ensure that they don't overlap the visible rectangle.  For example:

- resetCursorRects
{
NXRect visible;

if ([self getVisibleRect:&visible])
[self addCursorRect:&visible cursor:theCursor];
return self.
}

The default implementation does nothing.  The value returned by this method is ignored.

You never invoke this method directly; it's invoked automatically when the View's Window frame changes, or when the Window receives an invalidateCursorRectsForView: message.  Note that this method isn't invoked when the View's frame changes (unless it changed because its Window was resized).  If your application changes a View's frame programmatically, through sizeBy:: or moveBy:: for example, you should follow the frame-changing message with an invalidateCursorRectsForView: message, as shown below:

/* Shrink the View's frame. */
[aView sizeBy:-10.0 :-10.0];

/* Tell the Window that the View's cursor rects may have changed. */
[[aView window] invalidateCursorRectsForView:aView];

/* Redisplay the Window. */
[[aView window] display];

Invocations of this method aren't cumulative; before a resetCursorRects message is sent to a particular View, the View's existing cursor rectangles are automatically discarded.

See also:  addCursorRect:, invalidateCursorRectsForView: (Window)



resizeSubviews:
resizeSubviews:(const NXSize *)oldSize

Informs the View's subviews that the View's bounds rectangle size has changed.  This method is invoked from the sizeTo:: method if the View has subviews and has received a setAutoresizeSubviews:YES message.  By default, this method sends a superviewSizeChanged: message to each subview.  You should not invoke this method directly, but you may want to override it to define a specific retiling behavior.  oldSize is the previous bounds rectangle size.  Returns self.

See also:  sizeTo::, setAutoresizeSubviews:, superviewSizeChanged:



rotate:
rotate:(NXCoord)angle

Rotates the View's drawing coordinates by angle degrees from its current angle of orientation.  Positive values indicate counterclockwise rotation; negative values indicate clockwise rotation.  The position of the coordinate origin, (0.0, 0.0), remains unchanged; it's at the center of the rotation.  Returns self.

See also:  translate::, scale::, setDrawRotation:



rotateBy:
rotateBy:(NXCoord)deltaAngle

Rotates the View's frame rectangle by deltaAngle degrees from its current angle of orientation.  Positive values rotate the frame in a counterclockwise direction; negative values rotate it clockwise.  The position of the frame rectangle origin remains unchanged; it's at the center of the rotation.  Returns self.

See also:  rotateTo:



rotateTo:
rotateTo:(NXCoord)angle

Rotates the View's frame rectangle to angle degrees in its superview's coordinate system.  The position of the frame rectangle origin remains unchanged; it's at the center of the rotation.  Returns self.

See also:  rotateBy:



scale::
scale:(NXCoord)x :(NXCoord)y

Scales the View's coordinate system.  The length of units along its x and y axes will be equal to x and y in the View's current coordinate system.  Returns self.

See also:  setDrawSize::, translate::, rotate:



scrollPoint:
scrollPoint:(const NXPoint *)aPoint

Scrolls the View, which must be a ClipView's document view.  aPoint is given in the receiving View's coordinates.  After the scroll, aPoint will be coincident with the bounds rectangle origin of the ClipView, which is its lower left corner, or its upper left corner if the receiving View is flipped.  Returns self.

See also:  setDocView: (ClipView)



scrollRect:by:
scrollRect:(const NXRect *)aRect by:(const NXPoint *)delta

Scrolls the aRect rectangle, which is expressed in the View's drawing coordinates, by delta.  Only those bits which are visible before and after scrolling are moved.  This method works for all Views and does not require that the View's immediate ancestor be a ClipView or ScrollView.  Returns self.



scrollRectToVisible:
scrollRectToVisible:(const NXRect *)aRect

Scrolls aRect so that it becomes visible within the View's parent ClipView.  The receiving View must be a ClipView's document view.  This method will scroll the ClipView the minimum amount necessary to make aRect visible.  aRect is a rectangle in the receiving View's coordinates.  Returns self if scrolling actually occurs; otherwise returns nil.

See also:  setDocView: (ClipView)



setAutodisplay:
setAutodisplay:(BOOL)flag

Enables or disables automatic display of the View.  If flag is YES, subsequent messages to the View that would affect its appearance are automatically reflected on the screen.  If flag is NO, you must explicitly send a display message to reflect changes to the View.  By default, changes are automatically displayed.  If automatic display is disabled, the View will set a dirty flag which you can query with the needsDisplay method to determine whether you need to send the View a display message. Returns self.

See also:  isAutodisplay, needsDisplay, setNeedsDisplay:, display, update, displayIfNeeded



setAutoresizeSubviews:
setAutoresizeSubviews:(BOOL)flag

Determines whether the resizeSubviews: message will be sent to the View upon receipt of a sizeTo:: message.  By default, automatic resizing of subviews is disabled.  Returns self.

See also:  resizeSubviews:, sizeTo::, superviewSizeChanged:



setAutosizing:
setAutosizing:(unsigned int)mask

Determines how the receiving View's frame rectangle will change when its superview's size changes.  Create mask by ORing the following together:

Flag Meaning
NX_NOTSIZABLE The View does not resize with its superview.
NX_MINXMARGINSIZABLE The left margin between Views can stretch.
NX_WIDTHSIZABLE The View's width can stretch.
NX_MAXXMARGINSIZABLE The right margin between Views can stretch.
NX_MINYMARGINSIZABLE The top margin between Views can stretch.
NX_HEIGHTSIZABLE The View's height can stretch.
NX_MAXYMARGINSIZABLE The bottom margin between Views can stretch.

Returns self.

See also:  sizeTo::, resizeSubviews:, setAutoresizeSubviews:



setClipping:
setClipping:(BOOL)flag

Determines whether drawing is clipped to the View's frame rectangle.  Views are clipped by default.  When you know the View won't draw outside its frame, you can turn off clipping to reduce the amount of PostScript code sent to the Window Server.  You can also use this method to enable clipping in a View that inherits from a subclass that disables clipping.  You should send a setClipping: message to the View before it first draws, usually from the method that initializes the View.  Returns self.

See also:  lockFocus, drawInSuperview, initFrame:, doesClip



setDrawOrigin::
setDrawOrigin:(NXCoord)x :(NXCoord)y

Shifts the View's coordinate system so that (x, y) corresponds to the same point as the View's frame rectangle origin.  If the View's coordinates have been rotated or flipped, this won't necessarily coincide with its bounds rectangle origin.  Returns self.

See also:  translate::, setDrawSize::, setDrawRotation:



setDrawRotation:
setDrawRotation:(NXCoord)angle

Rotates the View's coordinate system around its frame rectangle origin so that angle defines the relationship between the View's frame rectangle and its drawing coordinates.  Returns self.

See also:  rotate:, setDrawOrigin::, setDrawSize::



setDrawSize::
setDrawSize:(NXCoord)width :(NXCoord)height

Scales the View's coordinate system so that width and height define the size of the View's frame rectangle in its own coordinates.  If the View's drawing coordinates have been rotated, the View's frame rectangle size won't necessarily be the same as its bounds rectangle size.  Returns self.

See also:  scale::, setDrawOrigin::, setDrawRotation:



setFlipped:
setFlipped:(BOOL)flag

Sets the direction of the View's y-axis.  If flag is YES, the View's origin will be its upper left corner, and coordinate values will increase towards the bottom of the View.  If flag is NO, the origin is the bottom left corner and values increase to the top; this is the default configuration for a View.

Although a View is positioned in its superview's coordinate system, no View will have a flipped coordinate system unless it receives a setFlipped:YES message of its own; it doesn't inherit flipped coordinates from its superview.

This method may also send a descendantFlipped: message to the receiving View's superview.  Returns self.

See also:  notifyWhenFlipped:, descendantFlipped:, initFrame:, isFlipped



setFrame:
setFrame:(const NXRect *)frameRect

Repositions and resizes the View within its superview's coordinate system by assigning it the frame rectangle specified by frameRect.  Returns self.

See also:  initFrame:, sizeTo::, moveTo::



setNeedsDisplay:
setNeedsDisplay:(BOOL)flag

This method sets a flag indicating whether the View needs to be displayed.  After the View changes its internal state in such a way that it's no longer accurately reflected on the screen, it should query itself with an isAutodisplay message.  If automatic display is enabled, the View should send a display message to itself.  If automatic display is disabled, the View should send a setNeedsDisplay:YES message to itself.  This message has no effect if automatic display is enabled.  Returns self.

See also:  update, setAutodisplay, isAutodisplay, needsDisplay:, display:::, displayIfNeeded



setOpaque:
setOpaque:(BOOL)flag

Registers whether the View is opaque.  If a View can guarantee that it will completely cover the area within its frame (with opaque paint), it should send itself a setOpaque:YES message (typically, as part of its initialization).  Opaque Views make drawing in the view hierarchy more efficient.  Returns self.

See also:  isOpaque, opaqueAncestor, displayFromOpaqueAncestor:::



shouldDelayWindowOrderingForEvent:
(BOOL)shouldDelayWindowOrderingForEvent:(NXEvent *)anEvent

Returns YES if the normal Window ordering and activation mechanism should be delayed until the next mouse-up event.  You never inovke this method directly; it's invoked automatically for each mouse-down that's directed at the View.  The default implementation returns NO.

A View subclass that contains draggable images should implement this to return YES (perhaps predicating the decision on the data in anEvent, the event record for the mouse-down itself).  This allows the user to click on a draggable image without bringing the View's Window to the front or making its application active.  Note that this method doesn't prevent this ordering and activation from occurring, it simply puts it off until the user releases the mouse.  To cause the ordering and activation to be skipped when the mouse is released, the View should send a preventWindowOrdering message to the Application object from within its implementation of mouseDown:.  The preventWindowOrdering message is sent automatically by View's dragImage:... method--in other words, ordering and activation is prevented if the user actually drags the clicked-on item.



shouldDrawColor
(BOOL)shouldDrawColor

Returns whether the View should be drawn using color.  If the View is being drawn to a window and the window can't store color, this method returns NO; otherwise it returns YES.



sizeBy::
sizeBy:(NXCoord)deltaWidth :(NXCoord)deltaHeight

Resizes the View by deltaWidth and deltaHeight in its superview's coordinates.  This method works by invoking the sizeTo:: method.  Returns self.

See also:  sizeTo::, moveBy::



sizeTo::
sizeTo:(NXCoord)width :(NXCoord)height

Resizes the View's frame rectangle to the specified width and height in its superview's coordinates.  It may also initiate a descendantFrameChanged: message to the View's superview.  Returns self.

See also:  setFrame:, moveTo::, sizeBy::, descendantFrameChanged:



spoolFile:
spoolFile:(const char *)filename

Spools the generated PostScript file to the printer.  This method is invoked by printPSCode: and faxPSCode:.  Returns self.



subviews
subviews

Returns the List object that contains the receiving View's subviews.  You can use this List to send messages to each View in the View hierarchy.  You never modify this List directly; use addSubview: and removeFromSuperview to add and remove Views from the View hierarchy.  If the View has no subviews (and never did), nil is returned.  If it had subviews that have all since been removed, an empty List is returned.

See also:  superview, addSubview:, removeFromSuperview



superview
superview

Returns the View's superview.  If the View hasn't a superview, nil is returned.  When applying this method recursively, you should check the return value against the content View of the View's Window to avoid flying off the top of the View hierarchy.

See also:  window, subviews, addSubview:, removeFromSuperview



superviewSizeChanged:
superviewSizeChanged:(const NXSize *)oldSize

Informs the View that its superview's size has changed.  This method is invoked when the View's superview has received a resizeSubviews: message.  This method will automatically resize the View according to the parameters set by the setAutosizing: message.  You may want to override this method to provide specific resizing behavior.  oldSize is the previous bounds rectangle size of the receiving View's superview.  Returns self.

See also:  resizeSubviews:, sizeTo::, setAutoresizeSubviews:



suspendNotifyAncestorWhenFrameChanged:
suspendNotifyAncestorWhenFrameChanged:(BOOL)flag

Temporarily disables or reenables the sending of descendantFrameChanged: messages to the View's superview when the View is sized or moved.  You must have previously sent the View a notifyAncestorWhenFrameChanged:YES message for this method to have any effect.  These messages do not nest.  Returns self.

See also:  descendantFrameChanged:, notifyAncestorWhenFrameChanged:, sizeTo::, moveTo::,



tag
(int)tag

Returns the View's tag, a integer that you can use to identify objects in your application.  By default, View returns (-1).  You can override this method to identify certain Views.  For example, your application could take special action when a View with a given tag receives a mouse event.

See also:  findViewWithTag:



translate::
translate:(NXCoord)x :(NXCoord)y

Translates the origin of the View's coordinate system to (x, y).  Returns self.

See also:  setDrawOrigin::, scale::, rotate:



unlockFocus
unlockFocus

Balances an earlier lockFocus message to the same View.  If the lockFocus method saved the previous graphics state, this method restores it.  Returns self.

See also:  lockFocus, display:::



unregisterDraggedTypes
unregisterDraggedTypes

Unregisters the View as a possible recipient of dragged-images.

See also:  registerForDraggedTypes:count:



update
update

Invokes the proper update behavior when the contents of the View have been changed in such a way that they are no longer accurately represented on the screen.  If automatic display is enabled, this method invokes display; otherwise this method sets a flag indicating that the View needs to be displayed.  Returns self.

See also:  setNeedsDisplay, isAutoDisplay, display, displayIfNeeded



widthAdjustLimit
(float)widthAdjustLimit

Returns the fraction (between 0.0 and 1.0) of the page that can be pushed onto the next page during automatic pagination to prevent items from being cut in half.  This limit applies to horizontal pagination.  This method is invoked by printPSCode: and faxPSCode:.  By default, this method returns 0.2.

See also:  adjustPageHeightNew:top:bottom:limit:



window
window

Returns the View's Window.

See also:  superview



windowChanged:
windowChanged:newWindow

Invoked when the Window the View is in changes (usually from nil to non-nil or vice versa).  This often happens due to a removeFromSuperview sent to the View (or some View higher up the hierarchy from it).  This method is especially important when the View is the first responder in the Window, in which case this method should be overridden to clean up any blinking carets or other first responder-dependent activity the View engages in.  Note that resignFirstResponder is NOT called when a View is removed from the View hierarchy (since the View does not have the opportunity to reject resignation of the first responder).  This method is invoked before the window instance variable has been changed to newWindow.  Returns self.



write:
write:(NXTypedStream *)stream

Writes the View and its subviews to the typed stream stream.  Returns self.



writePSCodeInside:to:
writePSCodeInside:(const NXRect *)aRect to:pasteboard

Copies the portions of the View and its subviews that fall inside aRect and places the copy on the given pasteboard.  Returns self.