X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/94474c2e0b2b13c2e0adefd9c307eb39433283b1..d9307d006e88025e28457290c9997f7c0f7c4fdc:/src/osx/cocoa/combobox.mm diff --git a/src/osx/cocoa/combobox.mm b/src/osx/cocoa/combobox.mm index f001957006..c410bd23c4 100644 --- a/src/osx/cocoa/combobox.mm +++ b/src/osx/cocoa/combobox.mm @@ -36,12 +36,6 @@ @end -@interface wxNSComboBox : NSComboBox -{ -} - -@end - @implementation wxNSComboBox + (void)initialize @@ -54,6 +48,33 @@ } } +- (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);