@implementation DateSelectorModal : CPObject {
	id               dele;
    id               wind;
	id               sltdDate;
	id               aLbl;
	id				  clndView;
}

+ (void) _____DATESELECTORMODAL____{}

- (void) acceptAction:(id)sender {
	[[CPApplication sharedApplication] stopModal];
	[wind orderOut:nil];
	sltdDate = [clndView getDateCompl];
	[dele dateModalAnswer:sltdDate];
	g
}



- (void) cancelAction:(id)sender {
	[[CPApplication sharedApplication] stopModal];
	[wind orderOut:nil];
}



- (void) delegateSet:(id)_deleg {
    dele = _deleg;
}



- (void) setDefaultDate:(CPString)_value {

    [clndView setDefaultDate:_value];
}

- (id) initInView:(CPView)_wnd {
   [super init];
   var fram = [_wnd frame];
   var nFrm = CGRectMake(fram.origin.x+fram.size.width/2-150,fram.origin.y+fram.size.height/2-350,250,220);

   wind = [[CPWindow alloc] initWithContentRect:nFrm styleMask:CPTitledWindowMask];
   var windView = [wind contentView];
   [windView setBackgroundColor:[CPColor lightGrayColor]];
   [wind setTitle:"Calendar"];
	
	clndView= [[CalendarView alloc] init]; 
	[clndView setFrameOrigin:CGPointMake(0,05)];
	[windView addSubview:clndView];
	
	aBut = [[CPButton alloc] initWithFrame:CGRectMake(65,180, 60,24)];
	[aBut setTitle:@"Cancel"];
	[aBut setTarget:self];
	[aBut setAction:@selector(cancelAction:)];
	[aBut setFont:[CPFont fontWithName:@"Arial" size:11]];
	[windView addSubview:aBut];
	
    aBut = [[CPButton alloc] initWithFrame:CGRectMake(140,180, 60,24)];
	[aBut setTitle:@"Accept"];
	[aBut setTarget:self];
	[aBut setAction:@selector(acceptAction:)];
	[aBut setFont:[CPFont fontWithName:@"Arial" size:11]];
	[windView addSubview:aBut];
	
   return self;
}



- (id) initInWindow:(CPWindow)_wnd {

   [super init];
   var fram = [_wnd frame];
   var nFrm = CGRectMake(fram.origin.x+fram.size.width/2-150,fram.origin.y+fram.size.height/2-350,250,220);
   wind = [[CPWindow alloc] initWithContentRect:nFrm styleMask:CPTitledWindowMask];
   var windView = [wind contentView];
   [windView setBackgroundColor:[CPColor lightGrayColor]];
   [wind setTitle:"Calendar"];
   	
	clndView=[[CalendarView alloc] init]; 
	[clndView setFrameOrigin:CGPointMake(0,05)];
	[windView addSubview:clndView];
	
	
	aBut = [[CPButton alloc] initWithFrame:CGRectMake(65,180, 60,24)];
	[aBut setTitle:@"Cancel"];
	[aBut setTarget:self];
	[aBut setAction:@selector(cancelAction:)];
	[aBut setFont:[CPFont fontWithName:@"Arial" size:11]];
	[windView addSubview:aBut];
	
    aBut = [[CPButton alloc] initWithFrame:CGRectMake(140,180, 60,24)];
	[aBut setTitle:@"Accept"];
	[aBut setTarget:self];
	[aBut setAction:@selector(acceptAction:)];
	[aBut setFont:[CPFont fontWithName:@"Arial" size:11]];
	[windView addSubview:aBut];
	
   return self;
}



- (void) showWindow {
     [wind orderFront:self];
}



- (CPWindow) theWindow {
    return wind;
}



- (CPDate) selectedDate {
   return sltdDate;
}


@end
