#import <CPSplitView.h>
Class Methods | |
(CPString) | + defaultThemeClass |
(CPDictionary) | + themeAttributes |
![]() | |
(CPMenu) | + defaultMenu |
(void) | + initialize |
(BOOL) | + isHighDPIDrawingEnabled |
(CPSet) | + keyPathsForValuesAffectingBounds |
(CPSet) | + keyPathsForValuesAffectingFrame |
(void) | + setHighDPIDrawingEnabled: |
CPSplitView is a view that allows you to stack several subviews vertically or horizontally. The user is given divider to resize the subviews. The divider indices are zero-based. So the divider on the top (or left for vertical dividers) will be index 0.
CPSplitView can be supplied a delegate to provide control over the resizing of the splitview and subviews. Those methods are documented in setDelegate:
CPSplitView will add dividers for each subview you add. So just like adding subviews to a CPView you should call addSubview: to add new resizable subviews in your splitview.
Definition at line 2 of file CPSplitView.h.
|
implementation |
Definition at line 798 of file CPSplitView.j.
|
implementation |
Get the name under which the split view divider position is automatically saved to CPUserDefaults.
Definition at line 1106 of file CPSplitView.j.
|
implementation |
Definition at line 417 of file CPSplitView.j.
|
implementation |
Reimplemented from CPView.
Definition at line 124 of file CPSplitView.j.
|
implementation |
Called when the receiver has added aSubview
to it's child views.
aSubview | the view that was added |
Reimplemented from CPView.
Definition at line 256 of file CPSplitView.j.
|
implementation |
Returns the thickness of the divider.
Definition at line 163 of file CPSplitView.j.
|
implementation |
Draws the divider at a given rect.
aRect | - the rect of the divider to draw. |
Definition at line 346 of file CPSplitView.j.
|
implementation |
Draws the receiver into aRect
. This method should be overridden by subclasses.
aRect | the area that should be drawn into |
Reimplemented from CPView.
Definition at line 306 of file CPSplitView.j.
|
implementation |
Returns the rect of the divider which the user is able to drag to resize.
int | - The index of the divider. |
Definition at line 295 of file CPSplitView.j.
|
implementation |
Archives the view to a coder.
aCoder | the object into which the view's data will be archived. |
Reimplemented from CPView.
Provided by category CPSplitView(CPCoding).
Definition at line 1446 of file CPSplitView.j.
|
implementation |
Tests whether a point is contained within this view, or one of its subviews.
aPoint | the point to test |
Reimplemented from CPView.
Definition at line 440 of file CPSplitView.j.
|
implementation |
Initializes the view from an archive.
aCoder | the coder from which to initialize |
Reimplemented from CPView.
Provided by category CPSplitView(CPCoding).
Definition at line 1381 of file CPSplitView.j.
|
implementation |
Initializes the receiver for usage with the specified bounding rectangle
Reimplemented from CPView.
Definition at line 140 of file CPSplitView.j.
|
implementation |
Use to find if the divider is a larger pane splitter.
Definition at line 230 of file CPSplitView.j.
|
implementation |
Returns YES if the supplied subview is collapsed, otherwise NO.
aSubview | - the subview you are interested in. |
Definition at line 266 of file CPSplitView.j.
|
implementation |
Returns YES if the dividers are vertical, otherwise NO.
Definition at line 172 of file CPSplitView.j.
|
implementation |
Reimplemented from CPView.
Definition at line 337 of file CPSplitView.j.
|
implementation |
Returns the maximum possible position of a divider at a given index.
the | index of the divider. |
Definition at line 644 of file CPSplitView.j.
|
implementation |
Returns the minimum possible position of a divider at a given index.
the | index of the divider. |
Definition at line 659 of file CPSplitView.j.
|
implementation |
Notifies the receiver that the user has clicked the mouse down in its area.
anEvent | contains information about the click |
Reimplemented from CPView.
Definition at line 545 of file CPSplitView.j.
|
implementation |
Reimplemented from CPResponder.
Definition at line 557 of file CPSplitView.j.
|
implementation |
Notifies the receiver that the mouse exited the receiver's area.
anEvent | contains information about the exit |
Reimplemented from CPResponder.
Definition at line 570 of file CPSplitView.j.
|
implementation |
Notifies the receiver that the user has moved the mouse (with no buttons down).
anEvent | contains information about the movement |
Reimplemented from CPResponder.
Definition at line 564 of file CPSplitView.j.
|
implementation |
Returns the CGRect of the divider at a given index.
int | - The index of a divider. |
Definition at line 277 of file CPSplitView.j.
|
implementation |
Initiates -superviewSizeChanged
: messages to subviews.
aSize | the size for the subviews |
Reimplemented from CPView.
Definition at line 787 of file CPSplitView.j.
|
implementation |
Set the name under which the split view divider positions is automatically saved to CPUserDefaults.
autosaveName | the name to save under or nil to not save |
Definition at line 1093 of file CPSplitView.j.
|
implementation |
Set the button bar who's resize control should act as a control for this splitview. Each divider can have at most one button bar assigned to it, and that button bar must be a subview of one of the split view's subviews.
Calling this method with nil as the button bar will remove any currently assigned button bar for the divider at that index. Indexes will not be adjusted as new subviews are added, so you should usually call this method after adding all the desired subviews to the split view.
This method will automatically configure the hasResizeControl and resizeControlIsLeftAligned parameters of the button bar, and will override any currently set values.
CPButtonBar | - The supplied button bar. |
unsigned | int - The divider index the button bar will be assigned to. |
Definition at line 1030 of file CPSplitView.j.
|
implementation |
Sets the delegate of the receiver. Possible delegate methods to implement are listed below.
Notifies the delegate when the subviews have resized.
Notifies the delegate when the subviews will be resized.
Allows the delegate to specify which of the CPSplitView's subviews should adjust if the window is resized.
Lets the delegate specify a different rect for which the user can drag the splitView divider.
Lets the delegate specify an additional rect for which the user can drag the splitview divider.
Notifies the delegate that the splitview is about to be collapsed. This usually happens when the user Double clicks on the divider. Return YES if the subview can be collapsed, otherwise NO.
Notifies the delegate that the subview at indexOfDivider is about to be collapsed. This usually happens when the user Double clicks on the divider. Return YES if the subview should be collapsed, otherwise NO.
Allows the delegate to constrain the subview beings resized. This method is called continuously as the user resizes the divider. For example if the subview needs to have a width which is a multiple of a certain number you could return that multiple with this method.
Allows the delegate to constrain the minimum position of a subview.
Allows the delegate to constrain the maximum position of a subview.
Allows the splitview to specify a custom resizing behavior. This is called when the splitview is resized. The sum of the views and the sum of the dividers should be equal to the size of the splitview.
delegate | - The delegate of the splitview. |
Definition at line 959 of file CPSplitView.j.
|
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 from CPView.
Definition at line 772 of file CPSplitView.j.
|
implementation |
Used to set if the split view dividers should be the larger pane splitter.
shouldBePaneSplitter | - YES if the dividers should be the thicker pane splitter, otherwise NO. |
Definition at line 240 of file CPSplitView.j.
|
implementation |
Sets the position of a divider at a given index.
position | - The float value of the position to place the divider. |
dividerIndex | - The index of the divider to position. |
Definition at line 715 of file CPSplitView.j.
|
implementation |
Sets if the splitview dividers are vertical.
shouldBeVertical | - YES if the splitview dividers should be vertical, otherwise NO. |
Definition at line 181 of file CPSplitView.j.
|
implementation |
Reimplemented from CPView.
Definition at line 129 of file CPSplitView.j.
|
implementation |
Definition at line 461 of file CPSplitView.j.
|
implementation |
Called when the receiver has been moved to a new CPWindow.
Reimplemented from CPView.
Definition at line 551 of file CPSplitView.j.
|
implementation |
Reimplemented from CPView.
Definition at line 379 of file CPSplitView.j.
|
implementation |
Because we're use drawRect: to draw the dividers, but use DOM elements instead of CoreGraphics We must remove those DOM elements (the splitters) when the subview is removed.
Reimplemented from CPView.
Definition at line 322 of file CPSplitView.j.