1/*
2    File:		MBCStretchyTextCell.mm
3    Contains:	Text cell that can draw outside its boundary
4    Copyright:	© 2002-2011 by Apple Inc., all rights reserved.
5
6    IMPORTANT: This Apple software is supplied to you by Apple Computer,
7    Inc.  ("Apple") in consideration of your agreement to the following
8    terms, and your use, installation, modification or redistribution of
9    this Apple software constitutes acceptance of these terms.  If you do
10    not agree with these terms, please do not use, install, modify or
11    redistribute this Apple software.
12
13    In consideration of your agreement to abide by the following terms,
14    and subject to these terms, Apple grants you a personal, non-exclusive
15    license, under Apple's copyrights in this original Apple software (the
16    "Apple Software"), to use, reproduce, modify and redistribute the
17    Apple Software, with or without modifications, in source and/or binary
18    forms; provided that if you redistribute the Apple Software in its
19    entirety and without modifications, you must retain this notice and
20    the following text and disclaimers in all such redistributions of the
21    Apple Software.  Neither the name, trademarks, service marks or logos
22    of Apple Inc. may be used to endorse or promote products
23    derived from the Apple Software without specific prior written
24    permission from Apple.  Except as expressly stated in this notice, no
25    other rights or licenses, express or implied, are granted by Apple
26    herein, including but not limited to any patent rights that may be
27    infringed by your derivative works or by other works in which the
28    Apple Software may be incorporated.
29
30    The Apple Software is provided by Apple on an "AS IS" basis.  APPLE
31    MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
32    THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND
33    FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS
34    USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
35
36    IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT,
37    INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
38    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
39    PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE,
40    REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE,
41    HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING
42    NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
43    ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44*/
45
46#import "MBCStretchyTextCell.h"
47
48
49@implementation MBCStretchyTextCell
50
51- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
52{
53	if ([[self stringValue] length] > 2) {
54		cellFrame.origin.x		-= 50;
55		cellFrame.size.width	+= 100;
56	} else {
57		cellFrame.origin.x		-= 3;
58		cellFrame.size.width	+= 6;
59	}
60	[super drawInteriorWithFrame:cellFrame inView:controlView];
61}
62
63@end
64