-
Notifications
You must be signed in to change notification settings - Fork 7
/
AppController.j
96 lines (74 loc) · 2.07 KB
/
AppController.j
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* AppController.j
* Date Picker
*
* Created by You on July 6, 2009.
* Copyright 2009, RCL Concepts All rights reserved.
* http://www.rclconcepts.com/
* http://www.timetableapp.com/
*/
@import <Foundation/CPObject.j>
@import "DatePicker.j"
@implementation AppController : CPObject
{
CPWindow theWindow;
DatePicker theDatePicker;
int blah @accessors;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
theDatePicker = [[A alloc] initWithFrame:CGRectMake(100,100,100,30)];
[theDatePicker displayPreset:1];
[theDatePicker setDelegate:self];
[contentView addSubview:theDatePicker];
var button = [[CPButton alloc] initWithFrame:CGRectMake(230, 103, 200, 24)];
[button setTitle:@"the Date Value"];
[button setAction:@selector(datePickerValue:)];
[button setTarget:self];
[contentView addSubview:button];
theDatePicker2 = [[B alloc] initWithFrame:CGRectMake(100,150,100,30)];
[theDatePicker2 displayPreset:2];
[contentView addSubview:theDatePicker2];
var button2 = [[CPButton alloc] initWithFrame:CGRectMake(230, 153, 200, 24)];
[button2 setTitle:@"the Date Value"];
[button2 setAction:@selector(datePicker2Value:)];
[button2 setTarget:self];
[contentView addSubview:button2];
[theWindow orderFront:self];
[CPMenu setMenuBarVisible:YES];
// alert ([theDatePicker nextValidKeyView] === theDatePicker2)
}
-(void)datePickerValue:(id)sender
{
//[theDatePicker setDate:[CPDate dateWithTimeIntervalSinceNow:9000000]];
console.log([theDatePicker date]);
}
-(void)datePicker2Value:(id)sender
{
console.log([theDatePicker2 date]);
}
-(void)datePickerDidChange:(id)sender
{
/*if([sender object] === theDatePicker){
[theDatePicker2 setMinDate: [theDatePicker date]];
}*/
}
@end
@implementation A : DatePicker
{
}
- (CPString)description
{
return @"the 1st one";
}
@end
@implementation B : DatePicker
{
}
- (CPString)description
{
return @"the 2nd one";
}
@end