I've attached a quick and dirty patch to enable input validation via
NSFormatter objects. It works perfectly for my requirements, but I
haven't
tested with the GNUstep-provided formatters. (Should work without
problems
anyway IMHO)
Ingolf Jandt
<NSTextField.h.diff><NSTextField.m.diff>
44a45
NSString *_oldString;
504a505,510
if (_text_object)
{
NSString *dummy = AUTORELEASE([[_text_object string] copy]);
ASSIGN (_oldString, dummy);
}
530c536
< ---
550c556
< NSLog (@"Unimplemented: should set string to %@", newString);
---
// NSLog (@"Unimplemented: should set string to %@", newString);
552c558,560
< //[_text_object setString: newString];
---
NSRange range = [_text_object selectedRange];
[_text_object setString: newString];
[_text_object setSelectedRange: range];
559c567,571
< NSLog (@"Unimplemented: should delete last typed character");
---
// NSLog (@"Unimplemented: should delete last typed
character");
NSRange range = [_text_object selectedRange];
range.location--;
[_text_object setString: _oldString];
[_text_object setSelectedRange: range];
562c574,578
< ---
{
NSString *dummy= AUTORELEASE( [[_text_object string] copy]);
ASSIGN(_oldString, dummy);
}
_______________________________________________
Gnustep-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/gnustep-dev