mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 21:17:03 +00:00
- Changed to corresponding CG types/functions in all files - Fixed some demo app bugs
77 lines
1.3 KiB
Plaintext
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
|