API  1.0.0
CPWindow Class Reference

#import <CPWindow.h>

+ Inheritance diagram for CPWindow:

Instance Methods

(BOOL) - acceptsFirstResponder
 
(BOOL) - acceptsMouseMovedEvents
 
(void) - addChildWindow:ordered:
 
(float) - alphaValue
 
(void) - animationDidEnd:
 
(CPTimeInterval) - animationResizeTime:
 
(CPWindow- attachedSheet
 
(BOOL) - autorecalculatesKeyViewLoop
 
(unsigned) - autoresizingMask
 
(void) - awakeFromCib
 
(CPColor- backgroundColor
 
(void) - becomeKeyWindow
 
(void) - becomeMainWindow
 
(BOOL) - becomesKeyOnlyIfNeeded
 
(BOOL) - canBecomeKeyWindow
 
(BOOL) - canBecomeMainWindow
 
(void) - center
 
(CPArray) - childWindows
 
(void) - close
 
(BOOL) - containsPoint:
 
(CGRect) - contentRectForFrameRect:
 
(CPView- contentView
 
(CGPoint) - convertBaseToBridge:
 
(CGPoint) - convertBaseToGlobal:
 
(CGPoint) - convertBaseToPlatformWindow:
 
(CGPoint) - convertBaseToScreen:
 
(CGPoint) - convertBridgeToBase:
 
(CGPoint) - convertGlobalToBase:
 
(CGPoint) - convertPlatformWindowToBase:
 
(CGPoint) - convertScreenToBase:
 
(CPButton- defaultButton
 
(CPButton- defaultButtonCell
 
(id) - delegate
 
(void) - deminiaturize:
 
(void) - disableKeyEquivalentForDefaultButton
 
(void) - disableKeyEquivalentForDefaultButtonCell
 
(void) - doCommandBySelector:
 
(void) - dragImage:at:offset:event:pasteboard:source:slideBack:
 
(void) - dragView:at:offset:event:pasteboard:source:slideBack:
 
(void) - enableKeyEquivalentForDefaultButton
 
(void) - enableKeyEquivalentForDefaultButtonCell
 
(CPResponder- firstResponder
 
(CGRect) - frame
 
(CGRect) - frameRectForContentRect:
 
(BOOL) - hasShadow
 
(BOOL) - ignoresMouseEvents
 
(id) - init
 
(CPView- initialFirstResponder
 
(id) - initWithContentRect:styleMask:
 
(BOOL) - isDocumentEdited
 
(BOOL) - isDocumentSaving
 
(BOOL) - isFullBridge
 
(BOOL) - isFullPlatformWindow
 
(BOOL) - isKeyWindow
 
(BOOL) - isMainWindow
 
(void) - isMiniaturized
 
(void) - isMovable
 
(BOOL) - isMovableByWindowBackground
 
(BOOL) - isSheet
 
(BOOL) - isVisible
 
(void) - keyDown:
 
(int) - level
 
(BOOL) - makeFirstResponder:
 
(void) - makeKeyAndOrderFront:
 
(void) - makeKeyWindow
 
(void) - makeMainWindow
 
(CGSize) - maxSize
 
(void) - miniaturize:
 
(CGSize) - minSize
 
(void) - orderBack:
 
(void) - orderFront:
 
(void) - orderOut:
 
(void) - orderWindow:relativeTo:
 
(CPWindow- parentWindow
 
(void) - performClose:
 
(BOOL) - performKeyEquivalent:
 
(void) - performMiniaturize:
 
(CPPlatformWindow- platformWindow
 
(void) - recalculateKeyViewLoop
 
(void) - redo:
 
(CPArray) - registeredDraggedTypes
 
(void) - registerForDraggedTypes:
 
(void) - removeChildWindow:
 
(CPString- representedFilename
 
(CPURL- representedURL
 
(void) - resignKeyWindow
 
(void) - resignMainWindow
 
(CGSize) - resizeIndicatorOffset
 
(void) - resizeWithOldPlatformWindowSize:
 
(CPScreen- screen
 
(void) - selectKeyViewFollowingView:
 
(void) - selectKeyViewPrecedingView:
 
(void) - selectNextKeyView:
 
(void) - selectPreviousKeyView:
 
(void) - sendEvent:
 
(void) - setAcceptsMouseMovedEvents:
 
(void) - setAlphaValue:
 
(void) - setAutorecalculatesKeyViewLoop:
 
(void) - setAutoresizingMask:
 
(void) - setBackgroundColor:
 
(void) - setContentView:
 
(void) - setDefaultButton:
 
(void) - setDefaultButtonCell:
 
(void) - setDelegate:
 
(void) - setDocumentEdited:
 
(void) - setDocumentSaving:
 
(void) - setFrame:
 
(void) - setFrame:display:
 
(void) - setFrame:display:animate:
 
(void) - setFrameOrigin:
 
(void) - setFrameSize:
 
(void) - setFullBridge:
 
(void) - setFullPlatformWindow:
 
(void) - setHasShadow:
 
(void) - setIgnoresMouseEvents:
 
(void) - setInitialFirstResponder:
 
(void) - setLevel:
 
(void) - setMaxSize:
 
(void) - setMinSize:
 
(void) - setMovable:
 
(void) - setMovableByWindowBackground:
 
(CPWindow- setParentWindow:
 
(void) - setPlatformWindow:
 
(void) - setRepresentedFilename:
 
(void) - setRepresentedURL:
 
(void) - setResizeIndicatorOffset:
 
(void) - setShadowStyle:
 
(void) - setShowsResizeIndicator:
 
(void) - setTitle:
 
(void) - setTitleWithRepresentedFilename:
 
(void) - setToolbar:
 
(void) - setValue:forKey:
 
(void) - setWindowController:
 
(BOOL) - showsResizeIndicator
 
(unsigned) - styleMask
 
(CPString- title
 
(void) - toggleToolbarShown:
 
(CPToolbar- toolbar
 
(void) - undo:
 
(CPUndoManager- undoManager
 
(void) - unregisterDraggedTypes
 
(CPWindowController- windowController
 
(int) - windowNumber
 
(BOOL) - worksWhenModal
 
- Instance Methods inherited from CPResponder
(BOOL) - becomeFirstResponder
 
(void) - cursorUpdate:
 
(void) - encodeWithCoder:
 
(void) - flagsChanged:
 
(id) - initWithCoder:
 
(void) - insertBackTab:
 
(void) - insertLineBreak:
 
(void) - insertNewline:
 
(void) - insertTab:
 
(void) - insertText:
 
(void) - interpretKeyEvents:
 
(void) - keyUp:
 
(CPMenu- menu
 
(void) - mouseDown:
 
(void) - mouseDragged:
 
(void) - mouseEntered:
 
(void) - mouseExited:
 
(void) - mouseMoved:
 
(void) - mouseUp:
 
(CPResponder- nextResponder
 
(void) - noResponderFor:
 
(BOOL) - resignFirstResponder
 
(void) - rightMouseDown:
 
(void) - rightMouseUp:
 
(void) - scrollWheel:
 
(void) - setMenu:
 
(void) - setNextResponder:
 
(BOOL) - tryToPerform:with:
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray) - exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(BOOL) + constrainWindowsToUsableScreen
 
(CGRect) + frameRectForContentRect:styleMask:
 
(int) + globalResizeStyle
 
(void) + setConstrainWindowsToUsableScreen:
 
(void) + setGlobalResizeStyle:
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(void) + cancelPreviousPerformRequestsWithTarget:
 
(void) + cancelPreviousPerformRequestsWithTarget:selector:object:
 
(Class) + class
 
(BOOL) + conformsToProtocol:
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesImplementSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isBindingExclusive:
 
(BOOL) + isSubclassOfClass:
 
(CPSet) + keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + object:performSelector:withObject:afterDelay:inModes:
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Detailed Description

An CPWindow instance represents a window, panel or menu on the screen.

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.

Delegate Methods

-(void)windowDidResize:(CPNotification)notification; Sent from the notification center when the window has been resized.

Parameters
notificationcontains information about the resize event

-(CPUndoManager)windowWillReturnUndoManager:(CPWindow)aWindow; Called to obtain the undo manager for a window

Parameters
aWindowthe window for which to return the undo manager
Returns
the window's undo manager

-(void)windowDidBecomeMain:(CPNotification)notification; Sent from the notification center when the delegate's window becomes the main window.

Parameters
notificationcontains information about the event

-(void)windowDidResignMain:(CPNotification)notification; Sent from the notification center when the delegate's window has resigned main window status.

Parameters
notificationcontains information about the event

-(void)windowDidResignKey:(CPNotification)notification; Sent from the notification center when the delegate's window has resigned key window status.

Parameters
notificationcontains information about the event

-(BOOL)windowShouldClose:(id)aWindow; Called when the user tries to close the window.

Parameters
aWindowthe window to close
Returns
YES allows the window to close. NO vetoes the close operation and leaves the window open.

-(BOOL)windowWillBeginSheet:(CPNotification)notification; Sent from the notification center before sheet is visible on the delegate's window.

Parameters
notificationcontains information about the event

-(BOOL)windowDidEndSheet:(CPNotification)notification; Sent from the notification center when an attached sheet on the delegate's window has been animated out and is no longer visible.

Parameters
notificationcontains information about the event

Definition at line 2 of file CPWindow.h.

Method Documentation

◆ acceptsFirstResponder()

- (BOOL) acceptsFirstResponder
implementation

Returns YES if the receiver is able to become the first responder. NO otherwise.

Reimplemented from CPResponder.

Definition at line 1582 of file CPWindow.j.

◆ acceptsMouseMovedEvents()

- (BOOL) acceptsMouseMovedEvents
implementation

Definition at line 1662 of file CPWindow.j.

◆ addChildWindow:ordered:()

- (void) addChildWindow: (CPWindow childWindow
ordered: (CPWindowOrderingMode)  orderingMode 
implementation

Definition at line 2700 of file CPWindow.j.

◆ alphaValue()

- (float) alphaValue
implementation

Returns the alpha value of the window.

Definition at line 1243 of file CPWindow.j.

◆ animationDidEnd:()

- (void) animationDidEnd: (id)  anim
implementation

Definition at line 2941 of file CPWindow.j.

◆ animationResizeTime:()

- (CPTimeInterval) animationResizeTime: (CGRect)  newWindowFrame
implementation

Definition at line 2767 of file CPWindow.j.

◆ attachedSheet()

- (CPWindow) attachedSheet
implementation

Returns the window's attached sheet.

Definition at line 3086 of file CPWindow.j.

◆ autorecalculatesKeyViewLoop()

- (BOOL) autorecalculatesKeyViewLoop
implementation

Definition at line 3270 of file CPWindow.j.

◆ autoresizingMask()

- (unsigned) autoresizingMask
implementation

Provided by category CPWindow(BridgeSupport).

Definition at line 3595 of file CPWindow.j.

◆ awakeFromCib()

- (void) awakeFromCib
implementation

Reimplemented from CPObject.

Definition at line 440 of file CPWindow.j.

◆ backgroundColor()

- (CPColor) backgroundColor
implementation

Returns the window's background color.

Definition at line 1260 of file CPWindow.j.

◆ becomeKeyWindow()

- (void) becomeKeyWindow
implementation

Called when the receiver should become the key window. It sends the -becomeKeyWindow message to the first responder if it responds, and posts CPWindowDidBecomeKeyNotification.

Definition at line 2034 of file CPWindow.j.

◆ becomeMainWindow()

- (void) becomeMainWindow
implementation

Called to tell the receiver that it has become the main window.

Definition at line 2525 of file CPWindow.j.

◆ becomesKeyOnlyIfNeeded()

- (BOOL) becomesKeyOnlyIfNeeded
implementation

Reimplemented in CPPanel.

Definition at line 3107 of file CPWindow.j.

◆ canBecomeKeyWindow()

- (BOOL) canBecomeKeyWindow
implementation

Determines if the window can become the key window.

Returns
YES means the window can become the key window.

Reimplemented in CPPanel.

Definition at line 2065 of file CPWindow.j.

◆ canBecomeMainWindow()

- (BOOL) canBecomeMainWindow
implementation

Returns YES if the window can become the main window.

Reimplemented in CPPanel.

Definition at line 2493 of file CPWindow.j.

◆ center()

- (void) center
implementation

Sets the window location to be the center of the screen

Definition at line 1794 of file CPWindow.j.

◆ childWindows()

- (CPArray) childWindows
implementation

Do NOT modify the array returned by this method!

Definition at line 2695 of file CPWindow.j.

◆ close()

- (void) close
implementation

Closes the window. Posts a CPWindowWillCloseNotification to the notification center before closing the window.

Definition at line 2446 of file CPWindow.j.

◆ constrainWindowsToUsableScreen()

+ (BOOL) constrainWindowsToUsableScreen
implementation

Return whether platform window (virtual screen) resizes constrain user windows to the usable area.

Definition at line 1139 of file CPWindow.j.

◆ containsPoint:()

- (BOOL) containsPoint: (CGPoint)  aPoint
implementation

Provided by category CPWindow(BridgeSupport).

Definition at line 3729 of file CPWindow.j.

◆ contentRectForFrameRect:()

- (CGRect) contentRectForFrameRect: (CGRect)  aFrame
implementation

Returns the receiver's content rectangle. A content rectangle does not include toolbars.

Parameters
aFramethe window's frame rectangle

Definition at line 651 of file CPWindow.j.

◆ contentView()

- (CPView) contentView
implementation

Returns the window's current content view.

Definition at line 1226 of file CPWindow.j.

◆ convertBaseToBridge:()

- (CGPoint) convertBaseToBridge: (CGPoint)  aPoint
implementation

Provided by category CPWindow(Deprecated).

Definition at line 3770 of file CPWindow.j.

◆ convertBaseToGlobal:()

- (CGPoint) convertBaseToGlobal: (CGPoint)  aPoint
implementation

Converts aPoint from the window coordinate system to the global coordinate system.

Provided by category CPWindow(BridgeSupport).

Definition at line 3603 of file CPWindow.j.

◆ convertBaseToPlatformWindow:()

- (CGPoint) convertBaseToPlatformWindow: (CGPoint)  aPoint
implementation

Converts aPoint from the window coordinate system to the coordinate system of the parent platform window.

Provided by category CPWindow(BridgeSupport).

Definition at line 3633 of file CPWindow.j.

◆ convertBaseToScreen:()

- (CGPoint) convertBaseToScreen: (CGPoint)  aPoint
implementation

Provided by category CPWindow(BridgeSupport).

Definition at line 3663 of file CPWindow.j.

◆ convertBridgeToBase:()

- (CGPoint) convertBridgeToBase: (CGPoint)  aPoint
implementation

Provided by category CPWindow(Deprecated).

Definition at line 3778 of file CPWindow.j.

◆ convertGlobalToBase:()

- (CGPoint) convertGlobalToBase: (CGPoint)  aPoint
implementation

Converts aPoint from the global coordinate system to the window coordinate system.

Provided by category CPWindow(BridgeSupport).

Definition at line 3625 of file CPWindow.j.

◆ convertPlatformWindowToBase:()

- (CGPoint) convertPlatformWindowToBase: (CGPoint)  aPoint
implementation

Converts aPoint from the parent platform window coordinate system to the window's coordinate system.

Provided by category CPWindow(BridgeSupport).

Definition at line 3647 of file CPWindow.j.

◆ convertScreenToBase:()

- (CGPoint) convertScreenToBase: (CGPoint)  aPoint
implementation

Provided by category CPWindow(BridgeSupport).

Definition at line 3658 of file CPWindow.j.

◆ defaultButton()

- (CPButton) defaultButton
implementation

Returns the default button of the receiver.

Definition at line 3383 of file CPWindow.j.

◆ defaultButtonCell()

- (CPButton) defaultButtonCell
implementation

Returns the default button of the receiver. NOTE: This method is deprecated. Use defaultButton instead.

Definition at line 3355 of file CPWindow.j.

◆ delegate()

- (id) delegate
implementation

Returns window's delegate

Definition at line 1552 of file CPWindow.j.

◆ deminiaturize:()

- (void) deminiaturize: (id)  sender
implementation

Restores a minimized window to it's original size.

Definition at line 2349 of file CPWindow.j.

◆ disableKeyEquivalentForDefaultButton()

- (void) disableKeyEquivalentForDefaultButton
implementation

Removes the key equivalent for the default button.

Definition at line 3408 of file CPWindow.j.

◆ disableKeyEquivalentForDefaultButtonCell()

- (void) disableKeyEquivalentForDefaultButtonCell
implementation

Removes the key equivalent for the default button. Note: this method is deprecated. Use disableKeyEquivalentForDefaultButton instead.

Definition at line 3422 of file CPWindow.j.

◆ doCommandBySelector:()

- (void) doCommandBySelector: (SEL)  aSelector
implementation

The receiver will attempt to perform the command, if it responds to it. If not, the -nextResponder will be called to do it.

Parameters
aSelectorthe command to attempt

Reimplemented from CPResponder.

Definition at line 1574 of file CPWindow.j.

◆ dragImage:at:offset:event:pasteboard:source:slideBack:()

- (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.

Parameters
anImagethe image to be dragged
aLocationthe lower-left corner coordinate of anImage
mouseOffsetthe distance from the -mouseDown: location and the current location
anEventthe -mouseDown: that triggered the drag
aPasteboardthe pasteboard that holds the drag data
aSourceObjectthe drag operation controller
slideBackWhether the image should 'slide back' if the drag is rejected

Definition at line 2163 of file CPWindow.j.

◆ dragView:at:offset:event:pasteboard:source:slideBack:()

- (void) dragView: (CPView aView
at: (CGPoint)  viewLocation
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.

Parameters
aViewthe view to be dragged
aLocationthe lower-left corner coordinate of aView
mouseOffsetthe distance from the -mouseDown: location and the current location
anEventthe -mouseDown: that triggered the drag
aPasteboardthe pasteboard that holds the drag data
aSourceObjectthe drag operation controller
slideBackWhether the view should 'slide back' if the drag is rejected

Definition at line 2200 of file CPWindow.j.

◆ enableKeyEquivalentForDefaultButton()

- (void) enableKeyEquivalentForDefaultButton
implementation

Sets the default button key equivalent to "return".

Definition at line 3391 of file CPWindow.j.

◆ enableKeyEquivalentForDefaultButtonCell()

- (void) enableKeyEquivalentForDefaultButtonCell
implementation

Sets the default button key equivalent to "return". NOTE: this method is deprecated. Use enableKeyEquivalentForDefaultButton instead.

Definition at line 3400 of file CPWindow.j.

◆ firstResponder()

- (CPResponder) firstResponder
implementation

Returns the window's current first responder.

Definition at line 1657 of file CPWindow.j.

◆ frame()

- (CGRect) frame
implementation

Returns the window's frame rectangle

Definition at line 669 of file CPWindow.j.

◆ frameRectForContentRect:()

- (CGRect) frameRectForContentRect: (CGRect)  aContentRect
implementation

Retrieves the frame rectangle for this window.

Parameters
aContentRectthe window's content rectangle
Returns
the window's frame rectangle

Definition at line 661 of file CPWindow.j.

◆ frameRectForContentRect:styleMask:()

+ (CGRect) frameRectForContentRect: (CGRect)  aContentRect
styleMask: (unsigned)  aStyleMask 
implementation

Returns the frame rectangle used by a window. Style masks include:

CPBorderlessWindowMask
CPTitledWindowMask
CPClosableWindowMask
CPResizableWindowMask
CPTexturedBackgroundWindowMask
CPBorderlessBridgeWindowMask
CPHUDBackgroundWindowMask
Parameters
aContentRectthe content rectangle of the window
aStyleMaskthe style mask of the window
Returns
the matching window's frame rectangle

Definition at line 642 of file CPWindow.j.

◆ globalResizeStyle()

+ (int) globalResizeStyle
implementation

Returns the global window resizing style.

Definition at line 1152 of file CPWindow.j.

◆ hasShadow()

- (BOOL) hasShadow
implementation

Returns YES if the window has a drop shadow. NO otherwise.

Definition at line 1358 of file CPWindow.j.

◆ ignoresMouseEvents()

- (BOOL) ignoresMouseEvents
implementation

Definition at line 1672 of file CPWindow.j.

◆ init()

- (id) init
implementation

Initializes the receiver

Returns
the initialized receiver

Reimplemented from CPObject.

Reimplemented in CPColorPanel, CPFontPanel, and CPSavePanel.

Definition at line 245 of file CPWindow.j.

◆ initialFirstResponder()

- (CPView) initialFirstResponder
implementation

Definition at line 1587 of file CPWindow.j.

◆ initWithContentRect:styleMask:()

- (id) initWithContentRect: (CGRect)  aContentRect
styleMask: (unsigned)  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
Parameters
aContentRectthe size and location of the window in screen space
aStyleMaska style mask
Returns
the initialized window

Definition at line 265 of file CPWindow.j.

◆ isDocumentEdited()

- (BOOL) isDocumentEdited
implementation

Returns YES if the document has been edited.

Definition at line 2265 of file CPWindow.j.

◆ isDocumentSaving()

- (BOOL) isDocumentSaving
implementation

Definition at line 2282 of file CPWindow.j.

◆ isFullBridge()

- (BOOL) isFullBridge
implementation

Returns YES if the window fills the full browser window, otherwise NO. NOTE: this method has been deprecated in favor of isFullPlatformWindow.

Provided by category CPWindow(Deprecated).

Definition at line 3762 of file CPWindow.j.

◆ isFullPlatformWindow()

- (BOOL) isFullPlatformWindow
implementation
Returns
BOOL - YES if the CPWindow fills the browser window, otherwise NO.

Definition at line 612 of file CPWindow.j.

◆ isKeyWindow()

- (BOOL) isKeyWindow
implementation

Returns YES if the window is the key window.

Definition at line 2104 of file CPWindow.j.

◆ isMainWindow()

- (BOOL) isMainWindow
implementation

Returns YES if this the main window.

Definition at line 2485 of file CPWindow.j.

◆ isMiniaturized()

- (void) isMiniaturized
implementation

Returns YES if the window is minimized.

Definition at line 2361 of file CPWindow.j.

◆ isMovable()

- (void) isMovable
implementation

Returns YES if the window can be moved.

Definition at line 1786 of file CPWindow.j.

◆ isMovableByWindowBackground()

- (BOOL) isMovableByWindowBackground
implementation

Returns YES if the window can be moved by dragging its background.

Definition at line 1769 of file CPWindow.j.

◆ isSheet()

- (BOOL) isSheet
implementation

Returns YES if the window has ever run as a sheet.

Definition at line 3097 of file CPWindow.j.

◆ isVisible()

- (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 1108 of file CPWindow.j.

◆ keyDown:()

- (void) keyDown: (CPEvent anEvent
implementation

Notifies the receiver that the user has pressed a key.

Parameters
anEventinformation about the key press

Reimplemented from CPResponder.

Definition at line 3128 of file CPWindow.j.

◆ level()

- (int) level
implementation

Returns the window's current level

Definition at line 1100 of file CPWindow.j.

◆ makeFirstResponder:()

- (BOOL) 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.

Returns
YES if the attempt was successful. NO otherwise.

Definition at line 1632 of file CPWindow.j.

◆ makeKeyAndOrderFront:()

- (void) makeKeyAndOrderFront: (id)  aSender
implementation

Makes the window the key window and brings it to the front of the screen list.

Parameters
aSenderthe object requesting this

Definition at line 2113 of file CPWindow.j.

◆ makeKeyWindow()

- (void) makeKeyWindow
implementation

Makes this window the key window.

Definition at line 2124 of file CPWindow.j.

◆ makeMainWindow()

- (void) makeMainWindow
implementation

Makes the receiver the main window.

Definition at line 2506 of file CPWindow.j.

◆ maxSize()

- (CGSize) maxSize
implementation

Returns the window's maximum size.

Definition at line 1350 of file CPWindow.j.

◆ miniaturize:()

- (void) miniaturize: (id)  sender
implementation

Minimizes the window. Posts a CPWindowWillMiniaturizeNotification to the notification center before minimizing the window.

Definition at line 2333 of file CPWindow.j.

◆ minSize()

- (CGSize) minSize
implementation

Returns the windows minimum size.

Definition at line 1301 of file CPWindow.j.

◆ orderBack:()

- (void) orderBack: (id)  aSender
implementation

Definition at line 1006 of file CPWindow.j.

◆ orderFront:()

- (void) orderFront: (id)  aSender
implementation

Makes the receiver the front most window in the screen ordering.

Parameters
aSenderthe object that requested this

Reimplemented in CPColorPanel, and CPFontPanel.

Definition at line 925 of file CPWindow.j.

◆ orderOut:()

- (void) orderOut: (id)  aSender
implementation

Hides the window.

Parameters
theobject that requested this

Definition at line 1020 of file CPWindow.j.

◆ orderWindow:relativeTo:()

- (void) orderWindow: (CPWindowOrderingMode)  orderingMode
relativeTo: (int)  otherWindowNumber 
implementation

Relocates the window in the screen list.

Parameters
orderingModethe positioning relative to otherWindowNumber
otherWindowNumberthe window relative to which the receiver should be placed

Definition at line 1059 of file CPWindow.j.

◆ parentWindow()

- (CPWindow) parentWindow
implementation

Definition at line 2731 of file CPWindow.j.

◆ performClose:()

- (void) performClose: (id)  aSender
implementation

Simulates the user closing the window, then closes the window.

Parameters
aSenderthe object making this request

Definition at line 2372 of file CPWindow.j.

◆ performKeyEquivalent:()

- (BOOL) performKeyEquivalent: (CPEvent anEvent
implementation

Overridden by subclasses to handle a key equivalent.

If the character code or codes in anEvent match the receiver’s key equivalent, the receiver should respond to the event and return YES. The default implementation does nothing and returns NO.

You should extract the characters for a key equivalent using [anEvent charactersIgnoringModifiers].

Parameters
anEventAn event object that represents the key equivalent pressed
Returns
YES if theEvent is a key equivalent that the receiver handled, NO if it is not a key equivalent that it should handle.

Reimplemented from CPResponder.

Definition at line 3121 of file CPWindow.j.

◆ performMiniaturize:()

- (void) performMiniaturize: (id)  aSender
implementation

Simulates the user minimizing the window, then minimizes the window.

Parameters
aSenderthe object making this request

Definition at line 2323 of file CPWindow.j.

◆ platformWindow()

- (CPPlatformWindow) platformWindow
implementation

Definition at line 389 of file CPWindow.j.

◆ recalculateKeyViewLoop()

- (void) recalculateKeyViewLoop
implementation

Recalculates the key view loop, based on geometric position. Note that the Cocoa documentation says that this method only marks the loop as dirty, the recalculation is not done until the next or previous key view of the window is requested. In reality, Cocoa does recalculate the loop when this method is called.

Definition at line 3211 of file CPWindow.j.

◆ redo:()

- (void) redo: (id)  aSender
implementation

Sends the undo manager a -redo: message.

Parameters
aSenderthe object requesting this

Provided by category CPWindow(BridgeSupport).

Definition at line 3724 of file CPWindow.j.

◆ registeredDraggedTypes()

- (CPArray) registeredDraggedTypes
implementation

Returns an array of all types the receiver accepts for dragging operations.

Returns
an array of CPPasteBoards

Definition at line 2225 of file CPWindow.j.

◆ registerForDraggedTypes:()

- (void) registerForDraggedTypes: (CPArray)  pasteboardTypes
implementation

Sets the receiver's list of acceptable data types for a dragging operation.

Parameters
pasteboardTypesan array of CPPasteboards

Definition at line 2209 of file CPWindow.j.

◆ removeChildWindow:()

- (void) removeChildWindow: (CPWindow childWindow
implementation

Definition at line 2720 of file CPWindow.j.

◆ representedFilename()

- (CPString) representedFilename
implementation

Returns the path to the file the receiver represents

Definition at line 1729 of file CPWindow.j.

◆ representedURL()

- (CPURL) representedURL
implementation

Returns the URL that the receiver represents

Definition at line 1745 of file CPWindow.j.

◆ resignKeyWindow()

- (void) resignKeyWindow
implementation

Causes the window to resign it's key window status.

Definition at line 2136 of file CPWindow.j.

◆ resignMainWindow()

- (void) resignMainWindow
implementation

Called when the window resigns main window status.

Definition at line 2542 of file CPWindow.j.

◆ resizeIndicatorOffset()

- (CGSize) resizeIndicatorOffset
implementation

Returns the offset of the window's resize indicator.

Definition at line 1183 of file CPWindow.j.

◆ resizeWithOldPlatformWindowSize:()

- (void) resizeWithOldPlatformWindowSize: (CGSize)  aSize
implementation

Provided by category CPWindow(BridgeSupport).

Definition at line 3553 of file CPWindow.j.

◆ screen()

- (CPScreen) screen
implementation

Definition at line 1750 of file CPWindow.j.

◆ selectKeyViewFollowingView:()

- (void) selectKeyViewFollowingView: (CPView aView
implementation

Definition at line 3319 of file CPWindow.j.

◆ selectKeyViewPrecedingView:()

- (void) selectKeyViewPrecedingView: (CPView aView
implementation

Definition at line 3330 of file CPWindow.j.

◆ selectNextKeyView:()

- (void) selectNextKeyView: (id)  sender
implementation

Definition at line 3275 of file CPWindow.j.

◆ selectPreviousKeyView:()

- (void) selectPreviousKeyView: (id)  sender
implementation

Definition at line 3297 of file CPWindow.j.

◆ sendEvent:()

- (void) sendEvent: (CPEvent anEvent
implementation

Dispatches events that are sent to it from CPApplication.

Parameters
anEventthe event to be dispatched

Definition at line 1817 of file CPWindow.j.

◆ setAcceptsMouseMovedEvents:()

- (void) setAcceptsMouseMovedEvents: (BOOL)  shouldAcceptMouseMovedEvents
implementation

Definition at line 1667 of file CPWindow.j.

◆ setAlphaValue:()

- (void) setAlphaValue: (float)  aValue
implementation

Applies an alpha value to the window.

Parameters
aValuethe alpha value to apply

Definition at line 1235 of file CPWindow.j.

◆ setAutorecalculatesKeyViewLoop:()

- (void) setAutorecalculatesKeyViewLoop: (BOOL)  shouldRecalculate
implementation

Definition at line 3262 of file CPWindow.j.

◆ setAutoresizingMask:()

- (void) setAutoresizingMask: (unsigned)  anAutoresizingMask
implementation

Provided by category CPWindow(BridgeSupport).

Definition at line 3587 of file CPWindow.j.

◆ setBackgroundColor:()

- (void) setBackgroundColor: (CPColor aColor
implementation

Sets the window's background color.

Parameters
aColorthe new color for the background

Definition at line 1252 of file CPWindow.j.

◆ setConstrainWindowsToUsableScreen:()

+ (void) setConstrainWindowsToUsableScreen: (BOOL)  shouldConstrain
implementation

If set to NO, platform window (virtual screen) resizes will not attempt to move/resize user windows. to the usable area.

Definition at line 1131 of file CPWindow.j.

◆ setContentView:()

- (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.

Parameters
aViewthe new content view for the receiver

Definition at line 1202 of file CPWindow.j.

◆ setDefaultButton:()

- (void) setDefaultButton: (CPButton aButton
implementation

Sets the default button for the window. This is equivalent to setting the the key equivalent of the button to "return". Additionally this will turn your button blue (with the Aristo theme).

Parameters
aButton- The button that should become default.

Definition at line 3366 of file CPWindow.j.

◆ setDefaultButtonCell:()

- (void) setDefaultButtonCell: (CPButton aButton
implementation

Sets the default button for the window. Note: this method is deprecated use setDefaultButton: instead.

Parameters
aButton- The button that should become default.

Definition at line 3346 of file CPWindow.j.

◆ setDelegate:()

- (void) setDelegate: (id <CPWindowDelegate>)  aDelegate
implementation

Sets the delegate for the window. Passing nil will just remove the window's current delegate.

Parameters
aDelegatean object to respond to the various delegate methods of CPWindow

Definition at line 1437 of file CPWindow.j.

◆ setDocumentEdited:()

- (void) setDocumentEdited: (BOOL)  isDocumentEdited
implementation

Sets whether the document has been edited.

Parameters
isDocumentEditedYES if the document has been edited.

Definition at line 2250 of file CPWindow.j.

◆ setDocumentSaving:()

- (void) setDocumentSaving: (BOOL)  isDocumentSaving
implementation

Definition at line 2270 of file CPWindow.j.

◆ setFrame:()

- (void) setFrame: (CGRect)  aFrame
implementation

Sets the window's frame rectangle

Parameters
aFrame- The CGRect of the windows new frame

Definition at line 897 of file CPWindow.j.

◆ setFrame:display:()

- (void) setFrame: (CGRect)  aFrame
display: (BOOL)  shouldDisplay 
implementation

Sets the window's frame rect.

Parameters
aFrame- The new CGRect of the window.
shouldDisplay- YES if the window should call setNeedsDisplay: otherwise NO.

Definition at line 888 of file CPWindow.j.

◆ setFrame:display:animate:()

- (void) setFrame: (CGRect)  aFrame
display: (BOOL)  shouldDisplay
animate: (BOOL)  shouldAnimate 
implementation

Sets the frame of the window.

Parameters
aFrame- A CGRect of the new frame for the receiver.
shouldDisplay- YES if the window should call setNeedsDisplay otherwise NO.
shouldAnimate- YES if the window should animate to it's new size and position, otherwise NO.

Definition at line 681 of file CPWindow.j.

◆ setFrameOrigin:()

- (void) setFrameOrigin: (CGPoint)  anOrigin
implementation

Sets the window's location.

Parameters
anOriginthe new location for the window

Definition at line 906 of file CPWindow.j.

◆ setFrameSize:()

- (void) setFrameSize: (CGSize)  aSize
implementation

Sets the window's size.

Parameters
aSizethe new size for the window

Definition at line 916 of file CPWindow.j.

◆ setFullBridge:()

- (void) setFullBridge: (BOOL)  shouldBeFullBridge
implementation

Sets the CPWindow to fill the whole browser window. NOTE: this method has been deprecated in favor of setFullPlatformWindow:

Provided by category CPWindow(Deprecated).

Definition at line 3751 of file CPWindow.j.

◆ setFullPlatformWindow:()

- (void) setFullPlatformWindow: (BOOL)  shouldBeFullPlatformWindow
implementation

Sets the receiver as a full platform window. If you pass YES the CPWindow instance will fill the entire browser content area, otherwise the CPWindow will be a window inside of your browser window which the user can drag around, and resize (if you allow).

Parameters
BOOL- YES if the window should fill the browser window, otherwise NO.

Definition at line 566 of file CPWindow.j.

◆ setGlobalResizeStyle:()

+ (void) setGlobalResizeStyle: (int)  aStyle
implementation

Globally sets whether windows resize following the legacy style (using a resize thumb in the bottom right corner), or the modern style (no resize thumb, resizing can be done on all edges).

Definition at line 1118 of file CPWindow.j.

◆ setHasShadow:()

- (void) setHasShadow: (BOOL)  shouldHaveShadow
implementation

Sets whether the window should have a drop shadow.

Parameters
shouldHaveShadowYES to have a drop shadow.

Definition at line 1405 of file CPWindow.j.

◆ setIgnoresMouseEvents:()

- (void) setIgnoresMouseEvents: (BOOL)  shouldIgnoreMouseEvents
implementation

Definition at line 1677 of file CPWindow.j.

◆ setInitialFirstResponder:()

- (void) setInitialFirstResponder: (CPView aView
implementation

Definition at line 1592 of file CPWindow.j.

◆ setLevel:()

- (void) setLevel: (int)  aLevel
implementation

Sets the window's level

Parameters
thewindow's new level

Definition at line 1083 of file CPWindow.j.

◆ setMaxSize:()

- (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.

Parameters
aSizethe new maximum size

Definition at line 1321 of file CPWindow.j.

◆ setMinSize:()

- (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 height is pinned to the difference in height between the frame rect and content rect, to account for a title bar + toolbar.

Parameters
aSizethe new minimum size for the window

Definition at line 1272 of file CPWindow.j.

◆ setMovable:()

- (void) setMovable: (BOOL)  shouldBeMovable
implementation

Sets whether the window can be moved.

Parameters
shouldBeMovableYES makes the window movable.

Definition at line 1778 of file CPWindow.j.

◆ setMovableByWindowBackground:()

- (void) setMovableByWindowBackground: (BOOL)  shouldBeMovableByWindowBackground
implementation

Sets whether the window can be moved by dragging its background. The default is based on the window style.

Parameters
shouldBeMovableByWindowBackgroundYES makes the window move from a background drag.

Definition at line 1761 of file CPWindow.j.

◆ setParentWindow:()

- (CPWindow) setParentWindow: (CPWindow parentWindow
implementation

Definition at line 2752 of file CPWindow.j.

◆ setPlatformWindow:()

- (void) setPlatformWindow: (CPPlatformWindow aPlatformWindow
implementation

Sets the platform window of the reciver. This method will first close the reciever, change the platform window, then reopen the window (if it was originally open).

Definition at line 399 of file CPWindow.j.

◆ setRepresentedFilename:()

- (void) setRepresentedFilename: (CPString aFilePath
implementation

Sets the path to the file the receiver represents

Definition at line 1720 of file CPWindow.j.

◆ setRepresentedURL:()

- (void) setRepresentedURL: (CPURL aURL
implementation

Sets the URL that the receiver represents

Definition at line 1737 of file CPWindow.j.

◆ setResizeIndicatorOffset:()

- (void) setResizeIndicatorOffset: (CGSize)  anOffset
implementation

Sets the offset of the window's resize indicator.

Parameters
aSizethe offset for the resize indicator

Definition at line 1192 of file CPWindow.j.

◆ setShadowStyle:()

- (void) setShadowStyle: (unsigned)  aStyle
implementation

Sets the shadow style of the receiver. Values are:

CPWindowShadowStyleStandard
CPWindowShadowStyleMenu
CPWindowShadowStylePanel
Parameters
aStyle- The new shadow style of the receiver.

Definition at line 1426 of file CPWindow.j.

◆ setShowsResizeIndicator:()

- (void) setShowsResizeIndicator: (BOOL)  shouldShowResizeIndicator
implementation

Sets the window's resize indicator.

Parameters
shouldShowResizeIndicatorYES sets the window to show its resize indicator.

Definition at line 1169 of file CPWindow.j.

◆ setTitle:()

- (void) setTitle: (CPString aTitle
implementation

Sets the window's title bar string

Definition at line 1700 of file CPWindow.j.

◆ setTitleWithRepresentedFilename:()

- (void) setTitleWithRepresentedFilename: (CPString aFilePath
implementation

Sets the title bar to represent a file path

Definition at line 1711 of file CPWindow.j.

◆ setToolbar:()

- (void) setToolbar: (CPToolbar aToolbar
implementation

Sets the window's toolbar.

Parameters
aToolbarthe window's new toolbar

Definition at line 2641 of file CPWindow.j.

◆ setValue:forKey:()

- (void) setValue: (id)  aValue
forKey: (CPString aKey 
implementation

Reimplemented from CPObject.

Definition at line 3427 of file CPWindow.j.

◆ setWindowController:()

- (void) setWindowController: (CPWindowController aWindowController
implementation

Sets the window's controller

Parameters
aWindowControllera window controller

Definition at line 1561 of file CPWindow.j.

◆ showsResizeIndicator()

- (BOOL) showsResizeIndicator
implementation

Returns YES if the window's resize indicator is showing. NO otherwise.

Definition at line 1160 of file CPWindow.j.

◆ styleMask()

- (unsigned) styleMask
implementation

Returns the window's style mask.

Definition at line 620 of file CPWindow.j.

◆ title()

- (CPString) title
implementation

Returns the window's title bar string

Definition at line 1692 of file CPWindow.j.

◆ toggleToolbarShown:()

- (void) toggleToolbarShown: (id)  aSender
implementation

Definition at line 2660 of file CPWindow.j.

◆ toolbar()

- (CPToolbar) toolbar
implementation

Return's the window's toolbar

Definition at line 2632 of file CPWindow.j.

◆ undo:()

- (void) undo: (id)  aSender
implementation

Sends the undo manager an -undo: message.

Parameters
aSenderthe object requesting this

Provided by category CPWindow(BridgeSupport).

Definition at line 3715 of file CPWindow.j.

◆ undoManager()

- (CPUndoManager) undoManager
implementation

Returns the window's undo manager.

Reimplemented from CPResponder.

Provided by category CPWindow(BridgeSupport).

Definition at line 3688 of file CPWindow.j.

◆ unregisterDraggedTypes()

- (void) unregisterDraggedTypes
implementation

Resets the array of acceptable data types for a dragging operation.

Definition at line 2236 of file CPWindow.j.

◆ windowController()

- (CPWindowController) windowController
implementation

Returns the window's controller.

Definition at line 1569 of file CPWindow.j.

◆ windowNumber()

- (int) windowNumber
implementation

Returns the window's number in the desktop's screen list

Definition at line 2024 of file CPWindow.j.

◆ worksWhenModal()

- (BOOL) worksWhenModal
implementation

Returns YES if the receiver is able to receive input events even when a modal session is active.

Reimplemented in CPFontPanel, and CPPanel.

Definition at line 3116 of file CPWindow.j.


The documentation for this class was generated from the following files: