gwenhywfar
4.3.1
|
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 00014 #import "CocoaVLineView.h" 00015 00016 00017 @implementation CocoaVLineView 00018 00019 @synthesize fillX; 00020 @synthesize fillY; 00021 00022 - (id)initWithFrame:(NSRect)frame { 00023 self = [super initWithFrame:frame]; 00024 if (self) { 00025 // Initialization code here. 00026 fillX = NO; 00027 fillY = NO; 00028 } 00029 return self; 00030 } 00031 00032 -(void) dealloc { 00033 [super dealloc]; 00034 } 00035 00036 - (void)drawRect:(NSRect)dirtyRect { 00037 NSRect bounds = [self bounds]; 00038 [[NSColor grayColor] set]; 00039 NSBezierPath *line = [NSBezierPath bezierPath]; 00040 CGFloat x = bounds.origin.x+bounds.size.width/2.0; 00041 [line moveToPoint:NSMakePoint(x, bounds.origin.y)]; 00042 [line lineToPoint:NSMakePoint(x, bounds.origin.y + bounds.size.height)]; 00043 [line stroke]; 00044 } 00045 00046 #pragma mark Protocoll Methods 00047 00048 - (NSSize) minSize { 00049 return NSMakeSize(3.0, 3.0); 00050 } 00051 00052 - (BOOL) fillX { 00053 return fillX; 00054 } 00055 00056 - (BOOL) fillY { 00057 return fillY; 00058 } 00059 00060 @end