![]() |
API
0.9.6
|
#import <CPView.h>
Class Methods | |
(CPMenu) | + defaultMenu |
(CPString) | + defaultThemeClass |
(void) | + initialize |
(CPSet) | + keyPathsForValuesAffectingBounds |
(CPSet) | + keyPathsForValuesAffectingFrame |
(CPDictionary) | + themeAttributes |
![]() | |
(BOOL) | + accessInstanceVariablesDirectly |
(id) | + alloc |
(id) | + allocWithCoder: |
(BOOL) | + automaticallyNotifiesObserversForKey: |
(Class) | + class |
(void) | + exposeBinding: |
(IMP) | + instanceMethodForSelector: |
(BOOL) | + instancesRespondToSelector: |
(BOOL) | + isSubclassOfClass: |
(CPSet) | + keyPathsForValuesAffectingValueForKey: |
(void) | + load |
(id) | + new |
(void) | + setVersion: |
(Class) | + superclass |
(int) | + version |
Additional Inherited Members | |
![]() | |
Class | isa |
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 |
|
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 |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Reimplemented in CPClipView.
|
implementation |
|
implementation |
|
implementation |
Provided by category CPView(KeyView).
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Reimplemented in CPTextField, CPButton, CPScroller, CPProgressIndicator, CPLevelIndicator, CPComboBox, CPSegmentedControl, CPColorWell, CPSlider, and CPButtonBar.
Provided by category CPView(Theming).
|
implementation |
Reimplemented in CPScroller.
Provided by category CPView(Theming).
|
implementation |
Reimplemented in CPRadio, CPTableView, CPTableHeaderView, CPTextField, CPScrollView, CPButton, CPSplitView, CPScroller, CPTokenField, CPSearchField, CPComboBox, CPSegmentedControl, CPColorWell, CPSlider, CPStepper, CPPopUpButton, CPCheckBox, and CPButtonBar.
Provided by category CPView(Theming).
|
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 |
|
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 CPScrollView, and CPBox.
|
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 from CPResponder.
Reimplemented in CPTokenField, CPRadio, CPTableView, CPClipView, CPTableHeaderView, CPOutlineView, CPWebView, CPTextField, CPScrollView, CPButton, CPControl, CPSplitView, CPCollectionView, CPScroller, CPProgressIndicator, CPBox, CPSearchField, CPLevelIndicator, CPBrowser, CPTabView, CPImageView, CPComboBox, CPSegmentedControl, CPColorWell, CPSlider, CPStepper, and CPButtonBar.
Provided by category CPView(CPCoding).
|
implementation |
|
implementation |
Provided by category CPView(Theming).
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Tests whether a point is contained within this view, or one of its subviews.
aPoint | the point to test |
Reimplemented in CPLevelIndicator.
|
implementation |
|
implementation |
|
implementation |
Reimplemented from CPObject.
Reimplemented in CPScrollView, CPControl, CPSplitView, CPProgressIndicator, CPSearchField, CPLevelIndicator, CPImageView, and CPShadowView.
|
implementation |
Initializes the view from an archive.
aCoder | the coder from which to initialize |
Reimplemented from CPResponder.
Reimplemented in CPTokenField, CPRadio, CPTableView, CPClipView, CPTableHeaderView, CPOutlineView, CPWebView, CPTextField, CPScrollView, CPButton, CPControl, CPSplitView, CPCollectionView, CPScroller, CPProgressIndicator, CPBox, CPSearchField, CPLevelIndicator, CPBrowser, CPTabView, CPImageView, CPComboBox, CPSegmentedControl, CPColorWell, CPSlider, CPStepper, CPPopUpButton, and CPButtonBar.
Provided by category CPView(CPCoding).
|
implementation |
Initializes the receiver for usage with the specified bounding rectangle
Reimplemented in CPRadio, CPTableView, CPTableHeaderView, CPOutlineView, CPDisclosureButton, CPTextField, CPScrollView, CPButton, CPControl, CPSplitView, CPCollectionView, CPScroller, CPAccordionView, CPProgressIndicator, CPSearchField, CPLevelIndicator, CPBrowser, CPTabView, CPImageView, CPComboBox, CPSegmentedControl, CPColorWell, CPShadowView, CPSlider, CPStepper, CPPopUpButton, CPFlashView, CPCheckBox, and CPButtonBar.
|
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, CPButton, CPSplitView, CPScroller, CPAccordionView, CPTokenField, CPLevelIndicator, CPTabView, CPImageView, CPComboBox, CPSegmentedControl, CPColorWell, CPSlider, CPStepper, and CPButtonBar.
|
implementation |
Reimplemented in CPTableView, and CPCollectionView.
|
implementation |
Notifies the receiver that the user has clicked the mouse down in its area.
anEvent | contains information about the click |
Reimplemented from CPResponder.
Reimplemented in CPTableHeaderView, CPTextField, CPButton, CPControl, CPSplitView, CPCollectionView, CPScroller, CPTokenField, CPSearchField, CPLevelIndicator, CPTabView, CPImageView, CPSegmentedControl, CPPopUpButton, and CPFlashView.
|
implementation |
|
implementation |
Returns YES
if this view requires a panel to become key. Normally only text fields, so this returns NO
.
Reimplemented in CPTextField.
|
implementation |
Provided by category CPView(KeyView).
|
implementation |
Provided by category CPView(KeyView).
|
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 from CPResponder.
Reimplemented in CPButton, 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, CPProgressIndicator, CPLevelIndicator, CPComboBox, CPSegmentedControl, CPColorWell, CPSlider, 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 |
Registers theme values encoded in an array at runtime. The format of the data in the array is the same as that used by ThemeDescriptors.j, with the exception that you need to use CPColorWithImages() in place of PatternColor(). For more information see the comments at the top of ThemeDescriptors.j.
themeValues | array of theme values |
Provided by category CPView(Theming).
|
implementation |
Registers theme values encoded in an array at runtime. The format of the data in the array is the same as that used by ThemeDescriptors.j, with the exception that you need to use CPColorWithImages() in place of PatternColor(). The values in inheritedValues
are registered first, then those in themeValues
override/augment the inherited values. For more information see the comments at the top of ThemeDescriptors.j.
themeValues | array of base theme values |
inheritedValues | array of overridden/additional theme values |
Provided by category CPView(Theming).
|
implementation |
|
implementation |
Initiates -superviewSizeChanged
: messages to subviews.
aSize | the size for the subviews |
Reimplemented in CPClipView, CPScrollView, and CPCollectionView.
|
implementation |
Notifies subviews that the superview changed size.
aSize | the size of the old superview |
Reimplemented in CPTableView.
|
implementation |
Notifies the receiver that the user has clicked the right mouse down in its area.
anEvent | contains information about the right click |
Reimplemented from CPResponder.
Reimplemented in CPPopUpButton.
|
implementation |
|
implementation |
|
implementation |
|
implementation |
Scrolls the nearest ancestor CPClipView a minimum amount so aRect
can become visible.
aRect | the area to become visible |
NO
otherwise.
|
implementation |
|
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 |
|
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 |
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, CPSplitView, CPScroller, CPAccordionView, CPProgressIndicator, CPSlider, and CPButtonBar.
|
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 |
Provided by category CPView(Theming).
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Provided by category CPView(Theming).
|
implementation |
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Sets whether the receiver wants a core animation layer.
c YES means the receiver wants a layer. |
Provided by category CPView(CoreAnimationAdditions).
|
implementation |
|
implementation |
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Reimplemented in CPTableView, CPTableHeaderView, CPTextField, CPScrollView, CPButton, CPControl, CPSplitView, CPScroller, CPTokenField, CPComboBox, CPSegmentedControl, CPColorWell, CPSlider, CPStepper, and CPButtonBar.
Provided by category CPView(Theming).
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Synthesized accessor method.
Provided by category CPView(CPSynthesizedAccessors).
|
implementation |
|
implementation |
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Provided by category CPView(Theming).
|
implementation |
Provided by category CPView(Theming).
|
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.
|
implementation |
|
implementation |
Called when the receiver has been moved to a new CPWindow.
Reimplemented in 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 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 CPSearchField.
|
implementation |
|
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 |