//
//  NoConnectionView.m
//  AArogyasri
//
//  Created on 30/12/12.
//  Copyright (c) 2012 Abusamy Ltd.. All rights reserved.
//

#import "NoConnectionView.h"

@implementation NoConnectionView
@synthesize alertImgVw,alertMsgLbl;
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        
        CGRect frame = self.frame;
        UIImage *alrtImg = [UIImage imageNamed:@"No_Net.png"];
        
        
        alertImgVw = [[UIImageView alloc]initWithFrame:CGRectMake(frame.size.width/2 - alrtImg.size.width/2, 7, alrtImg.size.width, alrtImg.size.height)];
        [alertImgVw setImage:alrtImg];
        
         [self addSubview:alertImgVw];
        
        
        
        alertMsgLbl = [[UILabel alloc]initWithFrame:CGRectMake(frame.size.width/2-frame.size.width/2, alertImgVw.frame.size.height, frame.size.width, 30)];
        [alertMsgLbl setText:@"No Connection"];
        [alertMsgLbl setFont:[UIFont boldSystemFontOfSize:9]];
        [alertMsgLbl setTextAlignment:NSTextAlignmentCenter];
        [alertMsgLbl setTextColor:[UIColor whiteColor]];
        [alertMsgLbl setBackgroundColor:[UIColor clearColor]];
        [alertMsgLbl setShadowOffset:CGSizeMake(1, 1)];
        [alertMsgLbl setShadowColor:[UIColor darkGrayColor]];
        [self addSubview:alertMsgLbl];
        
        
        [self setBackgroundColor:[[UIColor blackColor] colorWithAlphaComponent:0.5]];
        [self.layer setCornerRadius:7.0];
        [self.layer setShadowOffset:CGSizeMake(1, 1)];
        [self.layer setShadowOpacity:3];
        [self.layer setShadowColor:[[UIColor blackColor]CGColor]];
        [self.layer setShadowRadius:6];
        [self.layer setBorderWidth:1];

        [self.layer setBorderColor:[[[UIColor yellowColor]colorWithAlphaComponent:0.5] CGColor]];

        
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
