2 // AITextColorPreviewViewInspector.m
5 // Created by Peter Hosey on 2006-05-11.
6 // Copyright 2006 The Adium Project. All rights reserved.
9 #import "AITextColorPreviewViewInspector.h"
11 @implementation AITextColorPreviewViewInspector
15 if((self = [super init])) {
16 [NSBundle loadNibNamed:@"AITextColorPreviewViewInspector" owner:self];
21 /* We're supposed to override this, but with Bindings, we don't need to.
22 Bindings in IB inspectors are kind of flaky, though, so I'm leaving this here for now, in case we need to use it.
31 - (void)revert:(id)sender
33 [self willChangeValueForKey:@"previewText"];
34 [self didChangeValueForKey:@"previewText"];
35 [self willChangeValueForKey:@"textColor"];
36 [self didChangeValueForKey:@"textColor"];
37 [self willChangeValueForKey:@"textShadowColor"];
38 [self didChangeValueForKey:@"textShadowColor"];
39 [self willChangeValueForKey:@"backgroundColor"];
40 [self didChangeValueForKey:@"backgroundColor"];
41 [self willChangeValueForKey:@"backgroundGradientColor"];
42 [self didChangeValueForKey:@"backgroundGradientColor"];
43 [self willChangeValueForKey:@"textShadowEnabled"];
44 [self didChangeValueForKey:@"textShadowEnabled"];
45 [self willChangeValueForKey:@"backgroundEnabled"];
46 [self didChangeValueForKey:@"backgroundEnabled"];
48 [super revert:sender];
51 #pragma Bindings accessors
53 //All of these forward data to/from the preview view.
55 - (NSString *) previewText {
56 return [[self object] previewText];
58 - (void) setPreviewText:(NSString *)newPreviewText {
59 [[self object] setPreviewText:newPreviewText];
61 //Bug in IB's Bindings support (if it has any): We can't call -ok: from here because this is a text field.
62 //Instead, we call it after a delay.
64 [self performSelector:@selector(ok:)
69 - (NSColor *) textColor {
70 return [[self object] textColor];
72 - (void) setTextColor:(NSColor *)newTextColor {
73 [[self object] setTextColor:newTextColor];
77 - (NSColor *) textShadowColor {
78 return [[self object] textShadowColor];
80 - (void) setTextShadowColor:(NSColor *)newTextShadowColor {
81 [[self object] setTextShadowColor:newTextShadowColor];
85 - (NSColor *) backgroundColor {
86 return [[self object] backgroundColor];
88 - (void) setBackgroundColor:(NSColor *)newBackgroundColor {
89 [[self object] setBackgroundColor:newBackgroundColor];
93 - (NSColor *) backgroundGradientColor {
94 return [[self object] backgroundGradientColor];
96 - (void) setBackgroundGradientColor:(NSColor *)newBackgroundGradientColor {
97 [[self object] setBackgroundGradientColor:newBackgroundGradientColor];
101 - (BOOL) textShadowEnabled {
102 return [[self object] textShadowEnabled];
104 - (void) setTextShadowEnabled:(BOOL)flag {
105 [[self object] setTextShadowEnabled:flag];
109 - (BOOL) backgroundEnabled {
110 return [[self object] backgroundEnabled];
112 - (void) setBackgroundEnabled:(BOOL)flag {
113 [[self object] setBackgroundEnabled:flag];
119 @implementation AITextColorPreviewView (AdiumIBPaletteInspector)
121 - (NSString *)inspectorClassName {
122 return @"AITextColorPreviewViewInspector";