NSScrollView and NSInterfaceStyle updates

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4399 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-06-12 08:36:38 +00:00
parent 185d419b30
commit d667a0b705
5 changed files with 112 additions and 26 deletions

View file

@ -1,8 +1,23 @@
Sat Jun 12 9:35:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSResponder.m: Update encoding/decoding for interface styles
* Model/GMAppKit.m: Update for interface styles
* Headers/AppKit/NSScrollView.h: Added MacOS-X methods -
setHorizontalLineScroll, setVerticalLineScroll,
setHorizontalPageScroll, setVerticalPageScroll
horizontalLineScroll, verticalLineScroll,
horizontalPageScroll, verticalPageScroll
* Source/NSScrollView.m: Added new MacOS-X methods -
setHorizontalLineScroll, setVerticalLineScroll,
setHorizontalPageScroll, setVerticalPageScroll
horizontalLineScroll, verticalLineScroll,
horizontalPageScroll, verticalPageScroll
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
* Source/NSScroller.m: Fixed bug in recognising page-scrolls -
now sets the NSIncrementPage and NSDecrementPage correctly.
* Source/NSScrollView.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>

View file

@ -44,8 +44,10 @@
NSScroller* _vertScroller;
NSRulerView* _horizRuler;
NSRulerView* _vertRuler;
float _lineScroll;
float _pageScroll;
float _hLineScroll;
float _hPageScroll;
float _vLineScroll;
float _vPageScroll;
NSBorderType _borderType;
BOOL _hasHorizScroller;
BOOL _hasVertScroller;
@ -115,6 +117,16 @@
- (float)pageScroll;
- (void)setScrollsDynamically:(BOOL)flag;
- (BOOL)scrollsDynamically;
#ifndef STRICT_OPENSTEP
- (float) horizontalLineScroll;
- (float) horizontalPageScroll;
- (float) verticalLineScroll;
- (float) verticalPageScroll;
- (void) setHorizontalLineScroll: (float)aFloat;
- (void) setHorizontalPageScroll: (float)aFloat;
- (void) setVerticalLineScroll: (float)aFloat;
- (void) setVerticalPageScroll: (float)aFloat;
#endif
/* Updating display after scrolling */
- (void)reflectScrolledClipView:(NSClipView*)aClipView;

View file

@ -850,11 +850,18 @@ void __dummy_GMAppKit_functionForLinking() {}
if ((nextResponder = [self nextResponder]))
[archiver encodeObject:nextResponder withName:@"nextResponder"];
if ([self respondsToSelector: @selector(interfaceStyle)])
[archiver encodeUnsignedInt: [self interfaceStyle]
withName:@"interfaceStyle"];
}
- (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver
{
[self setNextResponder:[unarchiver decodeObjectWithName:@"nextResponder"]];
if ([self respondsToSelector: @selector(setInterfaceStyle:)])
[self setInterfaceStyle:
[unarchiver decodeUnsignedIntWithName:@"interfaceStyle"]];
return self;
}

View file

@ -240,11 +240,15 @@
- (void) encodeWithCoder: (NSCoder*)aCoder
{
[aCoder encodeConditionalObject: next_responder];
[aCoder encodeValueOfObjCType: @encode(NSInterfaceStyle)
at: &interface_style];
}
- (id) initWithCoder: (NSCoder*)aDecoder
{
next_responder = [aDecoder decodeObject];
[aDecoder decodeValueOfObjCType: @encode(NSInterfaceStyle)
at: &interface_style];
return self;
}

View file

@ -30,6 +30,7 @@
#include <gnustep/gui/config.h>
#include <math.h>
#include <Foundation/NSException.h>
#include <AppKit/NSScroller.h>
#include <AppKit/NSClipView.h>
#include <AppKit/NSScrollView.h>
@ -158,8 +159,10 @@ static Class rulerViewClass = nil;
{
[super initWithFrame: rect];
[self setContentView: AUTORELEASE([NSClipView new])];
_lineScroll = 10;
_pageScroll = 10;
_hLineScroll = 10;
_hPageScroll = 10;
_vLineScroll = 10;
_vPageScroll = 10;
_borderType = NSBezelBorder;
_scrollsDynamically = YES;
[self tile];
@ -296,33 +299,31 @@ static Class rulerViewClass = nil;
{
if (hitPart == NSScrollerIncrementLine)
{
amount = _lineScroll;
if (scroller == _horizScroller)
amount = _hLineScroll;
else
amount = _vLineScroll;
}
else if (hitPart == NSScrollerDecrementLine)
{
amount = -_lineScroll;
if (scroller == _horizScroller)
amount = -_hLineScroll;
else
amount = -_vLineScroll;
}
else if (hitPart == NSScrollerIncrementPage)
{
if (scroller == _horizScroller)
{
amount = clipViewBounds.size.width - _pageScroll;
}
amount = clipViewBounds.size.width - _hPageScroll;
else
{
amount = clipViewBounds.size.height - _pageScroll;
}
amount = clipViewBounds.size.height - _vPageScroll;
}
else if (hitPart == NSScrollerDecrementPage)
{
if (scroller == _horizScroller)
{
amount = _pageScroll - clipViewBounds.size.width;
}
amount = _hPageScroll - clipViewBounds.size.width;
else
{
amount = _pageScroll - clipViewBounds.size.height;
}
amount = _vPageScroll - clipViewBounds.size.height;
}
else
{
@ -367,7 +368,6 @@ static Class rulerViewClass = nil;
}
[_contentView scrollToPoint: point];
[window update];
}
- (void) reflectScrolledClipView: (NSClipView*)aClipView
@ -690,22 +690,70 @@ static Class rulerViewClass = nil;
- (void) setLineScroll: (float)aFloat
{
_lineScroll = aFloat;
_hLineScroll = aFloat;
_vLineScroll = aFloat;
}
- (void) setHorizontalLineScroll: (float)aFloat
{
_hLineScroll = aFloat;
}
- (void) setVerticalLineScroll: (float)aFloat
{
_vLineScroll = aFloat;
}
- (float) lineScroll
{
return _lineScroll;
if (_hLineScroll != _vLineScroll)
[NSException raise: NSInternalInconsistencyException
format: @"horizontal and vertical values not same"];
return _vLineScroll;
}
- (float) horizontalLineScroll
{
return _hLineScroll;
}
- (float) verticalLineScroll
{
return _vLineScroll;
}
- (void) setPageScroll: (float)aFloat
{
_pageScroll = aFloat;
_hPageScroll = aFloat;
_vPageScroll = aFloat;
}
- (void) setHorizontalPageScroll: (float)aFloat
{
_hPageScroll = aFloat;
}
- (void) setVerticalPageScroll: (float)aFloat
{
_vPageScroll = aFloat;
}
- (float) pageScroll
{
return _pageScroll;
if (_hPageScroll != _vPageScroll)
[NSException raise: NSInternalInconsistencyException
format: @"horizontal and vertical values not same"];
return _vPageScroll;
}
- (float) horizontalPageScroll
{
return _hPageScroll;
}
- (float) verticalPageScroll
{
return _vPageScroll;
}
- (void) setScrollsDynamically: (BOOL)flag