MYAnimatingSplitView.h
author Jens Alfke <jens@mooseyard.com>
Wed Sep 02 08:41:25 2009 -0700 (2009-09-02)
changeset 35 5cab3034d3a1
permissions -rw-r--r--
10.6 compatibility: Fix some new compiler warnings, and work around apparent regressions in NSTask and -stringByStandardizingPath.
jens@16
     1
//
jens@16
     2
//  MYAnimatingSplitView.h
jens@16
     3
//  Cloudy
jens@16
     4
//
jens@16
     5
//  Created by Jens Alfke on 7/10/08.
jens@16
     6
//  Copyright 2008 Jens Alfke. All rights reserved.
jens@16
     7
//
jens@16
     8
jens@16
     9
#import <AppKit/NSSplitView.h>
jens@16
    10
jens@16
    11
jens@16
    12
@interface MYAnimatingSplitView : NSSplitView
jens@16
    13
{
jens@16
    14
    NSTimeInterval _animationTime;
jens@16
    15
    BOOL _isLiveResizing;
jens@16
    16
}
jens@16
    17
jens@16
    18
jens@16
    19
/** The maximum time it will take to animate the divider. (Actual time depends on distance moved.) */
jens@16
    20
@property NSTimeInterval animationTime;
jens@16
    21
jens@16
    22
/** Pixel position of the divider (in the splitview's bounds' coordinate system.)
jens@16
    23
    Setting this property animates the divider to the new position. */
jens@16
    24
@property float dividerPosition;
jens@16
    25
jens@16
    26
/** Position of the divider, scaled to the range [0..1]. */
jens@16
    27
@property float dividerFractionalPosition;
jens@16
    28
jens@16
    29
- (void) collapseSubviewAtIndex: (int)index;
jens@16
    30
- (void) collapseSubviewAtIndex: (int)index animate: (BOOL)animate;
jens@16
    31
jens@16
    32
/** Returns YES while the splitview itself is being resized (i.e. while the window
jens@16
    33
    is resizing, or a parent splitview is moving its divider.) */
jens@16
    34
@property (readonly) BOOL isLiveResizing;
jens@16
    35
jens@16
    36
@end
jens@16
    37
jens@16
    38
jens@16
    39
@interface NSObject (MYAnimatingSplitViewDelegate)
jens@16
    40
/** If the delegate implements this method, it will be called when the splitview
jens@16
    41
    begins and ends live resizing. */
jens@16
    42
- (void)splitView: (NSSplitView*)splitView inLiveResize: (BOOL)inLiveResize;
jens@16
    43
@end