mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 16:31:55 +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
8aba8fdfb4
commit
8c1c980464
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>
|
Thu Jun 10 22:25:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
* Source/NSView.m: Optimise display routines - avoid unneeded
|
* Source/NSView.m: Optimise display routines - avoid unneeded
|
||||||
|
|
|
@ -294,18 +294,40 @@ static Class rulerViewClass = nil;
|
||||||
_knobMoved = YES;
|
_knobMoved = YES;
|
||||||
else
|
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)
|
if (hitPart == NSScrollerIncrementLine)
|
||||||
amount = _lineScroll;
|
{
|
||||||
else if (hitPart == NSScrollerIncrementPage)
|
amount = _lineScroll;
|
||||||
amount = _pageScroll;
|
}
|
||||||
else if (hitPart == NSScrollerDecrementLine)
|
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)
|
else if (hitPart == NSScrollerDecrementPage)
|
||||||
amount = -_pageScroll;
|
{
|
||||||
|
if (scroller == _horizScroller)
|
||||||
|
{
|
||||||
|
amount = _pageScroll - clipViewBounds.size.width;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
amount = _pageScroll - clipViewBounds.size.height;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return;
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_knobMoved) /* button scrolling */
|
if (!_knobMoved) /* button scrolling */
|
||||||
|
|
|
@ -522,6 +522,23 @@ static BOOL preCalcValues = NO;
|
||||||
{
|
{
|
||||||
case NSScrollerIncrementLine:
|
case NSScrollerIncrementLine:
|
||||||
case NSScrollerDecrementLine:
|
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 NSScrollerIncrementPage:
|
||||||
case NSScrollerDecrementPage:
|
case NSScrollerDecrementPage:
|
||||||
[self trackScrollButtons: theEvent];
|
[self trackScrollButtons: theEvent];
|
||||||
|
@ -693,14 +710,28 @@ static BOOL preCalcValues = NO;
|
||||||
_hitPart = [self testPart: location];
|
_hitPart = [self testPart: location];
|
||||||
rect = [self rectForPart: _hitPart];
|
rect = [self rectForPart: _hitPart];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A hit on a scroller button should be a page meovement
|
||||||
|
* if the alt key is pressed.
|
||||||
|
*/
|
||||||
switch (_hitPart)
|
switch (_hitPart)
|
||||||
{
|
{
|
||||||
case NSScrollerIncrementLine:
|
case NSScrollerIncrementLine:
|
||||||
|
if ([theEvent modifierFlags] & NSAlternateKeyMask)
|
||||||
|
{
|
||||||
|
_hitPart = NSScrollerIncrementPage;
|
||||||
|
}
|
||||||
|
/* Fall through to next case */
|
||||||
case NSScrollerIncrementPage:
|
case NSScrollerIncrementPage:
|
||||||
theCell = (_isHorizontal ? rightCell : downCell);
|
theCell = (_isHorizontal ? rightCell : downCell);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NSScrollerDecrementLine:
|
case NSScrollerDecrementLine:
|
||||||
|
if ([theEvent modifierFlags] & NSAlternateKeyMask)
|
||||||
|
{
|
||||||
|
_hitPart = NSScrollerDecrementPage;
|
||||||
|
}
|
||||||
|
/* Fall through to next case */
|
||||||
case NSScrollerDecrementPage:
|
case NSScrollerDecrementPage:
|
||||||
theCell = (_isHorizontal ? leftCell : upCell);
|
theCell = (_isHorizontal ? leftCell : upCell);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue