gwenhywfar 4.0.3
|
00001 // 00002 // CocoaHLineView.m 00003 // 00004 // 00005 // Created by Samuel Strupp on 10.08.10. 00006 // 00007 00008 #ifdef HAVE_CONFIG_H 00009 # include <config.h> 00010 #endif 00011 00012 00013 #import "CocoaHLineView.h" 00014 00015 00016 @implementation CocoaHLineView 00017 00018 @synthesize fillX; 00019 @synthesize fillY; 00020 00021 - (id)initWithFrame:(NSRect)frame { 00022 self = [super initWithFrame:frame]; 00023 if (self) { 00024 fillX = NO; 00025 fillY = NO; 00026 } 00027 return self; 00028 } 00029 00030 -(void) dealloc { 00031 [super dealloc]; 00032 } 00033 00034 - (void)drawRect:(NSRect)dirtyRect { 00035 NSRect bounds = [self bounds]; 00036 [[NSColor grayColor] set]; 00037 NSBezierPath *line = [NSBezierPath bezierPath]; 00038 CGFloat y = bounds.origin.y+bounds.size.height/2.0; 00039 [line moveToPoint:NSMakePoint(bounds.origin.x, y)]; 00040 [line lineToPoint:NSMakePoint(bounds.origin.x + bounds.size.width, y)]; 00041 [line stroke]; 00042 } 00043 00044 #pragma mark Protocoll Methods 00045 00046 - (NSSize) minSize { 00047 return NSMakeSize(3.0, 3.0); 00048 } 00049 00050 - (BOOL) fillX { 00051 return fillX; 00052 } 00053 00054 - (BOOL) fillY { 00055 return fillY; 00056 } 00057 00058 @end