MYAnimatingSplitView.h
author Jens Alfke <jens@mooseyard.com>
Sun Jul 13 10:45:42 2008 -0700 (2008-07-13)
changeset 16 ce9c83f7ec14
permissions -rw-r--r--
* Minor fixes to glitches detected by the clang static analyzer.
* Added MYAnimatingSplitView class.
     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