mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-13 22:21:29 +00:00
Add missing setX and X methods on CPControl.
Moved the logic for setStringValue to setObjectValue on CPTextField. Now, all setX's call setObject. We store native objects, and cast to the appropriate type in the getter methods.
This commit is contained in:
+65
-1
@@ -282,7 +282,71 @@ var CPControlBlackColor = [CPColor blackColor];
|
||||
*/
|
||||
- (void)setFloatValue:(float)aValue
|
||||
{
|
||||
_value = aValue;
|
||||
[self setObjectValue:aValue];
|
||||
}
|
||||
|
||||
/*
|
||||
Returns the receiver's object value
|
||||
*/
|
||||
- (id)objectValue
|
||||
{
|
||||
return _value;
|
||||
}
|
||||
|
||||
/*
|
||||
Set's the receiver's object value
|
||||
*/
|
||||
- (void)setObjectValue:(id)anObject
|
||||
{
|
||||
_value = anObject;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns the receiver's double value
|
||||
*/
|
||||
- (id)doubleValue
|
||||
{
|
||||
return [self floatValue];
|
||||
}
|
||||
|
||||
/*
|
||||
Set's the receiver's double value
|
||||
*/
|
||||
- (void)setDoubleValue:(id)anObject
|
||||
{
|
||||
[self setObjectValue:anObject];
|
||||
}
|
||||
|
||||
/*
|
||||
Returns the receiver's int value
|
||||
*/
|
||||
- (id)intValue
|
||||
{
|
||||
return _value ? parseInt(_value, 10) : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Set's the receiver's int value
|
||||
*/
|
||||
- (void)setIntValue:(id)anObject
|
||||
{
|
||||
[self setObjectValue:anObject];
|
||||
}
|
||||
|
||||
/*
|
||||
Returns the receiver's int value
|
||||
*/
|
||||
- (id)stringValue
|
||||
{
|
||||
return _value ? ""+_value : "";
|
||||
}
|
||||
|
||||
/*
|
||||
Set's the receiver's int value
|
||||
*/
|
||||
- (void)setStringValue:(id)anObject
|
||||
{
|
||||
[self setObjectValue:anObject];
|
||||
}
|
||||
|
||||
- (void)setBackgroundColor:(CPColor)aColor
|
||||
|
||||
Reference in New Issue
Block a user