forked from ttscoff/nv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ETScrollView.m
94 lines (78 loc) · 2.34 KB
/
ETScrollView.m
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//
// ETScrollView.m
// Notation
//
// Created by elasticthreads on 3/14/11.
//
#import "ETScrollView.h"
#import "ETTransparentScroller.h"
@implementation ETScrollView
- (id)init
{
self = [super init];
if (self) {
// Initialization code here.
}
return self;
}
- (void)dealloc
{
[super dealloc];
}
- (NSView *)hitTest:(NSPoint)aPoint{
if (NSPointInRect (aPoint,[[self verticalScroller] frame])) {
return [self verticalScroller];
}else{
return [self documentView];
}
}
- (void)awakeFromNib{
if (!IsLionOrLater) {
// ETTransparentScroller *tScroll = [[[ETTransparentScroller alloc]init] retain];
[self setVerticalScroller:[[ETTransparentScroller alloc]init]];
// [tScroll release];
}
}
/*
- (void)drawRect:(NSRect)rect{
[super drawRect:rect];
// rect = [self frame];
NSRect cornerRect = [[self verticalScroller] frame];
cornerRect.size.height = cornerRect.size.width;
cornerRect.origin.x = rect.origin.x + rect.size.width - cornerRect.size.width;
cornerRect.origin.y += [[self verticalScroller] frame].size.height;
cornerRect.origin.y -= 5;//cornerRect.size.height;
[[NSColor redColor] setFill];
NSRectFill(cornerRect);
}
- (void)tile{
[super tile];
if ([self hasVerticalScroller]) {
// NSLog(@"subviwes are: %@",[[self subviews] description]);
//NSRect docRect = [self frame];
// docRect.size.width -=40;
//[self setFrame:docRect];
// NSRect docRect = [self frame];
// NSRect clipRect = [[self contentView] frame];
// NSRect scrollRect = [[self verticalScroller] frame];
//NSRect bRect = [self frame];
//bRect.size.width +=28;
// [self setFrame:bRect];
// cornerRect.size.height = cornerRect.size.width;
// cornerRect.origin.x -=200;
// cornerRect.origin.y +=200;
// clipRect.size.width -=280;
// docRect.size.width +=15;
// [self setFrame:docRect];
// clipRect.size.width -=55;
//[[self contentView] setFrame:clipRect];
//scrollRect.origin.x +=15;
// [[self verticalScroller]setFrame:scrollRect];
// [[self horizontalScroller]setFrame:cornerRect];
//[[NSColor redColor] setFill];
// NSRectFill(cornerRect);
//[self setNeedsDisplay:YES];
}
//}
}*/
@end