summaryrefslogtreecommitdiff
path: root/tikzit/src/osx/MultiCombo.m
blob: 893046013fb6189fdb44fb82217db6cb39ebe87e (plain)
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
//
//  MultiCombo.m
//  TikZiT
//
//  Created by Aleks Kissinger on 21/04/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "MultiCombo.h"


@implementation MultiCombo

- (void)textDidChange:(NSNotification *)notification {
	[super textDidChange:notification];
	[self setMulti:NO];
}

- (void)setMulti:(BOOL)m {
	multi = m;
	if (multi) {
		[self setTextColor:[NSColor grayColor]];
		[self setStringValue:@"multiple values"];
	}
}

- (BOOL)multi { return multi; }

- (BOOL)becomeFirstResponder {
	[super becomeFirstResponder];
	if ([self multi]) {
		[self setTextColor:[NSColor blackColor]];
		[self setStringValue:@""];
	}
	return YES;
}

@end