Files
cappuccino/Tests/Manual/CPRuleEditorCibTest/RuleControls.j
T
Aparajita Fishman 7c831fa19d capp_lint flags deprecated CPPoint/Rect/Size types/functions
- Changed to corresponding CG types/functions in all files
- Fixed some demo app bugs
2013-01-19 16:51:56 +07:00

77 lines
1.3 KiB
Plaintext

/*
* Created by cacaodev@gmail.com.
* Copyright (c) 2008 Pear, Inc. All rights reserved.
*/
@implementation RuleTextField : CPTextField
{
}
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:CGRectMake(0, 0, 500, 24)];
if (self != nil)
{
[self setBezeled:YES];
[self setBezelStyle:CPTextFieldSquareBezel];
[self setBordered:YES];
[self setEditable:YES];
[self setFont:[CPFont systemFontOfSize:11]];
}
return self;
}
- (BOOL)isEqual:(id)object
{
if ([object class] == [RuleTextField class] &&
[[object objectValue] isEqual:[self objectValue]])
return YES;
return YES;
}
- (id)copy
{
var copy = [[RuleTextField alloc] initWithFrame:CGRectMakeZero()];
[copy setObjectValue:[self objectValue]];
return copy;
}
@end
@implementation RuleSlider : CPSlider
{
}
- (id) initWithFrame:(CGRect)frame
{
self = [super initWithFrame:CGRectMake(0, 0, 500, 18)];
if (self != nil)
{
[self setMinValue:0];
[self setMaxValue:60];
[self setContinuous:YES];
}
return self;
}
- (id)objectValue
{
return ROUND([self doubleValue]);
}
- (id)copy
{
var copy = [[RuleSlider alloc] initWithFrame:CGRectMakeZero()];
[copy setObjectValue:[self objectValue]];
return copy;
}
@end