Luky/Gui/LLCharFormatter.m

00001 //
00002 //  LLCharFormatter.m
00003 //  MacTrek
00004 //
00005 //  Created by Aqua on 21/04/2006.
00006 //  Copyright 2006 Luky Soft. All rights reserved.
00007 //
00008 
00009 #import "LLCharFormatter.h"
00010 
00011 
00012 @implementation LLCharFormatter
00013 
00014 - (NSString *)stringForObjectValue:(id)anObject {
00015     return anObject;
00016 }
00017 
00018 - (BOOL)getObjectValue:(id *)anObject 
00019              forString:(NSString *)string 
00020       errorDescription:(NSString **)error {
00021     
00022     *anObject = [NSString stringWithString: string];
00023     error = nil;
00024     return YES;
00025 }
00026 
00027 - (BOOL)isPartialStringValid:(NSString *)partialString 
00028             newEditingString:(NSString **)newString 
00029             errorDescription:(NSString **)error {
00030     *newString = nil;
00031     if ([partialString length] > 1) {
00032         *error = @"You can only press one character at the time";
00033         return NO;
00034     } else {
00035         return YES;
00036     }   
00037 }
00038 
00039 
00040 @end

Generated on Sat Aug 26 21:14:16 2006 for MacTrek by  doxygen 1.4.7