//
//  OrderInfoRModelCell.m
//  RedAnt ERP Mobile
//
//  Created by Ray on 14-7-12.
//  Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
//

#import "CommonEditorCellModel.h"
#import "RAUtils.h"
#import "BundleModelViewController.h"
#import "const.h"

@implementation CommonEditorCellModel

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)awakeFromNib
{
    // Initialization code
    
//    [self addGestureRecognizer: [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longTap:)]];
}
- (IBAction)onClickBundle:(UIButton *)sender {
    
    UIViewController* vc=[RAUtils getViewController :sender];
    
    
    BundleModelViewController * bundleVC =[ vc.storyboard instantiateViewControllerWithIdentifier:@"BundleModelViewController"];
    
    bundleVC.content_data = self.bundle_item;
    
    UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:bundleVC] ;
    
    
    
    
    
    
    navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态，自己看看是哪种
    [vc presentViewController:navi animated:YES completion:^{
        
        //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
        
        DebugLog(@"bundle present.........");
        
        //   self.btop = false;
        //  <#code#>
    }];
    
}
/*
-(void)longTap:(UILongPressGestureRecognizer *)longRecognizer
{
    if (longRecognizer.state==UIGestureRecognizerStateBegan) {
        [self becomeFirstResponder];
        UIMenuController *menu=[UIMenuController sharedMenuController];
        UIMenuItem *copyItem = [[UIMenuItem alloc] initWithTitle:@"复制" action:@selector(copyItemClicked:)];
        UIMenuItem *resendItem = [[UIMenuItem alloc] initWithTitle:@"转发" action:@selector(resendItemClicked:)];
        
        [menu setMenuItems:[NSArray arrayWithObjects:copyItem,resendItem,nil]];
        [menu setTargetRect:self.bounds inView:self];
        [menu setMenuVisible:YES animated:YES];
    }
}

#pragma mark 处理action事件
-(BOOL)canPerformAction:(SEL)action withSender:(id)sender{
    if(action ==@selector(copyItemClicked:)){
        return YES;
    }else if (action==@selector(resendItemClicked:)){
        return YES;
    }
    return [super canPerformAction:action withSender:sender];
}
#pragma mark  实现成为第一响应者方法
-(BOOL)canBecomeFirstResponder{
    return YES;
}
#pragma mark method
-(void)resendItemClicked:(id)sender{
    DebugLog(@"转发");
    //通知代理
}
-(void)copyItemClicked:(id)sender{
    DebugLog(@"复制");
    // 通知代理
}*/
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
