jens@16: // jens@16: // MYAnimatingSplitView.h jens@16: // Cloudy jens@16: // jens@16: // Created by Jens Alfke on 7/10/08. jens@16: // Copyright 2008 Jens Alfke. All rights reserved. jens@16: // jens@16: jens@16: #import jens@16: jens@16: jens@16: @interface MYAnimatingSplitView : NSSplitView jens@16: { jens@16: NSTimeInterval _animationTime; jens@16: BOOL _isLiveResizing; jens@16: } jens@16: jens@16: jens@16: /** The maximum time it will take to animate the divider. (Actual time depends on distance moved.) */ jens@16: @property NSTimeInterval animationTime; jens@16: jens@16: /** Pixel position of the divider (in the splitview's bounds' coordinate system.) jens@16: Setting this property animates the divider to the new position. */ jens@16: @property float dividerPosition; jens@16: jens@16: /** Position of the divider, scaled to the range [0..1]. */ jens@16: @property float dividerFractionalPosition; jens@16: jens@16: - (void) collapseSubviewAtIndex: (int)index; jens@16: - (void) collapseSubviewAtIndex: (int)index animate: (BOOL)animate; jens@16: jens@16: /** Returns YES while the splitview itself is being resized (i.e. while the window jens@16: is resizing, or a parent splitview is moving its divider.) */ jens@16: @property (readonly) BOOL isLiveResizing; jens@16: jens@16: @end jens@16: jens@16: jens@16: @interface NSObject (MYAnimatingSplitViewDelegate) jens@16: /** If the delegate implements this method, it will be called when the splitview jens@16: begins and ends live resizing. */ jens@16: - (void)splitView: (NSSplitView*)splitView inLiveResize: (BOOL)inLiveResize; jens@16: @end