]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/combobox.mm
applying editor part of patch, see #15003
[wxWidgets.git] / src / osx / cocoa / combobox.mm
index f001957006cd1d9bd4bd6723571823cb3de83dd4..c410bd23c4653583e6495052cad36e6b99541e14 100644 (file)
 @end
 
 
 @end
 
 
-@interface wxNSComboBox : NSComboBox
-{
-}
-
-@end
-
 @implementation wxNSComboBox
 
 + (void)initialize
 @implementation wxNSComboBox
 
 + (void)initialize
     }
 }
 
     }
 }
 
+- (void) dealloc
+{
+    [fieldEditor release];
+    [super dealloc];
+}
+
+// Over-riding NSComboBox onKeyDown method doesn't work for key events.
+// Ensure that we can use our own wxNSTextFieldEditor to catch key events.
+// See windowWillReturnFieldEditor in nonownedwnd.mm.
+// Key events will be caught and handled via wxNSTextFieldEditor onkey...
+// methods in textctrl.mm.
+
+- (void) setFieldEditor:(wxNSTextFieldEditor*) editor
+{
+    if ( editor != fieldEditor )
+    {
+        [editor retain];
+        [fieldEditor release];
+        fieldEditor = editor;
+    }
+}
+
+- (wxNSTextFieldEditor*) fieldEditor
+{
+    return fieldEditor;
+}
+
 - (void)controlTextDidChange:(NSNotification *)aNotification
 {
     wxUnusedVar(aNotification);
 - (void)controlTextDidChange:(NSNotification *)aNotification
 {
     wxUnusedVar(aNotification);