- (void)clear {
self.keyCode = NJKeyInputFieldEmpty;
- [self.keyDelegate keyInputFieldDidClear:self];
+ if ([self.delegate respondsToSelector:@selector(keyInputFieldDidClear:)])
+ [self.delegate keyInputFieldDidClear:self];
[self resignIfFirstResponder];
}
if ((event.modifierFlags & IGNORE) && event.keyCode == 0x33) {
// Allow Alt/Command+Backspace to clear the field.
self.keyCode = NJKeyInputFieldEmpty;
- [self.keyDelegate keyInputFieldDidClear:self];
+ if ([self.delegate respondsToSelector:@selector(keyInputFieldDidClear:)])
+ [self.delegate keyInputFieldDidClear:self];
} else if (!(event.modifierFlags & IGNORE)) {
self.keyCode = event.keyCode;
- [self.keyDelegate keyInputField:self didChangeKey:self.keyCode];
+ if ([self.delegate respondsToSelector:@selector(keyInputField:didChangeKey:)])
+ [self.delegate keyInputField:self didChangeKey:self.keyCode];
}
[self resignIfFirstResponder];
}
// modifiers are still down.
if (!(theEvent.modifierFlags & NSDeviceIndependentModifierFlagsMask)) {
self.keyCode = theEvent.keyCode;
- [self.keyDelegate keyInputField:self didChangeKey:_keyCode];
+ if ([self.delegate respondsToSelector:@selector(keyInputField:didChangeKey:)])
+ [self.delegate keyInputField:self didChangeKey:_keyCode];
}
}
+- (void)setDelegate:(id<NJKeyInputFieldDelegate, NSTextFieldDelegate>)delegate {
+ [super setDelegate:delegate];
+}
+
+- (id <NJKeyInputFieldDelegate, NSTextFieldDelegate>)delegate {
+ return (id)[super delegate];
+}
+
@end
<string key="NSFrameSize">{232, 321}</string>
<reference key="NSSuperview" ref="698362889"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="1036252745"/>
+ <reference key="NSNextKeyView" ref="892486973"/>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<bool key="NSControlAllowsExpansionToolTips">YES</bool>
<string key="NSFrameSize">{234, 323}</string>
<reference key="NSSuperview" ref="734312853"/>
<reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="892486973"/>
+ <reference key="NSNextKeyView" ref="698362889"/>
<int key="NSsFlags">150034</int>
<reference key="NSVScroller" ref="1036252745"/>
<reference key="NSHScroller" ref="892486973"/>
</object>
<int key="connectionID">826</int>
</object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">translatingEventsMenu</string>
- <reference key="source" ref="1007832501"/>
- <reference key="destination" ref="632598200"/>
- </object>
- <int key="connectionID">877</int>
- </object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">translatingEventsChanged:</string>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">keyDelegate</string>
+ <string key="label">delegate</string>
<reference key="source" ref="57697638"/>
<reference key="destination" ref="801536542"/>
</object>
- <int key="connectionID">818</int>
+ <int key="connectionID">966</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
- <int key="maxID">965</int>
+ <int key="maxID">966</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<string key="outlineView">NSOutlineView</string>
<string key="outputController">NJOutputController</string>
<string key="translatingEventsButton">NSButton</string>
- <string key="translatingEventsMenu">NSMenuItem</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="connectDevicePrompt">
<string key="name">translatingEventsButton</string>
<string key="candidateClassName">NSButton</string>
</object>
- <object class="IBToOneOutletInfo" key="translatingEventsMenu">
- <string key="name">translatingEventsMenu</string>
- <string key="candidateClassName">NSMenuItem</string>
- </object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="className">NJKeyInputField</string>
<string key="superclassName">NSTextField</string>
<object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">keyDelegate</string>
+ <string key="NS.key.0">delegate</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <string key="NS.key.0">keyDelegate</string>
+ <string key="NS.key.0">delegate</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
- <string key="name">keyDelegate</string>
+ <string key="name">delegate</string>
<string key="candidateClassName">id</string>
</object>
</object>