cog/Window/VolumeButton.m

37 lines
707 B
Matlab
Raw Normal View History

2009-02-09 05:53:38 +00:00
//
// VolumeButton.m
// Cog
//
// Created by Vincent Spader on 2/8/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "VolumeButton.h"
#import "VolumeSlider.h"
#import "PlaybackController.h"
2009-02-09 05:53:38 +00:00
@implementation VolumeButton
- (void)scrollWheel:(NSEvent *)theEvent
{
double change = [theEvent deltaY];
[(VolumeSlider *)_popView setDoubleValue:[(VolumeSlider *)_popView doubleValue] + change];
[[(VolumeSlider *)_popView target] changeVolume:_popView];
2009-02-09 05:53:38 +00:00
[(VolumeSlider *)_popView showToolTipForDuration:1.0];
}
- (void)mouseDown:(NSEvent *)theEvent
{
[(VolumeSlider *)_popView hideToolTip];
[super mouseDown:theEvent];
[(VolumeSlider *)_popView hideToolTip];
}
@end