MYAnimatingSplitView.h
author snej@snej-mbp.mtv.corp.google.com
Tue Apr 07 11:13:25 2009 -0700 (2009-04-07)
changeset 23 a910102a1c9d
permissions -rw-r--r--
* Added MYReturnError.
* Better iPhone support in ExceptionUtils.
* Make sure "All Tests Passed/Failed" message is always logged.
     1 //
     2 //  MYAnimatingSplitView.h
     3 //  Cloudy
     4 //
     5 //  Created by Jens Alfke on 7/10/08.
     6 //  Copyright 2008 Jens Alfke. All rights reserved.
     7 //
     8 
     9 #import <AppKit/NSSplitView.h>
    10 
    11 
    12 @interface MYAnimatingSplitView : NSSplitView
    13 {
    14     NSTimeInterval _animationTime;
    15     BOOL _isLiveResizing;
    16 }
    17 
    18 
    19 /** The maximum time it will take to animate the divider. (Actual time depends on distance moved.) */
    20 @property NSTimeInterval animationTime;
    21 
    22 /** Pixel position of the divider (in the splitview's bounds' coordinate system.)
    23     Setting this property animates the divider to the new position. */
    24 @property float dividerPosition;
    25 
    26 /** Position of the divider, scaled to the range [0..1]. */
    27 @property float dividerFractionalPosition;
    28 
    29 - (void) collapseSubviewAtIndex: (int)index;
    30 - (void) collapseSubviewAtIndex: (int)index animate: (BOOL)animate;
    31 
    32 /** Returns YES while the splitview itself is being resized (i.e. while the window
    33     is resizing, or a parent splitview is moving its divider.) */
    34 @property (readonly) BOOL isLiveResizing;
    35 
    36 @end
    37 
    38 
    39 @interface NSObject (MYAnimatingSplitViewDelegate)
    40 /** If the delegate implements this method, it will be called when the splitview
    41     begins and ends live resizing. */
    42 - (void)splitView: (NSSplitView*)splitView inLiveResize: (BOOL)inLiveResize;
    43 @end