mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 18:11:06 +00:00
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:
parent
a03db382f2
commit
185d419b30
3 changed files with 68 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue