1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/MYAnimatingSplitView.h Wed Sep 02 08:41:25 2009 -0700
1.3 @@ -0,0 +1,43 @@
1.4 +//
1.5 +// MYAnimatingSplitView.h
1.6 +// Cloudy
1.7 +//
1.8 +// Created by Jens Alfke on 7/10/08.
1.9 +// Copyright 2008 Jens Alfke. All rights reserved.
1.10 +//
1.11 +
1.12 +#import <AppKit/NSSplitView.h>
1.13 +
1.14 +
1.15 +@interface MYAnimatingSplitView : NSSplitView
1.16 +{
1.17 + NSTimeInterval _animationTime;
1.18 + BOOL _isLiveResizing;
1.19 +}
1.20 +
1.21 +
1.22 +/** The maximum time it will take to animate the divider. (Actual time depends on distance moved.) */
1.23 +@property NSTimeInterval animationTime;
1.24 +
1.25 +/** Pixel position of the divider (in the splitview's bounds' coordinate system.)
1.26 + Setting this property animates the divider to the new position. */
1.27 +@property float dividerPosition;
1.28 +
1.29 +/** Position of the divider, scaled to the range [0..1]. */
1.30 +@property float dividerFractionalPosition;
1.31 +
1.32 +- (void) collapseSubviewAtIndex: (int)index;
1.33 +- (void) collapseSubviewAtIndex: (int)index animate: (BOOL)animate;
1.34 +
1.35 +/** Returns YES while the splitview itself is being resized (i.e. while the window
1.36 + is resizing, or a parent splitview is moving its divider.) */
1.37 +@property (readonly) BOOL isLiveResizing;
1.38 +
1.39 +@end
1.40 +
1.41 +
1.42 +@interface NSObject (MYAnimatingSplitViewDelegate)
1.43 +/** If the delegate implements this method, it will be called when the splitview
1.44 + begins and ends live resizing. */
1.45 +- (void)splitView: (NSSplitView*)splitView inLiveResize: (BOOL)inLiveResize;
1.46 +@end