forked from ttscoff/nv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTagEditingManager.m
86 lines (68 loc) · 1.53 KB
/
TagEditingManager.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
//
// TagEditingManager.m
// Notation
//
// Created by elasticthreads on 10/15/10.
//
#import "TagEditingManager.h"
#import "AppController.h"
@implementation TagEditingManager
- (id)init
{
if ([super init]) {
if (![NSBundle loadNibNamed:@"TagEditingManager" owner:self]) {
NSLog(@"Failed to load TagEditer.nib");
}
}
return self;
}
- (void)dealloc{
[tagPanel release];
[tagField release];
[super dealloc];
}
- (void)awakeFromNib {
[tagField setStringValue:@""];
// [tagField setDelegate:self];
}
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command{
if (command == @selector(cancelOperation:)) {
[tagPanel orderOut:self];
NSLog(@"tagman cancaelr");
//[self closeTP:self];
}
return NO;
}
- (NSString *)newMultinoteLabels{
return [[NSString stringWithString:[tagField stringValue]]retain];
}
- (void)setTF:(NSString *)inString{
[tagField setStringValue:inString];
}
- (void)popTP:(id)sender{
[tagPanel center];
[tagPanel makeKeyAndOrderFront:sender];
isHappening = YES;
}
- (void)setDel:(id)sender{
[tagPanel setDelegate:sender];
[tagField setDelegate:sender];
// [[tagPanel fieldEditor:YES forObject:tagField]setDelegate:sender];
}
- (void)closeTP:(id)sender{
if (isHappening &&([tagPanel isVisible])) {
[tagPanel orderOut:sender];
}
isHappening = NO;
[tagField setStringValue:@""];
}
- (NSPanel *)tagPanel {
return tagPanel;
}
- (NSTextField *)tagField{
return tagField;
}
- (BOOL)isMultitagging{
return isHappening;
}
@end