class library: Spawner - don't access PriorityQueue-array
[supercollider.git] / editors / scapp / SMLAdvancedFind / SMLStatusBarTextFieldCell.m
blob805d0ecc001d656d7cee49955fbc370df933b9e1
1 /*
2 Smultron version 3.1, 2007-05-19
3 Written by Peter Borg, pgw3@mac.com
4 Find the latest version at http://smultron.sourceforge.net
6 Copyright 2004-2007 Peter Borg
7  
8 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
9  
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
16 #import "SMLStatusBarTextFieldCell.h"
18 @implementation SMLStatusBarTextFieldCell
21 - (id)initTextCell:(NSString *)text
23     if (self = [super initTextCell:text]) {
24                 
25 //              statusBarGradient = [[CTGradient statusBarGradient] retain];
26                 
27                 [self setTitle:@" "];
28                 attributes = [[NSMutableDictionary dictionaryWithDictionary:[[self attributedStringValue] attributesAtIndex:0 effectiveRange:NULL]] mutableCopy];
29                 [attributes setValue:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]  forKey:NSFontAttributeName];
30                 [attributes setValue:[NSColor colorWithCalibratedWhite:0.05 alpha:0.9] forKey:@"NSColor"];
31         return self;
32     }
33     return nil;
37 - (void)drawWithFrame:(NSRect)inFrame inView:(NSView *)inView
39     [statusBarGradient fillRect:inFrame angle:90];
40         
41     NSRect centeredRect = inFrame;
42     centeredRect.size = [[self stringValue] sizeWithAttributes:attributes];
43     centeredRect.origin.x += ((inFrame.size.width - centeredRect.size.width) / 2.0);
44     centeredRect.origin.y = ((inFrame.size.height - centeredRect.size.height) / 2.0) - 1;
45         
46     [[self stringValue] drawInRect:centeredRect withAttributes:attributes];
50 - (void)dealloc
52         [attributes release];
53         
54         attributes = nil;
55         
56         [super dealloc];
58 @end