Fix infinite loop in CPTextField, add selectText:

[#55 state:resolved]
This commit is contained in:
Ross Boucher committed 2008-09-18 16:38:41 -07:00
1 parent 08d0dfd190
commit f9e6cf3da9
1 file changed
+15 -2
+15 -2
View File
@@ -140,7 +140,7 @@ var _CPTextFieldSquareBezelColor = nil;
- (id)initWithFrame:(CGRect)aFrame
{
self = [super initWithFrame:aFrame];
if (self)
{
_value = @"";
@@ -432,7 +432,7 @@ var _CPTextFieldSquareBezelColor = nil;
return [[self class] _inputElement].value;
#endif
return [self stringValue];
return [super stringValue];
}
/*
@@ -469,6 +469,19 @@ var _CPTextFieldSquareBezelColor = nil;
#endif
}
/*
Select all the text in the CPTextField.
*/
- (void)selectText:(id)sender
{
#if PLATFORM(DOM)
var element = [[self class] _inputElement];
if (element.parentNode == _DOMElement && ([self isEditable] || [self isSelectable]))
element.select();
#endif
}
@end
var CPTextFieldIsSelectableKey = @"CPTextFieldIsSelectableKey",