gwenhywfar 5.10.1
CocoaVLineView.m
Go to the documentation of this file.
1//
2// CocoaHLineView.m
3//
4//
5// Created by Samuel Strupp on 10.08.10.
6//
7
8#ifdef HAVE_CONFIG_H
9# include <config.h>
10#endif
11
12
13
14#import "CocoaVLineView.h"
15
16
17@implementation CocoaVLineView
18
19@synthesize fillX;
20@synthesize fillY;
21
22- (id)initWithFrame:(NSRect)frame {
23 self = [super initWithFrame:frame];
24 if (self) {
25 // Initialization code here.
26 fillX = NO;
27 fillY = NO;
28 }
29 return self;
30}
31
32-(void) dealloc {
33 [super dealloc];
34}
35
36- (void)drawRect:(NSRect)dirtyRect {
37 NSRect bounds = [self bounds];
38 [[NSColor grayColor] set];
39 NSBezierPath *line = [NSBezierPath bezierPath];
40 CGFloat x = bounds.origin.x+bounds.size.width/2.0;
41 [line moveToPoint:NSMakePoint(x, bounds.origin.y)];
42 [line lineToPoint:NSMakePoint(x, bounds.origin.y + bounds.size.height)];
43 [line stroke];
44}
45
46#pragma mark Protocoll Methods
47
48- (NSSize) minSize {
49 return NSMakeSize(3.0, 3.0);
50}
51
52- (BOOL) fillX {
53 return fillX;
54}
55
56- (BOOL) fillY {
57 return fillY;
58}
59
60@end