From 5f7d1e8dc35e8d2f40d548a6ec5ffaea14bf9dbd Mon Sep 17 00:00:00 2001 From: Blair Duncan Date: Tue, 15 May 2012 16:07:56 -0400 Subject: [PATCH 1/2] controlDidFailToFormatString should send a string not an HTML element --- AppKit/CPTextField.j | 2 +- Tests/Manual/CPFormatterTest/AppController.j | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index 0145649c2..bda0c5a1b 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -652,7 +652,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder"); var acceptInvalidValue = NO; if ([_delegate respondsToSelector:@selector(control:didFailToFormatString:errorDescription:)]) - acceptInvalidValue = [_delegate control:self didFailToFormatString:[self _inputElement] errorDescription:error]; + acceptInvalidValue = [_delegate control:self didFailToFormatString:aValue errorDescription:error]; if (acceptInvalidValue === NO) return NO; diff --git a/Tests/Manual/CPFormatterTest/AppController.j b/Tests/Manual/CPFormatterTest/AppController.j index b1c3728d8..1ee6e06fb 100644 --- a/Tests/Manual/CPFormatterTest/AppController.j +++ b/Tests/Manual/CPFormatterTest/AppController.j @@ -80,12 +80,12 @@ var randomFromTo = function(from, to) - (void)objectValue1:(id)sender { - CPLog.info("Date 1: %s", [[dateField1 objectValue] description]); + console.log("Date 1: %s", [[dateField1 objectValue] description]); } - (void)objectValue2:(id)sender { - CPLog.info("Date 2: %s", [[dateField2 objectValue] description]); + console.log("Date 2: %s", [[dateField2 objectValue] description]); } - (void)setNil:(id)sender @@ -113,7 +113,7 @@ var randomFromTo = function(from, to) - (BOOL)control:(CPControl)aControl didFailToFormatString:(CPString)aString errorDescription:(CPString)anError { - CPLog.info("control:didFailToFormatString:%s errorDescription:%s", aString, anError); + console.log("control:didFailToFormatString:%s errorDescription:%s", aString, anError); if (anError) { From 8f4acc98d4e3a8c70f6835c2f1b06475166c49d7 Mon Sep 17 00:00:00 2001 From: Blair Duncan Date: Tue, 15 May 2012 16:07:56 -0400 Subject: [PATCH 2/2] controlDidFailToFormatString should send a string not an HTML element --- Tests/Manual/CPFormatterTest/AppController.j | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/Manual/CPFormatterTest/AppController.j b/Tests/Manual/CPFormatterTest/AppController.j index 1ee6e06fb..fe007de3e 100644 --- a/Tests/Manual/CPFormatterTest/AppController.j +++ b/Tests/Manual/CPFormatterTest/AppController.j @@ -80,12 +80,12 @@ var randomFromTo = function(from, to) - (void)objectValue1:(id)sender { - console.log("Date 1: %s", [[dateField1 objectValue] description]); + CPLog.info("Date 1: %s", [[dateField1 objectValue] description]); } - (void)objectValue2:(id)sender { - console.log("Date 2: %s", [[dateField2 objectValue] description]); + CPLog.info("Date 2: %s", [[dateField2 objectValue] description]); } - (void)setNil:(id)sender @@ -113,7 +113,7 @@ var randomFromTo = function(from, to) - (BOOL)control:(CPControl)aControl didFailToFormatString:(CPString)aString errorDescription:(CPString)anError { - console.log("control:didFailToFormatString:%s errorDescription:%s", aString, anError); + CPLog.info("control:didFailToFormatString:%s errorDescription:%s", aString, anError); if (anError) { @@ -149,7 +149,7 @@ var randomFromTo = function(from, to) else result = nil; - console.log("stringForObjectValue:%s ==> %s", [anObject description], result); + CPLog.info("stringForObjectValue:%s ==> %s", [anObject description], result); return result; } @@ -169,7 +169,7 @@ var randomFromTo = function(from, to) result = error === nil; - console.log("getObjectValue:forString:%s ==> %s", aString, result); + CPLog.info("getObjectValue:forString:%s ==> %s", aString, result); return result; }