//
//  ConditionSelectPopupView.m
//  OneCable
//
//  Created by nComz on 2017. 5. 18..
//  Copyright © 2017년 ntels. All rights reserved.
//

#import "ConditionSelectPopupView.h"

#import "CustomLabel.h"
#import "CustomButton.h"

@interface ConditionSelectPopupView ()

@end

@implementation ConditionSelectPopupView

- (id)initFromNib {
    
    for (UIView *view in [CommonUtil nibViews:@"ConditionSelectPopupView"]) {
        if ([view isKindOfClass:[ConditionSelectPopupView class]]) {
            self = (ConditionSelectPopupView *)view;
            
            //XIB의 경우, 현재 화면 사이즈로 맞춰줘야 함.
            self.frame = [UIScreen mainScreen].bounds;
            
            [self.imgTitleBar setImage:[UIImage imageNamed:@"img_popup_bg_head"]inset:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
            
            [self.btnCancelSingle setBackgroundImage:[UIImage imageNamed:@"img_popup_btn"] forState:UIControlStateNormal capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
            [self.btnCancelSingle setBackgroundImage:[UIImage imageNamed:@"img_popup_btn_press"] forState:UIControlStateHighlighted capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
            
            //Localization
            [self.btnCancelSingle setTitle:NSLocalizedString(@"취소", @"취소") forState:UIControlStateNormal];
        }
    }
    
    return self;
}

- (void)didMoveToSuperview {
    
}


- (IBAction)btnHomeModeTouched:(id)sender {
    self.btnHomeMode.selected = YES;
    self.btnTerm.selected = NO;
    self.btnStatus.selected = NO;

    [super hideWithButtonIndex:10];
    
}

- (IBAction)btnTermTouched:(id)sender {
    self.btnHomeMode.selected = NO;
    self.btnTerm.selected = YES;
    self.btnStatus.selected = NO;
    
    [super hideWithButtonIndex:11];
}

- (IBAction)btnStatusTouched:(id)sender {
    self.btnHomeMode.selected = NO;
    self.btnTerm.selected = NO;
    self.btnStatus.selected = YES;
    
    [super hideWithButtonIndex:12];
}

- (IBAction)btnCancelTouched:(id)sender {
    [super btnCancelTouched:nil];
}
@end
