// Author: Stefan Csomor
// Modified by: Ryan Norton (MLTE GetLineLength and GetLineText)
// Created: 1998-01-01
-// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@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];
}