1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
//
// MTextFieldCell.m
// MySQLGUICommon
//
// Created by Alfredo Kojima on 06/4/30.
// Copyright 2006 MySQL AB. All rights reserved.
//
#import "MTextFieldCell.h"
@implementation MTextFieldCell
- (id)initCopyingCell:(NSTextFieldCell*)cell
{
self= [super initTextCell:[cell stringValue]];
[self setFont:[cell font]];
[self setAlignment:[cell alignment]];
[self setBordered:[cell isBordered]];
[self setBezeled:[cell isBezeled]];
[self setBackgroundColor:[cell backgroundColor]];
[self setTextColor:[cell textColor]];
return self;
}
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
NSRect rect;
rect.origin= NSMakePoint(0, 0);
rect.size= [self cellSizeForBounds:cellFrame];
if (NSHeight(rect) < NSHeight(cellFrame))
{
cellFrame.origin.y-= (NSHeight(rect) - NSHeight(cellFrame)) / 2;
}
[super drawInteriorWithFrame:cellFrame inView:controlView];
}
@end
|