mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 02:00:37 +00:00
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:
parent
185d419b30
commit
d667a0b705
5 changed files with 112 additions and 26 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue