mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-21 07:40:57 +00:00
Nib compatibility code merge.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22957 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f529b9121c
commit
d68950d71a
36 changed files with 3162 additions and 1236 deletions
|
@ -3915,6 +3915,8 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
|
||||
[aCoder encodeInt: vFlags
|
||||
forKey: @"NSvFlags"];
|
||||
|
||||
[aCoder encodeObject: _super_view forKey: @"NSSuperview"];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3938,6 +3940,10 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
|
||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||
{
|
||||
NSEnumerator *e;
|
||||
NSView *sub;
|
||||
NSArray *subs;
|
||||
|
||||
// decode the superclass...
|
||||
[super initWithCoder: aDecoder];
|
||||
|
||||
|
@ -3949,9 +3955,8 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
|
||||
if ([aDecoder allowsKeyedCoding])
|
||||
{
|
||||
NSView *prevKeyView = [aDecoder decodeObjectForKey: @"NSPreviousKeyView"];
|
||||
NSView *nextKeyView = [aDecoder decodeObjectForKey: @"NSNextKeyView"];
|
||||
NSArray *subViews = [aDecoder decodeObjectForKey: @"NSSubviews"];
|
||||
NSView *prevKeyView = nil;
|
||||
NSView *nextKeyView = nil;
|
||||
|
||||
if ([aDecoder containsValueForKey: @"NSFrame"])
|
||||
{
|
||||
|
@ -3959,17 +3964,10 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
[_frameMatrix setFrameOrigin: _frame.origin];
|
||||
}
|
||||
self = [self initWithFrame: _frame];
|
||||
|
||||
if (subViews != nil)
|
||||
{
|
||||
NSEnumerator *enumerator = [subViews objectEnumerator];
|
||||
NSView *sub;
|
||||
|
||||
while ((sub = [enumerator nextObject]) != nil)
|
||||
{
|
||||
[self addSubview: sub];
|
||||
}
|
||||
}
|
||||
|
||||
subs = [aDecoder decodeObjectForKey: @"NSSubviews"];
|
||||
prevKeyView = [aDecoder decodeObjectForKey: @"NSPreviousKeyView"];
|
||||
nextKeyView = [aDecoder decodeObjectForKey: @"NSNextKeyView"];
|
||||
if (nextKeyView != nil)
|
||||
{
|
||||
[self setNextKeyView: nextKeyView];
|
||||
|
@ -3992,9 +3990,6 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
else
|
||||
{
|
||||
NSRect rect;
|
||||
NSEnumerator *e;
|
||||
NSView *sub;
|
||||
NSArray *subs;
|
||||
|
||||
NSDebugLLog(@"NSView", @"NSView: start decoding\n");
|
||||
|
||||
|
@ -4029,25 +4024,27 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
|||
[[aDecoder decodeObject] setNextKeyView: self];
|
||||
|
||||
[aDecoder decodeValueOfObjCType: @encode(id) at: &subs];
|
||||
e = [subs objectEnumerator];
|
||||
while ((sub = [e nextObject]) != nil)
|
||||
{
|
||||
NSAssert(sub->_window == nil, NSInternalInconsistencyException);
|
||||
NSAssert(sub->_super_view == nil, NSInternalInconsistencyException);
|
||||
[sub viewWillMoveToWindow: _window];
|
||||
[sub viewWillMoveToSuperview: self];
|
||||
[sub setNextResponder: self];
|
||||
[_sub_views addObject: sub];
|
||||
_rFlags.has_subviews = 1;
|
||||
[sub resetCursorRects];
|
||||
[sub setNeedsDisplay: YES];
|
||||
[sub _viewDidMoveToWindow];
|
||||
[sub viewDidMoveToSuperview];
|
||||
[self didAddSubview: sub];
|
||||
}
|
||||
RELEASE(subs);
|
||||
NSDebugLLog(@"NSView", @"NSView: finish decoding\n");
|
||||
}
|
||||
|
||||
// iterate over subviews and put them into the view...
|
||||
e = [subs objectEnumerator];
|
||||
while ((sub = [e nextObject]) != nil)
|
||||
{
|
||||
NSAssert([sub window] == nil, NSInternalInconsistencyException);
|
||||
NSAssert([sub superview] == nil, NSInternalInconsistencyException);
|
||||
[sub viewWillMoveToWindow: _window];
|
||||
[sub viewWillMoveToSuperview: self];
|
||||
[sub setNextResponder: self];
|
||||
[_sub_views addObject: sub];
|
||||
_rFlags.has_subviews = 1;
|
||||
[sub resetCursorRects];
|
||||
[sub setNeedsDisplay: YES];
|
||||
[sub _viewDidMoveToWindow];
|
||||
[sub viewDidMoveToSuperview];
|
||||
[self didAddSubview: sub];
|
||||
}
|
||||
RELEASE(subs);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue