@interface wxMaximumLengthFormatter : NSFormatter
{
int maxLength;
+ wxTextEntry* field;
}
@end
int len = [*partialStringPtr length];
if ( maxLength > 0 && len > maxLength )
{
- // TODO wxEVT_TEXT_MAXLEN
+ field->SendMaxLenEvent();
return NO;
}
return YES;
}
+- (void) setTextEntry:(wxTextEntry*) tf
+{
+ field = tf;
+}
+
@end
@implementation wxNSSecureTextField
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if ( impl )
{
- impl->DoNotifyFocusEvent( false, NULL );
+ NSResponder * responder = wxNonOwnedWindowCocoaImpl::GetNextFirstResponder();
+ NSView* otherView = wxOSXGetViewFromResponder(responder);
+
+ wxWidgetImpl* otherWindow = impl->FindBestFromWXWidget(otherView);
+ impl->DoNotifyFocusEvent( false, otherWindow );
}
}
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
if ( impl )
{
- impl->DoNotifyFocusEvent( false, NULL );
+ NSResponder * responder = wxNonOwnedWindowCocoaImpl::GetNextFirstResponder();
+ NSView* otherView = wxOSXGetViewFromResponder(responder);
+
+ wxWidgetImpl* otherWindow = impl->FindBestFromWXWidget(otherView);
+ impl->DoNotifyFocusEvent( false, otherWindow );
}
}
timpl->SetInternalSelection(range.location, range.location + range.length);
}
- impl->DoNotifyFocusEvent( false, NULL );
+ NSResponder * responder = wxNonOwnedWindowCocoaImpl::GetNextFirstResponder();
+ NSView* otherView = wxOSXGetViewFromResponder(responder);
+
+ wxWidgetImpl* otherWindow = impl->FindBestFromWXWidget(otherView);
+ impl->DoNotifyFocusEvent( false, otherWindow );
}
}
@end
{
wxMaximumLengthFormatter* formatter = [[[wxMaximumLengthFormatter alloc] init] autorelease];
[formatter setMaxLength:len];
+ [formatter setTextEntry:GetTextEntry()];
[m_textField setFormatter:formatter];
}