API  0.9.6
 All Classes Files Functions Variables Macros Modules Pages
CPSplitView Class Reference

#import <CPSplitView.h>

+ Inheritance diagram for CPSplitView:

Instance Methods

(void) - adjustSubviews
 
(CPString- autosaveName
 
(BOOL) - cursorAtPoint:hitDividerAtIndex:
 
(void) - didAddSubview:
 
(float) - dividerThickness
 
(void) - drawDividerInRect:
 
(void) - drawRect:
 
(CGRect) - effectiveRectOfDividerAtIndex:
 
(void) - encodeWithCoder:
 
(CPView- hitTest:
 
(id) - initWithCoder:
 
(id) - initWithFrame:
 
(BOOL) - isPaneSplitter
 
(BOOL) - isSubviewCollapsed:
 
(BOOL) - isVertical
 
(void) - layoutSubviews
 
(float) - maxPossiblePositionOfDividerAtIndex:
 
(float) - minPossiblePositionOfDividerAtIndex:
 
(void) - mouseDown:
 
(void) - mouseEntered:
 
(void) - mouseExited:
 
(void) - mouseMoved:
 
(CGRect) - rectOfDividerAtIndex:
 
(void) - resizeSubviewsWithOldSize:
 
(void) - setAutosaveName:
 
(void) - setButtonBar:forDividerAtIndex:
 
(void) - setDelegate:
 
(void) - setFrameSize:
 
(void) - setIsPaneSplitter:
 
(void) - setPosition:ofDividerAtIndex:
 
(void) - setVertical:
 
(void) - trackDivider:
 
(void) - viewDidMoveToWindow
 
(void) - viewWillDraw
 
(void) - willRemoveSubview:
 
- Instance Methods inherited from CPView
(BOOL) - acceptsFirstMouse:
 
(void) - addSubview:
 
(void) - addSubview:positioned:relativeTo:
 
(CGRect) - adjustScroll:
 
(float) - alphaValue
 
(BOOL) - autoresizesSubviews
 
(unsigned) - autoresizingMask
 
(BOOL) - autoscroll:
 
(CPColor- backgroundColor
 
(CGRect) - bounds
 
(CGPoint) - boundsOrigin
 
(CGSize) - boundsSize
 
(BOOL) - canBecomeKeyView
 
(CGPoint) - center
 
(BOOL) - clipsToBounds
 
(CGPoint) - convertPoint:fromView:
 
(CGPoint) - convertPoint:toView:
 
(CGPoint) - convertPointFromBase:
 
(CGPoint) - convertPointToBase:
 
(CGRect) - convertRect:fromView:
 
(CGRect) - convertRect:toView:
 
(CGRect) - convertRectFromBase:
 
(CGRect) - convertRectToBase:
 
(CGSize) - convertSize:fromView:
 
(CGSize) - convertSize:toView:
 
(CPView- createEphemeralSubviewNamed:
 
(id) - currentValueForThemeAttribute:
 
(void) - display
 
(void) - displayIfNeeded
 
(void) - displayIfNeededInRect:
 
(void) - displayRect:
 
(void) - displayRectIgnoringOpacity:inContext:
 
(void) - dragImage:at:offset:event:pasteboard:source:slideBack:
 
(void) - dragView:at:offset:event:pasteboard:source:slideBack:
 
(void) - drawRect:
 
(CPMenuItem- enclosingMenuItem
 
(CPScrollView- enclosingScrollView
 
(BOOL) - enterFullScreenMode
 
(BOOL) - enterFullScreenMode:withOptions:
 
(CPView- ephemeralSubviewNamed:
 
(void) - exitFullScreenMode
 
(void) - exitFullScreenModeWithOptions:
 
(CGRect) - frame
 
(CGPoint) - frameOrigin
 
(CGSize) - frameSize
 
(BOOL) - hasThemeAttribute:
 
(BOOL) - hasThemeState:
 
(CPView- hitTest:
 
(BOOL) - hitTests
 
(id) - init
 
(BOOL) - inLiveResize
 
(BOOL) - isDescendantOf:
 
(BOOL) - isFlipped
 
(BOOL) - isHidden
 
(BOOL) - isHiddenOrHasHiddenAncestor
 
(BOOL) - isInFullScreenMode
 
(BOOL) - isOpaque
 
(CALayer- layer
 
(CPView- layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:
 
(void) - layoutIfNeeded
 
(void) - lockFocus
 
(CPMenu- menuForEvent:
 
(BOOL) - mouseDownCanMoveWindow
 
(BOOL) - needsDisplay
 
(BOOL) - needsPanelToBecomeKey
 
(CPView- nextKeyView
 
(CPView- nextValidKeyView
 
(BOOL) - performKeyEquivalent:
 
(BOOL) - postsBoundsChangedNotifications
 
(BOOL) - postsFrameChangedNotifications
 
(CPView- previousKeyView
 
(CPView- previousValidKeyView
 
(CGRect) - rectForEphemeralSubviewNamed:
 
(void) - reflectScrolledClipView:
 
(CPArray- registeredDraggedTypes
 
(void) - registerForDraggedTypes:
 
(void) - registerThemeValues:
 
(void) - registerThemeValues:inherit:
 
(void) - removeFromSuperview
 
(void) - replaceSubview:with:
 
(void) - resizeSubviewsWithOldSize:
 
(void) - resizeWithOldSuperviewSize:
 
(void) - rightMouseDown:
 
(void) - scrollClipView:toPoint:
 
(void) - scrollPoint:
 
(void) - scrollRect:by:
 
(BOOL) - scrollRectToVisible:
 
(void) - setAlphaValue:
 
(void) - setAutoresizesSubviews:
 
(void) - setAutoresizingMask:
 
(void) - setBackgroundColor:
 
(void) - setBounds:
 
(void) - setBoundsOrigin:
 
(void) - setBoundsSize:
 
(void) - setCenter:
 
(void) - setClipsToBounds:
 
(void) - setFrame:
 
(void) - setFrameOrigin:
 
(void) - setHidden:
 
(void) - setHitTests:
 
(void) - setLayer:
 
(void) - setNeedsDisplay:
 
(void) - setNeedsDisplayInRect:
 
(void) - setNeedsLayout
 
(void) - setNextKeyView:
 
(void) - setPostsBoundsChangedNotifications:
 
(void) - setPostsFrameChangedNotifications:
 
(void) - setSubviews:
 
(void) - setTag:
 
(void) - setTheme:
 
(void) - setThemeClass:
 
(BOOL) - setThemeState:
 
(void) - setToolTip:
 
(void) - setValue:forThemeAttribute:
 
(void) - setValue:forThemeAttribute:inState:
 
(void) - setWantsLayer:
 
(CPArray- subviews
 
(CPView- superview
 
(CPInteger) - tag
 
(CPTheme- theme
 
(CPString- themeClass
 
(unsigned) - themeState
 
(CPString- toolTip
 
(void) - unlockFocus
 
(void) - unregisterDraggedTypes
 
(BOOL) - unsetThemeState:
 
(id) - valueForThemeAttribute:
 
(id) - valueForThemeAttribute:inState:
 
(void) - viewDidChangeTheme
 
(void) - viewDidEndLiveResize
 
(void) - viewDidHide
 
(void) - viewDidMoveToSuperview
 
(void) - viewDidUnhide
 
(void) - viewWillMoveToSuperview:
 
(void) - viewWillMoveToWindow:
 
(void) - viewWillStartLiveResize
 
(CPView- viewWithTag:
 
(CGRect) - visibleRect
 
(BOOL) - wantsLayer
 
(CPWindow- window
 
- Instance Methods inherited from CPResponder
(BOOL) - acceptsFirstResponder
 
(BOOL) - becomeFirstResponder
 
(void) - doCommandBySelector:
 
(void) - flagsChanged:
 
(void) - insertBackTab:
 
(void) - insertLineBreak:
 
(void) - insertNewline:
 
(void) - insertTab:
 
(void) - insertText:
 
(void) - interpretKeyEvents:
 
(void) - keyDown:
 
(void) - keyUp:
 
(CPMenu- menu
 
(void) - mouseDragged:
 
(void) - mouseUp:
 
(CPResponder- nextResponder
 
(void) - noResponderFor:
 
(BOOL) - resignFirstResponder
 
(void) - rightMouseUp:
 
(void) - scrollWheel:
 
(void) - setMenu:
 
(void) - setNextResponder:
 
(BOOL) - tryToPerform:with:
 
(CPUndoManager- undoManager
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(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:
 
(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:forKey:
 
(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

(CPString+ defaultThemeClass
 
(void) + initialize
 
(id) + themeAttributes
 
- Class Methods inherited from CPView
(CPMenu+ defaultMenu
 
(CPSet+ keyPathsForValuesAffectingBounds
 
(CPSet+ keyPathsForValuesAffectingFrame
 
- Class Methods inherited from CPObject
(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

- Instance Variables inherited from CPObject
Class isa
 

Detailed Description

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.

Method Documentation

- (void) adjustSubviews
implementation

Definition at line 804 of file CPSplitView.j.

- (CPString) autosaveName
implementation

Get the name under which the split view divider position is automatically saved to CPUserDefaults.

Returns
the name to save under or nil if no autosave is active

Definition at line 1079 of file CPSplitView.j.

- (BOOL) cursorAtPoint: (CGPoint)  aPoint
hitDividerAtIndex: (int)  anIndex 
implementation

Definition at line 399 of file CPSplitView.j.

+ (CPString) defaultThemeClass
implementation

Reimplemented from CPView.

Definition at line 97 of file CPSplitView.j.

- (void) didAddSubview: (CPView aSubview
implementation

Called when the receiver has added aSubview to it's child views.

Parameters
aSubviewthe view that was added

Reimplemented from CPView.

Definition at line 238 of file CPSplitView.j.

- (float) dividerThickness
implementation

Returns the thickness of the divider.

Returns
float - the thickness of the divider.

Definition at line 145 of file CPSplitView.j.

- (void) drawDividerInRect: (CGRect)  aRect
implementation

Draws the divider at a given rect.

Parameters
aRect- the rect of the divider to draw.

Definition at line 328 of file CPSplitView.j.

- (void) drawRect: (CGRect)  rect
implementation

Definition at line 288 of file CPSplitView.j.

- (CGRect) effectiveRectOfDividerAtIndex: (int)  aDivider
implementation

Returns the rect of the divider which the user is able to drag to resize.

Parameters
int- The index of the divider.
Returns
CGRect - The rect the user can drag.

Definition at line 277 of file CPSplitView.j.

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Archives the view to a coder.

Parameters
aCoderthe object into which the view's data will be archived.

Reimplemented from CPView.

Provided by category CPSplitView(CPCoding).

Definition at line 1270 of file CPSplitView.j.

- (CPView) hitTest: (CGPoint)  aPoint
implementation

Definition at line 425 of file CPSplitView.j.

+ (void) initialize
implementation

Reimplemented from CPView.

Definition at line 111 of file CPSplitView.j.

- (id) initWithCoder: (CPCoder aCoder
implementation

Initializes the view from an archive.

Parameters
aCoderthe coder from which to initialize
Returns
the initialized view

Reimplemented from CPView.

Provided by category CPSplitView(CPCoding).

Definition at line 1205 of file CPSplitView.j.

- (id) initWithFrame: (CGRect)  aFrame
implementation

Initializes the receiver for usage with the specified bounding rectangle

Returns
the initialized view

Reimplemented from CPView.

Definition at line 122 of file CPSplitView.j.

- (BOOL) isPaneSplitter
implementation

Use to find if the divider is a larger pane splitter.

Returns
BOOL - YES if the dividers are the larger pane splitters. Otherwise NO.

Definition at line 212 of file CPSplitView.j.

- (BOOL) isSubviewCollapsed: (CPView subview
implementation

Returns YES if the supplied subview is collapsed, otherwise NO.

Parameters
aSubview- the subview you are interested in.
Returns
BOOL - YES if the subview is collapsed, otherwise NO.

Definition at line 248 of file CPSplitView.j.

- (BOOL) isVertical
implementation

Returns YES if the dividers are vertical, otherwise NO.

Returns
YES if vertical, otherwise NO.

Definition at line 154 of file CPSplitView.j.

- (void) layoutSubviews
implementation

Reimplemented from CPView.

Definition at line 319 of file CPSplitView.j.

- (float) maxPossiblePositionOfDividerAtIndex: (int)  dividerIndex
implementation

Returns the maximum possible position of a divider at a given index.

Parameters
theindex of the divider.
Returns
float - the max possible position.

Definition at line 635 of file CPSplitView.j.

- (float) minPossiblePositionOfDividerAtIndex: (int)  dividerIndex
implementation

Returns the minimum possible position of a divider at a given index.

Parameters
theindex of the divider.
Returns
float - the min possible position.

Definition at line 650 of file CPSplitView.j.

- (void) mouseDown: (CPEvent anEvent
implementation

Notifies the receiver that the user has clicked the mouse down in its area.

Parameters
anEventcontains information about the click

Reimplemented from CPView.

Definition at line 530 of file CPSplitView.j.

- (void) mouseEntered: (CPEvent anEvent
implementation

Reimplemented from CPResponder.

Definition at line 542 of file CPSplitView.j.

- (void) mouseExited: (CPEvent anEvent
implementation

Notifies the receiver that the mouse exited the receiver's area.

Parameters
anEventcontains information about the exit

Reimplemented from CPResponder.

Definition at line 555 of file CPSplitView.j.

- (void) mouseMoved: (CPEvent anEvent
implementation

Notifies the receiver that the user has moved the mouse (with no buttons down).

Parameters
anEventcontains information about the movement

Reimplemented from CPResponder.

Definition at line 549 of file CPSplitView.j.

- (CGRect) rectOfDividerAtIndex: (int)  aDivider
implementation

Returns the CGRect of the divider at a given index.

Parameters
int- The index of a divider.
Returns
CGRect - The rect of a divider.

Definition at line 259 of file CPSplitView.j.

- (void) resizeSubviewsWithOldSize: (CPSize)  oldSize
implementation

Definition at line 793 of file CPSplitView.j.

- (void) setAutosaveName: (CPString autosaveName
implementation

Set the name under which the split view divider positions is automatically saved to CPUserDefaults.

Parameters
autosaveNamethe name to save under or nil to not save

Definition at line 1066 of file CPSplitView.j.

- (void) setButtonBar: (CPButtonBar aButtonBar
forDividerAtIndex: (unsigned)  dividerIndex 
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.

Parameters
CPButtonBar- The supplied button bar.
unsignedint - The divider index the button bar will be assigned to.

Definition at line 1003 of file CPSplitView.j.

- (void) setDelegate: (id)  delegate
implementation

Sets the delegate of the receiver. Possible delegate methods to implement are listed below.

Notifies the delegate when the subviews have resized.

- (void)splitViewDidResizeSubviews:(CPNotification)aNotification;

Notifies the delegate when the subviews will be resized.

- (void)splitViewWillResizeSubviews:(CPNotification)aNotification;

Allows the delegate to specify which of the CPSplitView's subviews should adjust if the window is resized.

- (BOOL)splitView:(CPSplitView)aSplitView shouldAdjustSizeOfSubview:(CPView)aSubView

Lets the delegate specify a different rect for which the user can drag the splitView divider.

- (CGRect)splitView:(CPSplitView)aSplitView effectiveRect:(CGRect)aRect forDrawnRect:(CGRect)aDrawnRect ofDividerAtIndex:(int)aDividerIndex;

Lets the delegate specify an additional rect for which the user can drag the splitview divider.

- (CGRect)splitView:(CPSplitView)aSplitView additionalEffectiveRectOfDividerAtIndex:(int)indexOfDivider;

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.

- (BOOL)splitView:(CPSplitView)aSplitView canCollapseSubview:(CPView)aSubview;

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.

- (BOOL)splitView:(CPSplitView)aSplitView shouldCollapseSubview:(CPView)aSubview forDoubleClickOnDividerAtIndex:(int)indexOfDivider;

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.

- (float)splitView:(CPSplitView)aSpiltView constrainSplitPosition:(float)proposedPosition ofSubviewAt:(int)subviewIndex;

Allows the delegate to constrain the minimum position of a subview.

- (float)splitView:(CPSplitView)aSplitView constrainMinCoordinate:(float)proposedMin ofSubviewAt:(int)subviewIndex;

Allows the delegate to constrain the maximum position of a subview.

- (float)splitView:(CPSplitView)aSplitView constrainMaxCoordinate:(float)proposedMax ofSubviewAt:(int)subviewIndex;

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.

- (void)splitView:(CPSplitView)aSplitView resizeSubviewsWithOldSize:(CGSize)oldSize;
@param delegate - The delegate of the splitview.

Definition at line 966 of file CPSplitView.j.

- (void) setFrameSize: (CGSize)  aSize
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.

Parameters
aSizethe new size for the frame

Reimplemented from CPView.

Definition at line 778 of file CPSplitView.j.

- (void) setIsPaneSplitter: (BOOL)  shouldBePaneSplitter
implementation

Used to set if the split view dividers should be the larger pane splitter.

Parameters
shouldBePaneSplitter- YES if the dividers should be the thicker pane splitter, otherwise NO.

Definition at line 222 of file CPSplitView.j.

- (void) setPosition: (float)  position
ofDividerAtIndex: (int)  dividerIndex 
implementation

Sets the position of a divider at a given index.

Parameters
position- The float value of the position to place the divider.
dividerIndex- The index of the divider to position.

Definition at line 721 of file CPSplitView.j.

- (void) setVertical: (BOOL)  shouldBeVertical
implementation

Sets if the splitview dividers are vertical.

Parameters
shouldBeVertical- YES if the splitview dividers should be vertical, otherwise NO.

Definition at line 163 of file CPSplitView.j.

+ (id) themeAttributes
implementation

Reimplemented from CPView.

Definition at line 102 of file CPSplitView.j.

- (void) trackDivider: (CPEvent anEvent
implementation

Definition at line 446 of file CPSplitView.j.

- (void) viewDidMoveToWindow
implementation

Called when the receiver has been moved to a new CPWindow.

Reimplemented from CPView.

Definition at line 536 of file CPSplitView.j.

- (void) viewWillDraw
implementation

Reimplemented from CPView.

Definition at line 361 of file CPSplitView.j.

- (void) willRemoveSubview: (CPView aView
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 304 of file CPSplitView.j.


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