mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 11:01:56 +00:00
Do not process mouse down events if the slider is disabled
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12128 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8d667a446e
commit
1d5f879ad2
1 changed files with 24 additions and 22 deletions
|
@ -417,31 +417,33 @@ static Class cellClass;
|
||||||
|
|
||||||
- (void) mouseDown: (NSEvent *)theEvent
|
- (void) mouseDown: (NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
NSPoint location = [self convertPoint: [theEvent locationInWindow]
|
if ([_cell isEnabled])
|
||||||
fromView: nil];
|
|
||||||
NSRect rect;
|
|
||||||
|
|
||||||
rect = [_cell knobRectFlipped: _rFlags.flipped_view];
|
|
||||||
if (![self mouse: location inRect: rect])
|
|
||||||
{
|
{
|
||||||
// Mouse is not on the knob, move the knob to the mouse position
|
NSPoint location = [self convertPoint: [theEvent locationInWindow]
|
||||||
float floatValue;
|
fromView: nil];
|
||||||
floatValue = _floatValueForMousePoint (location, rect,
|
NSRect rect;
|
||||||
[_cell trackRect],
|
|
||||||
[_cell isVertical],
|
rect = [_cell knobRectFlipped: _rFlags.flipped_view];
|
||||||
[_cell minValue],
|
if (![self mouse: location inRect: rect])
|
||||||
[_cell maxValue], _cell,
|
|
||||||
_rFlags.flipped_view);
|
|
||||||
[_cell setFloatValue: floatValue];
|
|
||||||
if ([_cell isContinuous])
|
|
||||||
{
|
{
|
||||||
[self sendAction: [_cell action] to: [_cell target]];
|
// Mouse is not on the knob, move the knob to the mouse position
|
||||||
|
float floatValue;
|
||||||
|
floatValue = _floatValueForMousePoint (location, rect,
|
||||||
|
[_cell trackRect],
|
||||||
|
[_cell isVertical],
|
||||||
|
[_cell minValue],
|
||||||
|
[_cell maxValue], _cell,
|
||||||
|
_rFlags.flipped_view);
|
||||||
|
[_cell setFloatValue: floatValue];
|
||||||
|
if ([_cell isContinuous])
|
||||||
|
{
|
||||||
|
[self sendAction: [_cell action] to: [_cell target]];
|
||||||
|
}
|
||||||
|
[_cell drawWithFrame: _bounds inView: self];
|
||||||
|
[_window flushWindow];
|
||||||
}
|
}
|
||||||
[_cell drawWithFrame: _bounds inView: self];
|
|
||||||
[_window flushWindow];
|
[self trackKnob: theEvent knobRect: rect];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self trackKnob: theEvent knobRect: rect];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue