//
//  ControllerButton.m
//  VH7PC_Controller
//
//  Created by nya on Fri Aug 15 2003.
//  Copyright (c) 2003 __MyCompanyName__. All rights reserved.
//

#import "ControllerButton.h"
#import "ControllerButtonCell.h"


@implementation ControllerButton

-(void)setDownTarget:(id)obj{
    _dnTarget=obj;
}

-(void)setDownAction:(SEL)sel{
    _dnAction=sel;
}

-(void)mouseDown:(NSEvent *)theEvent{
    if(_dnTarget) [_dnTarget performSelector:_dnAction withObject:self];
    _mouseDowning=YES;
    [super mouseDown:theEvent];
}

- (void)mouseExited:(NSEvent *)theEvent{
    if(_mouseDowning){
        [[self target] performSelector:[self action] withObject:self];
        _mouseDowning=NO;
    }
    [super mouseDown:theEvent];
}

@end
