mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 18:50:48 +00:00
Source/NSEvent.h
Headers/gnustep/gui/NSEvent.h Source/NSResponder.m Source/NSScrollView.m git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12908 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d08fdfa221
commit
db98f96fca
5 changed files with 203 additions and 31 deletions
|
@ -292,7 +292,52 @@ static float scrollerWidth;
|
|||
|
||||
- (void) scrollWheel: (NSEvent *)theEvent
|
||||
{
|
||||
// FIXME
|
||||
NSRect clipViewBounds = [_contentView bounds];
|
||||
float deltaY = [theEvent deltaY];
|
||||
float amount;
|
||||
NSPoint point = clipViewBounds.origin;
|
||||
|
||||
|
||||
if (([theEvent modifierFlags] & NSAlternateKeyMask) == NSAlternateKeyMask)
|
||||
{
|
||||
amount = - (clipViewBounds.size.height - _vPageScroll) * deltaY;
|
||||
}
|
||||
else
|
||||
{
|
||||
amount = - _vLineScroll * deltaY;
|
||||
}
|
||||
|
||||
if (!_contentView->_rFlags.flipped_view)
|
||||
{
|
||||
/* If view is flipped reverse the scroll direction */
|
||||
amount = -amount;
|
||||
}
|
||||
NSDebugLog (@"increment/decrement: amount = %f, flipped = %d",
|
||||
amount, _contentView->_rFlags.flipped_view);
|
||||
point.y = clipViewBounds.origin.y + amount;
|
||||
|
||||
if (_hasHeaderView)
|
||||
{
|
||||
NSPoint scrollTo;
|
||||
|
||||
scrollTo = [_headerClipView bounds].origin;
|
||||
scrollTo.x += point.x - clipViewBounds.origin.x;
|
||||
[_headerClipView scrollToPoint: scrollTo];
|
||||
}
|
||||
[_contentView scrollToPoint: point];
|
||||
|
||||
if (_rulersVisible == YES)
|
||||
{
|
||||
if (_hasHorizRuler)
|
||||
{
|
||||
[_horizRuler setNeedsDisplay: YES];
|
||||
}
|
||||
if (_hasVertRuler)
|
||||
{
|
||||
[_vertRuler setNeedsDisplay: YES];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void) _doScroll: (NSScroller*)scroller
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue