[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
NSScrollView/NSClipView resizing.
From: |
Pascal Bourguignon |
Subject: |
NSScrollView/NSClipView resizing. |
Date: |
Sun, 20 Jan 2002 10:30:48 +0100 (CET) |
Hi!
There is a difference of behavior between the resizing of a couple of
NSScrollView/NSClipView on GNUstep and on OPENSTEP 4.2, where the
behavior on GNUstep is not good.
Namely this can be seen when using ScalingScrollView, a subclass of
NSScrollView which override or implements these methods:
Overrides:
-(id)initWithFrame:(NSRect)rect;
// [super initWithFrame:rect]; and proper attributes initialization.
-(void)tile;
// [super tile]; and reposition the pop-up and horizontal scroll.
-(void)setHasHorizontalScroller:(BOOL)flag;
// only remove the zoom pop-up when no horizontal scroll.
New methods:
-(void)_makeScalePopUpButton;
-(void)scalePopUpAction:(id)sender;
-(float)scaleFactor;
-(void)setScaleFactor:(float)newScaleFactor;
// set the clipView bounds according the the scale factor.
(Source of ScalingScrollView is to be found in the AppKit Examples of
OPENSTEP 4.2).
Now, when the window is resized and then the scroll view is resized,
on OPENSTEP 4.2, the relative size of the clipView is conserved, that
is, the scale factor is conserved.
But on GNUstep, the clipView is entirely reset, reverting to a scale
factor of 100%, and invaliding the invariants of the subclass
ScalingScrollView.
Resizing a NSScrollView should be done in a way that conserve ratio
between the bounds dans the frame of the clipView.
ScalingScrollView subclass of NSScrollView, contains NSClipView, which
contains MTVTree view.
On GNUstep:
Before resizing, with zoom factor 50%:
G: ----------------------------------------------------
G: (MTVTree*)(0x0850f1b0):
G: bounds = {{ 845100.00, 2501032.00},{ 56787.00, 81520.00}}
G: frame = {{ 0.00, 0.00},{ 56787.00, 81520.00}}
G: (NSClipView*)(0x084c7c78):
G: bounds = {{ 22.96, 7120.00},{ 1612.00, 1338.00}}
G: frame = {{ 20.00, 1.00},{ 806.00, 669.00}}
G: (ScalingScrollView*)(0x084cefa0):
G: bounds = {{ 0.00, 0.00},{ 827.00, 690.00}}
G: frame = {{ 8.00, 82.00},{ 827.00, 690.00}}
After resizing:
G: ----------------------------------------------------
G: (MTVTree*)(0x0850f1b0):
G: bounds = {{ 845100.00, 2501032.00},{ 56787.00, 81520.00}}
G: frame = {{ 0.00, 0.00},{ 56787.00, 81520.00}}
G: (NSClipView*)(0x084c7c78):
G: bounds = {{ 22.96, 7120.00},{ 653.00, 581.00}} BAD
G: frame = {{ 20.00, 1.00},{ 653.00, 581.00}}
G: (ScalingScrollView*)(0x084cefa0):
G: bounds = {{ 0.00, 0.00},{ 674.00, 602.00}}
G: frame = {{ 8.00, 82.00},{ 674.00, 602.00}}
On OPENSTEP 4.2:
Before resizing, with zoom factor 50%:
O: ----------------------------------------------------
O: (MTVTree*)(0x0010b0e8):
O: bounds = {{ 845100.00, 2501032.00},{ 56787.00, 81520.00}}
O: frame = {{ 0.00, 0.00},{ 56787.00, 81520.00}}
O: (NSClipView*)(0x0010b234):
O: bounds = {{ 8810.75, 6659.75},{ 1382.00, 1194.00}}
O: frame = {{ 20.00, 1.00},{ 691.00, 597.00}}
O: (ScalingScrollView*)(0x0010b168):
O: bounds = {{ 0.00, 0.00},{ 712.00, 618.00}}
O: frame = {{ 8.00, 82.00},{ 712.00, 618.00}}
After resizing:
O: ----------------------------------------------------
O: (MTVTree*)(0x0010b0e8):
O: bounds = {{ 845100.00, 2501032.00},{ 56787.00, 81520.00}}
O: frame = {{ 0.00, 0.00},{ 56787.00, 81520.00}}
O: (NSClipView*)(0x0010b234):
O: bounds = {{ 8810.75, 6659.75},{ 1230.00, 1084.00}} GOOD
O: frame = {{ 20.00, 1.00},{ 615.00, 542.00}}
O: (ScalingScrollView*)(0x0010b168):
O: bounds = {{ 0.00, 0.00},{ 636.00, 563.00}}
O: frame = {{ 8.00, 82.00},{ 636.00, 563.00}}
--
__Pascal_Bourguignon__ (o_ Software patents are endangering
() ASCII ribbon against html email //\ the computer industry all around
/\ and Microsoft attachments. V_/ the world http://lpf.ai.mit.edu/
1962:DO20I=1.100 2001:my($f)=`fortune`; http://petition.eurolinux.org/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d? s++:++(+++)>++ a C+++ UB+++L++++$S+X++++>$ P- L+++ E++ W++
N++ o-- K- w------ O- M++$ V PS+E++ Y++ PGP++ t+ 5? X+ R !tv b++(+)
DI+++ D++ G++ e+++ h+(++) r? y---? UF++++
------END GEEK CODE BLOCK------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- NSScrollView/NSClipView resizing.,
Pascal Bourguignon <=