Last change
on this file since 500 was 433, checked in by Nicholas Riley, 17 years ago |
Undocumented method / hack fallback to determine whether we should draw the highlighted row as active.
|
File size:
1.1 KB
|
Line | |
---|
1 | //
|
---|
2 | // ICeCoffEEInvertingTextFieldCell.m
|
---|
3 | // ICeCoffEE
|
---|
4 | //
|
---|
5 | // Created by Nicholas Riley on 2/29/08.
|
---|
6 | // Copyright 2008 Nicholas Riley. All rights reserved.
|
---|
7 | //
|
---|
8 |
|
---|
9 | #import "ICeCoffEEInvertingTextFieldCell.h"
|
---|
10 | #import "ICeCoffEEMenuOutlineView.h"
|
---|
11 |
|
---|
12 |
|
---|
13 | @implementation ICeCoffEEInvertingTextFieldCell
|
---|
14 |
|
---|
15 | - (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
|
---|
16 | {
|
---|
17 | return nil;
|
---|
18 | }
|
---|
19 |
|
---|
20 | - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
|
---|
21 | {
|
---|
22 | if ([self isHighlighted] && ICCF_ViewHasKeyboardFocus(controlView)) {
|
---|
23 | NSMutableAttributedString *astr = [[self attributedStringValue] mutableCopy];
|
---|
24 | unsigned location = 0, length = [astr length];
|
---|
25 | NSRange range;
|
---|
26 | while (location < length) {
|
---|
27 | if ([astr attribute: NSForegroundColorAttributeName atIndex: location effectiveRange: &range] == nil) {
|
---|
28 | [astr addAttribute: NSForegroundColorAttributeName value: [NSColor whiteColor]
|
---|
29 | range: range];
|
---|
30 | }
|
---|
31 | location += range.length;
|
---|
32 | }
|
---|
33 | [self setAttributedStringValue: astr];
|
---|
34 | [astr release];
|
---|
35 | }
|
---|
36 | [super drawWithFrame: cellFrame inView: controlView];
|
---|
37 | }
|
---|
38 |
|
---|
39 | @end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.