@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
{
wxMaximumLengthFormatter* formatter = [[[wxMaximumLengthFormatter alloc] init] autorelease];
[formatter setMaxLength:len];
+ [formatter setTextEntry:GetTextEntry()];
[m_textField setFormatter:formatter];
}