+- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)anObject
+{
+ wxUnusedVar(sender);
+
+ if ([anObject isKindOfClass:[wxNSTextField class]])
+ {
+ wxNSTextField* tf = (wxNSTextField*) anObject;
+ wxNSTextFieldEditor* editor = [tf fieldEditor];
+ if ( editor == nil )
+ {
+ editor = [[wxNSTextFieldEditor alloc] init];
+ [editor setFieldEditor:YES];
+ [tf setFieldEditor:editor];
+ }
+ return editor;
+ }
+
+ return nil;
+}
+
+- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame
+{
+ wxNonOwnedWindowCocoaImpl* windowimpl = [(wxNSWindow*)window implementation];
+ if ( windowimpl )
+ {
+ wxNonOwnedWindow* wxpeer = windowimpl->GetWXPeer();
+ wxMaximizeEvent event(wxpeer->GetId());
+ event.SetEventObject(wxpeer);
+ return !wxpeer->HandleWindowEvent(event);
+ }
+ return true;
+}
+