Bugfixes for page scrolling.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4396 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-06-11 07:22:37 +00:00
parent a03db382f2
commit 185d419b30
3 changed files with 68 additions and 8 deletions

View file

@ -1,3 +1,10 @@
Fri Jun 11 8:35:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* NSScroller.m: Fixed bug in recognising page-scrolls - now sets the
NSINcrementPage and NSDecrementPage correctly.
* NSScxrollView.m: Fixed bug in scrolling by page - now uses the
page size as the context to retain, as it should.
Thu Jun 10 22:25:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSView.m: Optimise display routines - avoid unneeded

View file

@ -294,18 +294,40 @@ static Class rulerViewClass = nil;
_knobMoved = YES;
else
{
//FIXME in a page scroll, amount should be the portion of the view that
// stays visible, not the one that disapears
if (hitPart == NSScrollerIncrementLine)
amount = _lineScroll;
else if (hitPart == NSScrollerIncrementPage)
amount = _pageScroll;
{
amount = _lineScroll;
}
else if (hitPart == NSScrollerDecrementLine)
amount = -_lineScroll;
{
amount = -_lineScroll;
}
else if (hitPart == NSScrollerIncrementPage)
{
if (scroller == _horizScroller)
{
amount = clipViewBounds.size.width - _pageScroll;
}
else
{
amount = clipViewBounds.size.height - _pageScroll;
}
}
else if (hitPart == NSScrollerDecrementPage)
amount = -_pageScroll;
{
if (scroller == _horizScroller)
{
amount = _pageScroll - clipViewBounds.size.width;
}
else
{
amount = _pageScroll - clipViewBounds.size.height;
}
}
else
return;
{
return;
}
}
if (!_knobMoved) /* button scrolling */

View file

@ -522,6 +522,23 @@ static BOOL preCalcValues = NO;
{
case NSScrollerIncrementLine:
case NSScrollerDecrementLine:
/*
* A hit on a scroller button should be a page meovement
* if the alt key is pressed.
*/
if ([theEvent modifierFlags] & NSAlternateKeyMask)
{
if (_hitPart == NSScrollerIncrementLine)
{
_hitPart = NSScrollerIncrementPage;
}
else
{
_hitPart = NSScrollerDecrementPage;
}
}
/* Fall through to next case */
case NSScrollerIncrementPage:
case NSScrollerDecrementPage:
[self trackScrollButtons: theEvent];
@ -693,14 +710,28 @@ static BOOL preCalcValues = NO;
_hitPart = [self testPart: location];
rect = [self rectForPart: _hitPart];
/*
* A hit on a scroller button should be a page meovement
* if the alt key is pressed.
*/
switch (_hitPart)
{
case NSScrollerIncrementLine:
if ([theEvent modifierFlags] & NSAlternateKeyMask)
{
_hitPart = NSScrollerIncrementPage;
}
/* Fall through to next case */
case NSScrollerIncrementPage:
theCell = (_isHorizontal ? rightCell : downCell);
break;
case NSScrollerDecrementLine:
if ([theEvent modifierFlags] & NSAlternateKeyMask)
{
_hitPart = NSScrollerDecrementPage;
}
/* Fall through to next case */
case NSScrollerDecrementPage:
theCell = (_isHorizontal ? leftCell : upCell);
break;