Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 97 lines (80 sloc) 2.223 kb
a36ea6a Alex Gordon Now lets you search inside files and will cut your hair
authored
1 //
2 // IGKFindWindow.m
3 // Ingredients
4 //
5 // Created by Alex Gordon on 18/04/2010.
f109712 Adjusted things
Alex Gordon authored
6 // Written in 2010 by Fileability.
a36ea6a Alex Gordon Now lets you search inside files and will cut your hair
authored
7 //
8
9 #import "IGKFindWindow.h"
10
11
12 @implementation IGKFindWindow
13
14 - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
15 {
16 if (self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:bufferingType defer:flag])
17 {
18 [self setBackgroundColor:[NSColor clearColor]];
19 [self setOpaque:NO];
20 [self setHasShadow:NO];
21 }
22
23 return self;
24 }
25
527080d Alex Gordon Few minor UI bugs fixed
authored
26
27 //This is a bit of a hack to ensure the parent's window controller gets action messages. We forward everything we don't respond to, to the parent's window controller
28 - (id)actionForwardee
29 {
30 return [[self parentWindow] windowController];
31 }
32 - (BOOL)respondsToSelector:(SEL)aSelector
33 {
34 if ([super respondsToSelector:aSelector])
35 return YES;
36 if ([[self actionForwardee] respondsToSelector:aSelector])
37 return YES;
38 return NO;
39 }
40 - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
41 {
42 if ([super respondsToSelector:aSelector])
43 return [super methodSignatureForSelector:aSelector];
44
45 id forwardee = [self actionForwardee];
46 if ([forwardee respondsToSelector:aSelector])
47 return [forwardee methodSignatureForSelector:aSelector];
48
49 return [super methodSignatureForSelector:aSelector];
50 }
51 - (void)forwardInvocation:(NSInvocation *)anInvocation
a36ea6a Alex Gordon Now lets you search inside files and will cut your hair
authored
52 {
527080d Alex Gordon Few minor UI bugs fixed
authored
53 id forwardee = [self actionForwardee];
a36ea6a Alex Gordon Now lets you search inside files and will cut your hair
authored
54
527080d Alex Gordon Few minor UI bugs fixed
authored
55 if ([forwardee respondsToSelector:[anInvocation selector]])
56 {
57 [anInvocation invokeWithTarget:forwardee];
58 }
59 else
60 {
61 [super forwardInvocation:anInvocation];
62 }
a36ea6a Alex Gordon Now lets you search inside files and will cut your hair
authored
63 }
64
527080d Alex Gordon Few minor UI bugs fixed
authored
65 - (void)becomeKeyWindow
66 {
67 [super becomeKeyWindow];
68
69 //If this window becomes key, we should make the parent window main
31c719e ...
Alex Gordon authored
70 if ([[self parentWindow] canBecomeMainWindow])
71 [[self parentWindow] makeMainWindow];
527080d Alex Gordon Few minor UI bugs fixed
authored
72 }
73 - (void)becomeMainWindow
a36ea6a Alex Gordon Now lets you search inside files and will cut your hair
authored
74 {
527080d Alex Gordon Few minor UI bugs fixed
authored
75 [super becomeMainWindow];
a36ea6a Alex Gordon Now lets you search inside files and will cut your hair
authored
76
527080d Alex Gordon Few minor UI bugs fixed
authored
77 //Ditto here. For some reason Apple sends -becomeKeyWindow first then -becomeMainWindow
31c719e ...
Alex Gordon authored
78 if ([[self parentWindow] canBecomeMainWindow])
79 [[self parentWindow] makeMainWindow];
a36ea6a Alex Gordon Now lets you search inside files and will cut your hair
authored
80 }
81
82 - (BOOL)canBecomeKeyWindow
83 {
84 return YES;
85 }
86 - (BOOL)canBecomeMainWindow
87 {
88 return YES;
89 }
90 - (BOOL)acceptsFirstResponder
91 {
92 return YES;
93 }
94
95
96 @end
Something went wrong with that request. Please try again.