Class Methods | |
(Class) | + animatorClass |
(CAAnimation) | + defaultAnimationForKey: |
(CPMenu) | + defaultMenu |
(CPString) | + defaultThemeClass |
(void) | + initialize |
(BOOL) | + isHighDPIDrawingEnabled |
(CPSet) | + keyPathsForValuesAffectingBounds |
(CPSet) | + keyPathsForValuesAffectingFrame |
(void) | + setHighDPIDrawingEnabled: |
(CPDictionary) | + themeAttributes |
CPView is a class which provides facilities for drawing in a window and receiving events. It is the superclass of many of the visual elements of the GUI.
In order to display itself, a view must be placed in a window (represented by an CPWindow object). Within the window is a hierarchy of CPViews, headed by the window's content view. Every other view in a window is a descendant of this view.
Subclasses can override -drawRect
: in order to implement their appearance. Other methods of CPView and CPResponder can also be overridden to handle user generated events.
|
implementation |
Returns whether the receiver should be sent a -mouseDown
: message for anEvent
.
Returns NO
by default.
YES
, if the view object accepts first mouse-down event. NO
, otherwise. Reimplemented in CPTextField, CPControl, and CPTabView.
|
implementation |
|
implementation |
Makes aSubview
a subview of the receiver. It is positioned relative to anotherView
aSubview | the view to add as a subview |
anOrderingMode | specifies aSubview's ordering relative to anotherView |
anotherView | aSubview will be positioned relative to this argument |
|
implementation |
Provided by category CPView(TrackingAreaAdditions).
|
implementation |
|
implementation |
|
implementation |
Provided by category CPView(CPAnimatablePropertyContainer).
Definition at line 265 of file CPViewAnimator.j.
|
implementation |
Provided by category CPView(CPAnimatablePropertyContainer).
Definition at line 278 of file CPViewAnimator.j.
|
implementation |
Provided by category CPView(CPAnimatablePropertyContainer).
Definition at line 242 of file CPViewAnimator.j.
|
implementation |
Provided by category CPView(CPAnimatablePropertyContainer).
Definition at line 232 of file CPViewAnimator.j.
|
implementation |
|
implementation |
|
implementation |
Scrolls the view’s CPClipView in the direction of a mouse event that occurs outside of it.
Reimplemented in CPClipView.
|
implementation |
|
implementation |
Reimplemented in CPTextView, CPTextField, CPTokenField, and CPDatePicker.
Provided by category CPView(Theming).
|
implementation |
|
implementation |
Provided by category CPView(KeyView).
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Reimplemented in CPTextField, CPButton, CPScroller, CPComboBox, CPProgressIndicator, CPLevelIndicator, CPSegmentedControl, CPSlider, CPColorWell, and CPButtonBar.
Provided by category CPView(Theming).
|
implementation |
Provided by category CPView(CPAnimatablePropertyContainer).
Definition at line 293 of file CPViewAnimator.j.
|
implementation |
Provided by category CPView(CPAnimatablePropertyContainer).
Definition at line 250 of file CPViewAnimator.j.
|
implementation |
Reimplemented in CPRadio, CPTableView, CPTableHeaderView, CPTextField, CPScrollView, CPSplitView, CPButton, CPBrowser, CPTokenField, CPScroller, CPComboBox, CPDatePicker, CPProgressIndicator, CPBox, CPLevelIndicator, CPSearchField, CPSegmentedControl, CPSlider, CPColorWell, CPStepper, CPButtonBar, CPPopUpButton, CPShadowView, and CPCheckBox.
|
implementation |
Called when the receiver has added aSubview
to it's child views.
aSubview | the view that was added |
Reimplemented in CPSplitView.
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Reimplemented in CPTextView.
|
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 |
aPasteboard | the pasteboard that holds the drag data |
aSourceObject | the drag operation controller |
slideBack | Whether the image should 'slide back' if the drag is rejected |
|
implementation |
Initiates a drag operation from the receiver to another view that accepts dragged data.
aView | the view to be dragged |
aLocation | the top-left corner coordinate of aView |
mouseOffset | the distance from the -mouseDown : location and the current location |
anEvent | the -mouseDown : that triggered the drag |
aPasteboard | the pasteboard that holds the drag data |
aSourceObject | the drag operation controller |
slideBack | Whether the view should 'slide back' if the drag is rejected |
|
implementation |
Draws the receiver into aRect
. This method should be overridden by subclasses.
aRect | the area that should be drawn into |
Reimplemented in CPDisclosureButton, CPTextView, CPScrollView, CPSplitView, CPProgressIndicator, and CPBox.
|
implementation |
Returns the receiver's appearance if any, or ask the superview and returns it.
Provided by category CPView(Appearance).
|
implementation |
|
implementation |
Returns the CPScrollView containing the receiver.
|
implementation |
Archives the view to a coder.
aCoder | the object into which the view's data will be archived. |
Reimplemented in CPTokenField, CPSplitView, CPControl, CPSearchField, CPTableHeaderView, CPRadio, CPTableView, CPClipView, CPOutlineView, CPTextView, CPTextField, CPScrollView, CPCollectionView, CPWebView, CPText, CPButton, CPBrowser, CPScroller, CPComboBox, CPTabView, CPDatePicker, CPProgressIndicator, CPBox, CPImageView, CPLevelIndicator, CPVisualEffectView, CPSegmentedControl, CPSlider, CPColorWell, CPStepper, and CPButtonBar.
Provided by category CPView(CPCoding).
|
implementation |
|
implementation |
Provided by category CPView(Theming).
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Provided by category CPView(CPAnimationContext).
Definition at line 393 of file CPAnimationContext.j.
|
implementation |
Provided by category CPView(CPAnimationContext).
Definition at line 398 of file CPAnimationContext.j.
|
implementation |
Provided by category CPView(CPAnimationContext).
Definition at line 432 of file CPAnimationContext.j.
|
implementation |
Provided by category CPView(CPAnimationContext).
Definition at line 437 of file CPAnimationContext.j.
|
implementation |
Tests whether a point is contained within this view, or one of its subviews.
aPoint | the point to test |
Reimplemented in CPTableView, CPSplitView, CPLevelIndicator, and CPSearchField.
|
implementation |
|
implementation |
Reimplemented in CPScrollView, CPControl, and CPImageView.
|
implementation |
Initializes the view from an archive.
aCoder | the coder from which to initialize |
Reimplemented in CPTokenField, CPSplitView, CPControl, CPSearchField, CPTableHeaderView, CPRadio, CPTableView, CPClipView, CPOutlineView, CPTextView, CPTextField, CPScrollView, CPCollectionView, CPWebView, CPText, CPButton, CPBrowser, CPScroller, CPComboBox, CPTabView, CPDatePicker, CPProgressIndicator, CPBox, CPImageView, CPLevelIndicator, CPVisualEffectView, CPSegmentedControl, CPSlider, CPColorWell, CPStepper, CPButtonBar, and CPPopUpButton.
Provided by category CPView(CPCoding).
|
implementation |
Initializes the receiver for usage with the specified bounding rectangle
Reimplemented in CPRadio, CPTableView, CPTableHeaderView, CPOutlineView, CPDisclosureButton, CPTextView, CPTextField, CPScrollView, CPCollectionView, CPWebView, CPSplitView, CPControl, CPButton, CPBrowser, CPTokenField, CPScroller, CPAccordionView, CPComboBox, CPTabView, CPDatePicker, CPProgressIndicator, CPBox, CPImageView, CPLevelIndicator, CPSearchField, CPVisualEffectView, CPSegmentedControl, CPSlider, CPColorWell, CPStepper, CPButtonBar, CPFlashView, CPPopUpButton, CPShadowView, and CPCheckBox.
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Returns whether the receiver is completely opaque. By default, returns NO
.
Reimplemented in CPSearchField.
|
implementation |
Returns the core animation layer used by the receiver.
Provided by category CPView(CoreAnimationAdditions).
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Reimplemented in CPTableView, CPTableHeaderView, CPTextField, CPSplitView, CPButton, CPTokenField, CPScroller, CPAccordionView, CPComboBox, CPTabView, CPDatePicker, CPProgressIndicator, CPImageView, CPLevelIndicator, CPVisualEffectView, CPSegmentedControl, CPSlider, CPColorWell, CPStepper, CPButtonBar, and CPShadowView.
|
implementation |
Reimplemented in CPTableView, and CPCollectionView.
|
implementation |
Reimplemented in CPTableHeaderView, CPTextView, CPTextField, CPCollectionView, CPSplitView, CPControl, CPButton, CPTokenField, CPScroller, CPImageView, CPLevelIndicator, CPSearchField, CPSegmentedControl, CPFlashView, and CPPopUpButton.
|
implementation |
|
implementation |
Returns YES
if this view requires a panel to become key. Normally only text fields, so this returns NO
.
Reimplemented in CPTableView, CPTextView, and CPTextField.
|
implementation |
Provided by category CPView(KeyView).
|
implementation |
Provided by category CPView(KeyView).
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Overridden by subclasses to handle a key equivalent.
If the receiver’s key equivalent is the same as the characters of the key-down event theEvent, as returned by [anEvent charactersIgnoringModifiers], the receiver should take the appropriate action and return YES
. Otherwise, it should return the result of invoking super’s implementation. The default implementation of this method simply passes the message down the view hierarchy (from superviews to subviews) and returns NO
if none of the receiver’s subviews responds YES
.
anEvent | An event object that represents the key equivalent pressed |
YES
if theEvent is a key equivalent that the receiver handled, NO
if it is not a key equivalent that it should handle. Reimplemented in CPButton, CPTokenField, and CPComboBox.
Provided by category CPView(KeyView).
|
implementation |
|
implementation |
|
implementation |
Provided by category CPView(KeyView).
|
implementation |
Provided by category CPView(KeyView).
|
implementation |
Reimplemented in CPTextField, CPButton, CPScroller, CPComboBox, CPProgressIndicator, CPLevelIndicator, CPSegmentedControl, CPSlider, CPColorWell, and CPButtonBar.
Provided by category CPView(Theming).
|
implementation |
Notifies the receiver (superview of a CPClipView) that the clip view bounds or the document view bounds have changed.
aClipView | the clip view of the superview being notified |
Reimplemented in CPScrollView.
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Provided by category CPView(TrackingAreaAdditions).
|
implementation |
Reimplemented in CPTextView, CPTextField, CPTokenField, CPComboBox, CPDatePicker, and CPSearchField.
Provided by category CPView(Theming).
|
implementation |
Initiates -superviewSizeChanged
: messages to subviews.
aSize | the size for the subviews |
Reimplemented in CPClipView, CPScrollView, CPCollectionView, and CPSplitView.
|
implementation |
Notifies subviews that the superview changed size.
aSize | the size of the old superview |
Reimplemented in CPTableView, and CPCollectionView.
|
implementation |
Reimplemented in CPTextField, and CPPopUpButton.
|
implementation |
Return the scaleSize of the view, this scaleSize is used to scale in css
Provided by category CPView(Scaling).
|
implementation |
Scales the receiver’s coordinate system so that the unit square scales to the specified dimensions. The bounds of the receiver will change, for instance if the given size is (0.5, 0.5) the width and height of the bounds will be multiply by 2. You must call setNeedsDisplay: to redraw the view.
aSize,the | size corresponding the new unit scales |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Scrolls the nearest ancestor CPClipView a minimum amount so aRect
can become visible.
aRect | the area to become visible |
YES
if any scrolling occurred, NO
otherwise.
|
implementation |
|
implementation |
Provided by category CPView(CPAnimatablePropertyContainer).
Definition at line 283 of file CPViewAnimator.j.
|
implementation |
Reimplemented in CPVisualEffectView.
Provided by category CPView(Appearance).
|
implementation |
Specifies whether the receiver view should automatically resize its subviews when its -setFrameSize
: method receives a change.
aFlag | If YES , then subviews will automatically be resized when this view is resized. NO means the views will not be resized automatically. |
|
implementation |
Determines automatic resizing behavior.
aMask | a bit mask with options |
Reimplemented in CPCollectionView.
|
implementation |
|
implementation |
|
implementation |
Sets the location of the receiver inside its frame. The method posts a CPViewBoundsDidChangeNotification to the default notification center if the receiver is configured to do so.
aPoint | the new location for the receiver |
Reimplemented in CPTableView, and CPClipView.
|
implementation |
Sets the receiver's size inside its frame. The method posts a CPViewBoundsDidChangeNotification to the default notification center if the receiver is configured to do so.
aSize | the new size for the receiver |
Reimplemented in CPTableView.
|
implementation |
Moves the center of the receiver's frame to the provided point. The point is defined in the superview's coordinate system. The method posts a CPViewFrameDidChangeNotification to the default notification center if the receiver is configured to do so. If the specified origin is the same as the frame's current origin, the method will simply return (and no notification will be posted).
aPoint | the new origin point |
|
implementation |
|
implementation |
Provided by category CPView(CSSTheming).
|
implementation |
Sets the frame size of the receiver to the dimensions and origin of the provided rectangle in the coordinate system of the superview. The method also posts a CPViewFrameDidChangeNotification to the notification center if the receiver is configured to do so. If the frame is the same as the current frame, the method simply returns (and no notification is posted).
aFrame | the rectangle specifying the new origin and size of the receiver |
Reimplemented in CPStepper.
|
implementation |
Sets the receiver's frame origin to the provided point. The point is defined in the superview's coordinate system. The method posts a CPViewFrameDidChangeNotification to the default notification center if the receiver is configured to do so. If the specified origin is the same as the frame's current origin, the method will simply return (and no notification will be posted).
aPoint | the new origin point |
Reimplemented in CPTableView.
|
implementation |
Sets the receiver's frame size. If aSize
is the same as the frame's current dimensions, this method simply returns. The method posts a CPViewFrameDidChangeNotification to the default notification center if the receiver is configured to do so.
aSize | the new size for the frame |
Reimplemented in CPTableView, CPTextView, CPWebView, CPSplitView, CPScroller, CPAccordionView, CPProgressIndicator, CPSlider, and CPButtonBar.
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Sets the core animation layer to be used by this receiver.
Provided by category CPView(CoreAnimationAdditions).
|
implementation |
Marks the entire view as dirty, and needing a redraw.
Reimplemented in CPTableView.
|
implementation |
|
implementation |
Reimplemented in CPTableView.
|
implementation |
Provided by category CPView(KeyView).
|
implementation |
Sets whether the receiver posts a CPViewBoundsDidChangeNotification notification to the default notification center when its bounds is changed. The default is NO
. Methods that could cause a bounds change notification are:
setBounds: setBoundsSize: setBoundsOrigin:
shouldPostBoundsChangedNotifications | YES makes the receiver post notifications on bounds changes |
|
implementation |
Sets whether the receiver posts a CPViewFrameDidChangeNotification notification to the default notification center when its frame is changed. The default is NO
. Methods that could cause a frame change notification are:
setFrame: setFrameSize: setFrameOrigin:
shouldPostFrameChangedNotifications | YES makes the receiver post notifications on frame changes (size or origin) |
|
implementation |
Set the zoom of the view. This will call scaleUnitSquareToSize: and setNeedsDisplay: This method doesn't care about the last zoom you set in the view
aSize,the | size corresponding the new unit scales |
Provided by category CPView(Scaling).
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Reimplemented in CPTableCellView.
Provided by category CPView(Theming).
|
implementation |
|
implementation |
Reimplemented in CPTextField, and CPCheckBox.
Provided by category CPView(Theming).
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Sets whether the receiver wants a core animation layer.
Provided by category CPView(CoreAnimationAdditions).
|
implementation |
|
implementation |
|
implementation |
Reimplemented in CPTableView, CPTableHeaderView, CPTextField, CPScrollView, CPSplitView, CPControl, CPButton, CPBrowser, CPTokenField, CPScroller, CPComboBox, CPDatePicker, CPProgressIndicator, CPBox, CPLevelIndicator, CPSearchField, CPSegmentedControl, CPSlider, CPColorWell, CPStepper, CPButtonBar, and CPShadowView.
|
implementation |
|
implementation |
|
implementation |
Reimplemented in CPTableCellView.
Provided by category CPView(Theming).
|
implementation |
Invoked automatically when the view’s geometry changes such that its tracking areas need to be recalculated.
You should override this method to remove out of date tracking areas, add recomputed tracking areas and then call super;
Cocoa calls this on every view, whereas they have tracking area(s) or not. Cappuccino behaves differently :
Please note that it is the owner of a tracking area who is called for updateTrackingAreas. But, if a view without any tracking area is inserted in the view hierarchy (that is, in a window), the view is called for updateTrackingAreas. This enables you to use updateTrackingArea to initially attach your tracking areas to the view.
Reimplemented in CPTextField, CPSplitView, CPControl, CPSearchField, and CPTableHeaderView.
Provided by category CPView(TrackingAreaAdditions).
|
implementation |
Not implemented.
A view will be sent this message after a window finishes a resize operation. The receiver which simplified its drawing operations in viewWillStartLiveResize might stop doing so now. Note the view might no longer be in a window, so use [self setNeedsDisplay:YES] if a final non-simplified redraw is required.
Subclasses should call super.
|
implementation |
Called when the return value of isHiddenOrHasHiddenAncestor becomes YES, e.g. when this view becomes hidden due to a setHidden:YES message to itself or to one of its superviews.
Note: in the current implementation, viewDidHide may be called multiple times if additional superviews are hidden, even if isHiddenOrHasHiddenAncestor was already YES.
Reimplemented in CPTextField.
|
implementation |
|
implementation |
Called when the receiver has been moved to a new CPWindow.
Reimplemented in CPTableHeaderView, and CPSplitView.
|
implementation |
Called when the return value of isHiddenOrHasHiddenAncestor becomes NO, e.g. when this view stops being hidden due to a setHidden:NO message to itself or to one of its superviews.
Note: in the current implementation, viewDidUnhide may be called multiple times if additional superviews are unhidden, even if isHiddenOrHasHiddenAncestor was already NO.
Reimplemented in CPTextField, and CPWebView.
|
implementation |
Reimplemented in CPSplitView.
|
implementation |
Called when the receiver is about to be moved to a new view.
aView | the view to which the receiver will be moved |
Reimplemented in CPTableView, and CPTextView.
|
implementation |
Called when the receiver is about to be moved to a new window.
aWindow | the window to which the receiver will be moved. |
Reimplemented in CPTableView, CPScrollView, and CPButton.
|
implementation |
|
implementation |
|
implementation |
Returns YES
if the receiver uses a CALayer
YES
if the receiver uses a CALayer Provided by category CPView(CoreAnimationAdditions).
|
implementation |
Called when the receiver is about to remove one of its subviews.
aView | the view that will be removed |
Reimplemented in CPSplitView.
|
implementation |