gwenhywfar 5.10.1
CocoaHLineView.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#import "CocoaHLineView.h"
14
15
16@implementation CocoaHLineView
17
18@synthesize fillX;
19@synthesize fillY;
20
21- (id)initWithFrame:(NSRect)frame {
22 self = [super initWithFrame:frame];
23 if (self) {
24 fillX = NO;
25 fillY = NO;
26 }
27 return self;
28}
29
30-(void) dealloc {
31 [super dealloc];
32}
33
34- (void)drawRect:(NSRect)dirtyRect {
35 NSRect bounds = [self bounds];
36 [[NSColor grayColor] set];
37 NSBezierPath *line = [NSBezierPath bezierPath];
38 CGFloat y = bounds.origin.y+bounds.size.height/2.0;
39 [line moveToPoint:NSMakePoint(bounds.origin.x, y)];
40 [line lineToPoint:NSMakePoint(bounds.origin.x + bounds.size.width, y)];
41 [line stroke];
42}
43
44#pragma mark Protocoll Methods
45
46- (NSSize) minSize {
47 return NSMakeSize(3.0, 3.0);
48}
49
50- (BOOL) fillX {
51 return fillX;
52}
53
54- (BOOL) fillY {
55 return fillY;
56}
57
58@end