Public Member Functions | |
(id) | - initWithContentRect:styleMask: [implementation] |
(id) | - initWithContentRect:styleMask:bridge: [implementation] |
(unsigned) | - styleMask [implementation] |
(CGRect) | - contentRectForFrameRect: [implementation] |
(CGRect) | - frameRectForContentRect: [implementation] |
(CGRect) | - frame [implementation] |
(void) | - setFrame:display:animate: [implementation] |
(void) | - setFrame: [implementation] |
(void) | - setFrameOrigin: [implementation] |
(void) | - setFrameSize: [implementation] |
(void) | - trackMoveWithEvent: [implementation] |
(void) | - trackResizeWithEvent: [implementation] |
(void) | - orderFront: [implementation] |
(void) | - orderBack: [implementation] |
(void) | - orderOut: [implementation] |
(void) | - orderWindow:relativeTo: [implementation] |
(void) | - setLevel: [implementation] |
(int) | - level [implementation] |
(BOOL) | - isVisible [implementation] |
(BOOL) | - showsResizeIndicator [implementation] |
(void) | - setShowsResizeIndicator: [implementation] |
(CGSize) | - resizeIndicatorOffset [implementation] |
(void) | - setResizeIndicatorOffset: [implementation] |
(void) | - setContentView: [implementation] |
(CPView) | - contentView [implementation] |
(void) | - setBackgroundColor: [implementation] |
(CPColor) | - backgroundColor [implementation] |
(void) | - setMinSize: [implementation] |
(CGSize) | - minSize [implementation] |
(void) | - setMaxSize: [implementation] |
(CGSize) | - maxSize [implementation] |
(BOOL) | - hasShadow [implementation] |
(void) | - setHasShadow: [implementation] |
(void) | - setDelegate: [implementation] |
(id) | - delegate [implementation] |
(void) | - setWindowController: [implementation] |
(CPWindowController) | - windowController [implementation] |
(void) | - doCommandBySelector: [implementation] |
(BOOL) | - acceptsFirstResponder [implementation] |
(void) | - makeFirstResponder: [implementation] |
(CPResponder) | - firstResponder [implementation] |
(BOOL) | - acceptsMouseMovedEvents [implementation] |
(void) | - setAcceptsMouseMovedEvents: [implementation] |
(CPString) | - title [implementation] |
(void) | - setTitle: [implementation] |
(void) | - setTitleWithRepresentedFilename: [implementation] |
(void) | - setRepresentedFilename: [implementation] |
(CPString) | - representedFilename [implementation] |
(void) | - setRepresentedURL: [implementation] |
(CPURL) | - representedURL [implementation] |
(void) | - setMovableByWindowBackground: [implementation] |
(BOOL) | - isMovableByWindowBackground [implementation] |
(void) | - center [implementation] |
(void) | - sendEvent: [implementation] |
(int) | - windowNumber [implementation] |
(void) | - becomeKeyWindow [implementation] |
(BOOL) | - canBecomeKeyWindow [implementation] |
(BOOL) | - isKeyWindow [implementation] |
(void) | - makeKeyAndOrderFront: [implementation] |
(void) | - makeKeyWindow [implementation] |
(void) | - resignKeyWindow [implementation] |
(void) | - dragImage:at:offset:event:pasteboard:source:slideBack: [implementation] |
(void) | - dragView:at:offset:event:pasteboard:source:slideBack: [implementation] |
(void) | - setDocumentEdited: [implementation] |
(BOOL) | - isDocumentEdited [implementation] |
(void) | - setDocumentSaving: [implementation] |
(BOOL) | - isDocumentSaving [implementation] |
(void) | - performClose: [implementation] |
(void) | - close [implementation] |
(BOOL) | - isMainWindow [implementation] |
(BOOL) | - canBecomeMainWindow [implementation] |
(void) | - makeMainWindow [implementation] |
(void) | - becomeMainWindow [implementation] |
(void) | - resignMainWindow [implementation] |
(CPToolbar) | - toolbar [implementation] |
(void) | - setToolbar: [implementation] |
(CPWindow) | - attachedSheet [implementation] |
(BOOL) | - isSheet [implementation] |
(BOOL) | - becomesKeyOnlyIfNeeded [implementation] |
(BOOL) | - worksWhenModal [implementation] |
(void) | - setBridge: [implementation] |
(void) | - resizeWithOldBridgeSize: [implementation] |
(void) | - setAutoresizingMask: [implementation] |
(unsigned) | - autoresizingMask [implementation] |
(CGPoint) | - convertBaseToBridge: [implementation] |
(CGPoint) | - convertBridgeToBase: [implementation] |
(CPUndoManager) | - undoManager [implementation] |
(void) | - undo: [implementation] |
(void) | - redo: [implementation] |
Static Public Member Functions | |
(void) | + initialize [implementation] |
(CGRect) | + frameRectForContentRect:styleMask: [implementation] |
Each window has a style, which determines how the window is decorated; whether it has a border, a title bar, a resize bar, minimise and close buttons.
A window has a frame. This is the frame of the entire window on the screen, including all decorations and borders. The origin of the frame represents its bottom left corner and the frame is expressed in screen coordinates.
A window always contains a content view which is the highest level view available for public (application) use. This view fills the area of the window inside any decoration/border. This is the only part of the window that application programmers are allowed to draw in directly.
You can convert between view coordinates and window base coordinates using the [CPView -convertPoint:fromView:], [CPView -convertPoint:toView:], [CPView -convertRect:fromView:], and [CPView -convertRect:toView:] methods with a nil view argument.
notification | contains information about the resize event |
window | the window for which to return the undo manager |
notification | contains information about the event |
notification | contains information about the event |
notification | contains information about the event |
window | the window to close |
YES
allows the window to close. NO
vetoes the close operation and leaves the window open. Definition at line 231 of file CPWindow.j.
- (BOOL) acceptsFirstResponder | [implementation] |
Definition at line 937 of file CPWindow.j.
- (BOOL) acceptsMouseMovedEvents | [implementation] |
Definition at line 977 of file CPWindow.j.
- (CPWindow) attachedSheet | [implementation] |
Returns the window's attached sheet.
Definition at line 1537 of file CPWindow.j.
- (unsigned) autoresizingMask | [implementation] |
Definition at line 1649 of file CPWindow.j.
- (CPColor) backgroundColor | [implementation] |
Returns the window's background color.
Definition at line 731 of file CPWindow.j.
- (void) becomeKeyWindow | [implementation] |
Called when the receiver should become the key window. It also sends the becomeKeyWindow
message to the first responder.
Definition at line 1167 of file CPWindow.j.
- (void) becomeMainWindow | [implementation] |
Called to tell the receiver that it has become the main window.
Definition at line 1402 of file CPWindow.j.
- (BOOL) becomesKeyOnlyIfNeeded | [implementation] |
Definition at line 1555 of file CPWindow.j.
- (BOOL) canBecomeKeyWindow | [implementation] |
Determines if the window can become the key window.
YES
means the window can become the key window. Definition at line 1177 of file CPWindow.j.
- (BOOL) canBecomeMainWindow | [implementation] |
Returns YES
if the window can become the main window.
Definition at line 1375 of file CPWindow.j.
- (void) center | [implementation] |
Sets the window location to be the center of the screen
Definition at line 1073 of file CPWindow.j.
- (void) close | [implementation] |
Closes the window. Posts a CPWindowWillCloseNotification
to the notification center before closing the window.
Definition at line 1356 of file CPWindow.j.
- (CGRect) contentRectForFrameRect: | (CGRect) | aFrame | [implementation] |
Returns the receiver's content rectangle. A content rectangle does not include toolbars.
aFrame | the window's frame rectangle |
Definition at line 419 of file CPWindow.j.
- (CPView) contentView | [implementation] |
Returns the window's current content view.
Definition at line 714 of file CPWindow.j.
- (CGPoint) convertBaseToBridge: | (CGPoint) | aPoint | [implementation] |
Definition at line 1657 of file CPWindow.j.
- (CGPoint) convertBridgeToBase: | (CGPoint) | aPoint | [implementation] |
Definition at line 1667 of file CPWindow.j.
- (id) delegate | [implementation] |
Returns window's delegate
Definition at line 907 of file CPWindow.j.
- (void) doCommandBySelector: | (SEL) | aSelector | [implementation] |
Definition at line 929 of file CPWindow.j.
- (void) dragImage: | (CPImage) | anImage | ||
at: | (CGPoint) | imageLocation | ||
offset: | (CGSize) | mouseOffset | ||
event: | (CPEvent) | anEvent | ||
pasteboard: | (CPPasteboard) | aPasteboard | ||
source: | (id) | aSourceObject | ||
slideBack: | (BOOL) | slideBack | ||
[implementation] |
Initiates a drag operation from the receiver to another view that accepts dragged data.
anImage | the image to be dragged | |
aLocation | the lower-left corner coordinate of anImage | |
mouseOffset | the distance from the mouseDown: location and the current location | |
anEvent | the mouseDown: that triggered the drag | |
aPastebaord | the pasteboard that holds the drag data | |
aSourceObject | the drag operation controller | |
slideBack | Whether the image should 'slide back' if the drag is rejected |
Definition at line 1239 of file CPWindow.j.
- (void) dragView: | (CPView) | aView | ||
at: | (CGPoint) | imageLocation | ||
offset: | (CGSize) | mouseOffset | ||
event: | (CPEvent) | anEvent | ||
pasteboard: | (CPPasteboard) | aPasteboard | ||
source: | (id) | aSourceObject | ||
slideBack: | (BOOL) | slideBack | ||
[implementation] |
Initiates a drag operation from the receiver to another view that accepts dragged data.
aView | the view to be dragged | |
aLocation | the lower-left corner coordinate of aView | |
mouseOffset | the distance from the mouseDown: location and the current location | |
anEvent | the mouseDown: that triggered the drag | |
aPastebaord | the pasteboard that holds the drag data | |
aSourceObject | the drag operation controller | |
slideBack | Whether the view should 'slide back' if the drag is rejected |
Definition at line 1254 of file CPWindow.j.
- (CPResponder) firstResponder | [implementation] |
Returns the window's current first responder.
Definition at line 972 of file CPWindow.j.
- (CGRect) frame | [implementation] |
Returns the window's frame rectangle
Definition at line 466 of file CPWindow.j.
- (CGRect) frameRectForContentRect: | (CGRect) | aContentRect | [implementation] |
Retrieves the frame rectangle for this window.
aContentRect | the window's content rectangle |
Definition at line 453 of file CPWindow.j.
+ (CGRect) frameRectForContentRect: | (CGRect) | aContentRect | ||
styleMask: | (unsigned) | aStyleMask | ||
[implementation] |
Returns the frame rectangle used by a window.
aContentRect | the content rectangle of the window | |
aStyleMask | the style mask of the window |
Definition at line 408 of file CPWindow.j.
- (BOOL) hasShadow | [implementation] |
Returns YES
if the window has a drop shadow. NO
otherwise.
Definition at line 818 of file CPWindow.j.
+ (void) initialize | [implementation] |
Definition at line 288 of file CPWindow.j.
- (id) initWithContentRect: | (CGRect) | aContentRect | ||
styleMask: | (unsigned int) | aStyleMask | ||
[implementation] |
Initializes the window. The method also takes a style bit mask made up of any of the following values:
CPBorderlessWindowMask CPTitledWindowMask CPClosableWindowMask CPMiniaturizableWindowMask CPResizableWindowMask CPTexturedBackgroundWindowMask
aContentRect | the size and location of the window in screen space | |
aStyleMask | a style mask |
Definition at line 315 of file CPWindow.j.
- (id) initWithContentRect: | (CGRect) | aContentRect | ||
styleMask: | (unsigned int) | aStyleMask | ||
bridge: | (CPDOMWindowBridge) | aBridge | ||
[implementation] |
Initializes the window. The method also takes a style bit mask made up of any of the following values:
CPBorderlessWindowMask CPTitledWindowMask CPClosableWindowMask CPMiniaturizableWindowMask CPResizableWindowMask CPTexturedBackgroundWindowMask
aContentRect | the size and location of the window in screen space | |
aStyleMask | a style mask | |
aBridge | a DOM-Window bridge object |
Definition at line 337 of file CPWindow.j.
- (BOOL) isDocumentEdited | [implementation] |
Returns YES
if the document has been edited.
Definition at line 1278 of file CPWindow.j.
- (BOOL) isDocumentSaving | [implementation] |
Definition at line 1295 of file CPWindow.j.
- (BOOL) isKeyWindow | [implementation] |
Returns YES
if the window is the key window.
Definition at line 1185 of file CPWindow.j.
- (BOOL) isMainWindow | [implementation] |
Returns YES
if this the main window.
Definition at line 1367 of file CPWindow.j.
- (BOOL) isMovableByWindowBackground | [implementation] |
Returns YES
if the window can be moved by dragging its background.
Definition at line 1065 of file CPWindow.j.
- (BOOL) isSheet | [implementation] |
Returns YES
if the window has ever run as a sheet.
Definition at line 1545 of file CPWindow.j.
- (BOOL) isVisible | [implementation] |
Returns YES
if the window is visible. It does not mean that the window is not obscured by other windows.
Definition at line 655 of file CPWindow.j.
- (int) level | [implementation] |
Returns the window's current level
Definition at line 647 of file CPWindow.j.
- (void) makeFirstResponder: | (CPResponder) | aResponder | [implementation] |
Attempts to make the aResponder
the first responder. Before trying to make it the first responder, the receiver will ask the current first responder to resign its first responder status. If it resigns, it will ask aResponder
accept first responder, then finally tell it to become first responder.
YES
if the attempt was successful. NO
otherwise. Definition at line 949 of file CPWindow.j.
- (void) makeKeyAndOrderFront: | (id) | aSender | [implementation] |
Makes the window the key window and brings it to the front of the screen list.
aSender | the object requesting this |
Definition at line 1194 of file CPWindow.j.
- (void) makeKeyWindow | [implementation] |
Makes this window the key window.
Definition at line 1205 of file CPWindow.j.
- (void) makeMainWindow | [implementation] |
Makes the receiver the main window.
Definition at line 1387 of file CPWindow.j.
- (CGSize) maxSize | [implementation] |
Returns the window's maximum size.
Definition at line 810 of file CPWindow.j.
- (CGSize) minSize | [implementation] |
Returns the windows minimum size.
Definition at line 770 of file CPWindow.j.
- (void) orderBack: | (id) | aSender | [implementation] |
Definition at line 601 of file CPWindow.j.
- (void) orderFront: | (id) | aSender | [implementation] |
Makes the receiver the front most window in the screen ordering.
aSender | the object that requested this |
Definition at line 591 of file CPWindow.j.
- (void) orderOut: | (id) | aSender | [implementation] |
Hides the window.
the | object that requested this |
Definition at line 610 of file CPWindow.j.
- (void) orderWindow: | (CPWindowOrderingMode) | aPlace | ||
relativeTo: | (int) | otherWindowNumber | ||
[implementation] |
Relocates the window in the screen list.
aPlace | the positioning relative to otherWindowNumber | |
otherWindowNumber | the window relative to which the receiver should be placed |
Definition at line 630 of file CPWindow.j.
- (void) performClose: | (id) | aSender | [implementation] |
Simulates the user closing the window, then closes the window.
aSender | the object making this request |
Definition at line 1336 of file CPWindow.j.
- (void) redo: | (id) | aSender | [implementation] |
Sends the undo manager a redo:
message.
aSender | the object requesting this |
Definition at line 1702 of file CPWindow.j.
- (CPString) representedFilename | [implementation] |
Returns the path to the file the receiver represents
Definition at line 1030 of file CPWindow.j.
- (CPURL) representedURL | [implementation] |
Returns the URL that the receiver represents
Definition at line 1046 of file CPWindow.j.
- (void) resignKeyWindow | [implementation] |
Causes the window to resign it's key window status.
Definition at line 1220 of file CPWindow.j.
- (void) resignMainWindow | [implementation] |
Called when the window resigns main window status.
Definition at line 1415 of file CPWindow.j.
- (CGSize) resizeIndicatorOffset | [implementation] |
Returns the offset of the window's resize indicator.
Definition at line 680 of file CPWindow.j.
- (void) resizeWithOldBridgeSize: | (CGSize) | aSize | [implementation] |
Definition at line 1610 of file CPWindow.j.
- (void) sendEvent: | (CPEvent) | anEvent | [implementation] |
Dispatches events that are sent to it from CPApplication.
anEvent | the event to be dispatched |
Definition at line 1085 of file CPWindow.j.
- (void) setAcceptsMouseMovedEvents: | (BOOL) | shouldAcceptMouseMovedEvents | [implementation] |
Definition at line 982 of file CPWindow.j.
- (void) setAutoresizingMask: | (unsigned) | anAutoresizingMask | [implementation] |
Definition at line 1641 of file CPWindow.j.
- (void) setBackgroundColor: | (CPColor) | aColor | [implementation] |
Sets the window's background color.
aColor | the new color for the background |
Definition at line 723 of file CPWindow.j.
- (void) setBridge: | (CPDOMWindowBridge) | aBridge | [implementation] |
Definition at line 1590 of file CPWindow.j.
- (void) setContentView: | (CPView) | aView | [implementation] |
Sets the window's content view. The new view will be resized to fit inside the content rectangle of the window.
aView | the new content view for the receiver |
Definition at line 699 of file CPWindow.j.
- (void) setDelegate: | (id) | aDelegate | [implementation] |
Sets the delegate for the window. Passing nil
will just remove the window's current delegate.
aDelegate | an object to respond to the various delegate methods of CPWindow |
Definition at line 881 of file CPWindow.j.
- (void) setDocumentEdited: | (BOOL) | isDocumentEdited | [implementation] |
Sets whether the document has been edited.
isDocumentEdited | YES if the document has been edited. |
Definition at line 1265 of file CPWindow.j.
- (void) setDocumentSaving: | (BOOL) | isDocumentSaving | [implementation] |
Definition at line 1283 of file CPWindow.j.
- (void) setFrame: | (CGRect) | aFrame | [implementation] |
Sets the window's frame rectangle
Definition at line 496 of file CPWindow.j.
- (void) setFrame: | (CGRect) | aFrame | ||
display: | (BOOL) | shouldDisplay | ||
animate: | (BOOL) | shouldAnimate | ||
[implementation] |
Sets the window's frame rectangle. Also tells the window whether it should animate the resize operation, and redraw itself if necessary.
aFrame | the new size and location for the window | |
shouldDisplay | whether the window should redraw its views | |
shouldAnimate | whether the window resize should be animated |
Definition at line 478 of file CPWindow.j.
- (void) setFrameOrigin: | (CGPoint) | anOrigin | [implementation] |
Sets the window's location.
anOrigin | the new location for the window |
Definition at line 505 of file CPWindow.j.
- (void) setFrameSize: | (CGSize) | aSize | [implementation] |
Sets the window's size.
aSize | the new size for the window |
Definition at line 524 of file CPWindow.j.
- (void) setHasShadow: | (BOOL) | shouldHaveShadow | [implementation] |
Sets whether the window should have a drop shadow.
shouldHaveShadow | YES to have a drop shadow. |
Definition at line 827 of file CPWindow.j.
- (void) setLevel: | (int) | aLevel | [implementation] |
Sets the window's level
the | window's new level |
Definition at line 639 of file CPWindow.j.
- (void) setMaxSize: | (CGSize) | aSize | [implementation] |
Sets the window's maximum size. If the provided size is the same as the current maximum size, the method simply returns.
aSize | the new maximum size |
Definition at line 781 of file CPWindow.j.
- (void) setMinSize: | (CGSize) | aSize | [implementation] |
Sets the window's minimum size. If the provided size is the same as the current minimum size, the method simply returns. the new minimum size for the window
Definition at line 741 of file CPWindow.j.
- (void) setMovableByWindowBackground: | (BOOL) | shouldBeMovableByWindowBackground | [implementation] |
Sets whether the window can be moved by dragging its background. The default is based on the window style.
shouldBeMovableByWindowBackground | YES makes the window move from a background drag. |
Definition at line 1057 of file CPWindow.j.
- (void) setRepresentedFilename: | (CPString) | aFilePath | [implementation] |
Sets the path to the file the receiver represents
Definition at line 1021 of file CPWindow.j.
- (void) setRepresentedURL: | (CPURL) | aURL | [implementation] |
Sets the URL that the receiver represents
Definition at line 1038 of file CPWindow.j.
- (void) setResizeIndicatorOffset: | (CGSize) | anOffset | [implementation] |
Sets the offset of the window's resize indicator.
aSize | the offset for the resize indicator |
Definition at line 689 of file CPWindow.j.
- (void) setShowsResizeIndicator: | (BOOL) | shouldShowResizeIndicator | [implementation] |
Sets the window's resize indicator.
shouldShowResizeIndicator | YES sets the window to show its resize indicator. |
Definition at line 672 of file CPWindow.j.
- (void) setTitle: | (CPString) | aTitle | [implementation] |
Sets the window's title bar string
Definition at line 1000 of file CPWindow.j.
- (void) setTitleWithRepresentedFilename: | (CPString) | aFilePath | [implementation] |
Sets the title bar to represent a file path
Definition at line 1012 of file CPWindow.j.
- (void) setToolbar: | (CPToolbar) | aToolbar | [implementation] |
Sets the window's toolbar.
aToolbar | the window's new toolbar |
Definition at line 1435 of file CPWindow.j.
- (void) setWindowController: | (CPWindowController) | aWindowController | [implementation] |
Sets the window's controller
aWindowController | a window controller |
Definition at line 916 of file CPWindow.j.
- (BOOL) showsResizeIndicator | [implementation] |
Returns YES
if the window's resize indicator is showing. NO
otherwise.
Definition at line 663 of file CPWindow.j.
- (unsigned) styleMask | [implementation] |
Returns the window's style mask.
Definition at line 397 of file CPWindow.j.
- (CPString) title | [implementation] |
Returns the window's title bar string
Definition at line 992 of file CPWindow.j.
- (CPToolbar) toolbar | [implementation] |
Return's the window's toolbar
Definition at line 1426 of file CPWindow.j.
- (void) trackMoveWithEvent: | (CPEvent) | anEvent | [implementation] |
Definition at line 545 of file CPWindow.j.
- (void) trackResizeWithEvent: | (CPEvent) | anEvent | [implementation] |
Definition at line 570 of file CPWindow.j.
- (void) undo: | (id) | aSender | [implementation] |
Sends the undo manager an undo
message.
aSender | the object requesting this |
Definition at line 1693 of file CPWindow.j.
- (CPUndoManager) undoManager | [implementation] |
Returns the window's undo manager.
Definition at line 1678 of file CPWindow.j.
- (CPWindowController) windowController | [implementation] |
Returns the window's controller.
Definition at line 924 of file CPWindow.j.
- (int) windowNumber | [implementation] |
Returns the window's number in the desktop's screen list
Definition at line 1158 of file CPWindow.j.
- (BOOL) worksWhenModal | [implementation] |
Returns YES
if the receiver is able to receive input events even when a modal session is active.
Definition at line 1564 of file CPWindow.j.