gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch for NSTextField (input validation)


From: Adam Fedor
Subject: Re: patch for NSTextField (input validation)
Date: Mon, 20 Mar 2006 21:48:40 -0700

Has anyone looked at this?

On 2006-02-02 14:56:36 -0700 Ingolf Jandt <address@hidden> wrote:

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]