Reverting to previous CPControl/CPSlider event system

This commit is contained in:
Tom Robinson
2008-10-28 00:56:21 -07:00
parent a3ae869f1d
commit e8febcda15
2 changed files with 11 additions and 19 deletions
-16
View File
@@ -262,22 +262,6 @@ var CPControlBlackColor = [CPColor blackColor];
[super mouseUp:anEvent];
}
- (void)mouseDown:(CPEvent)anEvent
{
if (_sendActionOn & CPLeftMouseDownMask && CPRectContainsPoint([self bounds], [self convertPoint:[anEvent locationInWindow] fromView:nil]))
[self sendAction:_action to:_target];
[super mouseDown:anEvent];
}
- (void)mouseDragged:(CPEvent)anEvent
{
if (_sendActionOn & CPLeftMouseDraggedMask && CPRectContainsPoint([self bounds], [self convertPoint:[anEvent locationInWindow] fromView:nil]))
[self sendAction:_action to:_target];
[super mouseDragged:anEvent];
}
/*!
Causes <code>anAction</code> to be sent to <code>anObject</code>.
@param anAction the action to send
+11 -3
View File
@@ -79,6 +79,8 @@ var CPSliderHorizontalKnobImage = nil,
_knobSize = [[self knobImage] size];
_isVertical = [self isVertical];
[self setContinuous:YES];
[_knob setFrameOrigin:[self knobPosition]];
[self addSubview:_bar];
@@ -361,7 +363,9 @@ var CPSliderHorizontalKnobImage = nil,
if ([_target respondsToSelector:@selector(sliderDidFinish:)])
[_target sliderDidFinish:self];
[super mouseUp:anEvent];
if (_sendActionOn & CPLeftMouseUpMask)
[self sendAction:_action to:_target];
//[super mouseUp:anEvent];
}
- (void)mouseDown:(CPEvent)anEvent
@@ -372,7 +376,9 @@ var CPSliderHorizontalKnobImage = nil,
[[self knob] setImage:[self pushedKnobImage]];
[super mouseDown:anEvent];
if (_sendActionOn & CPLeftMouseDraggedMask)
[self sendAction:_action to:_target];
//[super mouseDown:anEvent];
}
- (void)mouseDragged:(CPEvent)anEvent
@@ -381,7 +387,9 @@ var CPSliderHorizontalKnobImage = nil,
[super setObjectValue:[self valueForKnobPosition:[_knob frame].origin]];
[super mouseDragged:anEvent];
if (_sendActionOn & CPLeftMouseDraggedMask)
[self sendAction:_action to:_target];
//[super mouseDown:anEvent];
}
@end