diff --git a/ChangeLog b/ChangeLog index 2397fa9d1..cd4e8b3b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,10 @@ -Fri Dec 3 14:38:00 1999 Richard Frith-Macdonald +Fri Dec 3 14:53:00 1999 Richard Frith-Macdonald - * Source/NSOpenPanel.m ([-browser:selectCellWithString:inColumn:]) + * Source/NSOpenPanel.m: ([-browser:selectCellWithString:inColumn:]) fixed to set the _fullFileName ivar so that the panel can return the selected filename. + * Source/NSWindow.m: Encode/decode top-left point of window for + positioning. Fri Dec 3 11:34:00 1999 Richard Frith-Macdonald diff --git a/Source/NSBundleAdditions.m b/Source/NSBundleAdditions.m index 32cd9291c..d4549c8af 100644 --- a/Source/NSBundleAdditions.m +++ b/Source/NSBundleAdditions.m @@ -89,6 +89,18 @@ - (void) replaceObject: (id)anObject withObject: (id)anotherObject { + if (_src == anObject) + { + ASSIGN(_src, anotherObject); + } + if (_dst == anObject) + { + ASSIGN(_dst, anotherObject); + } + if (_tag == anObject) + { + ASSIGN(_tag, anotherObject); + } } - (id) source @@ -241,7 +253,6 @@ val = [nameTable objectForKey: [connection destination]]; [connection setDestination: val]; [connection establishConnection]; - [connection establishConnection]; } /* diff --git a/Source/NSMenu.m b/Source/NSMenu.m index 50f944c0b..2e4b55f1c 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -765,9 +765,11 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations"; - (void) sizeToFit { + NSRect windowFrame; NSRect menuFrame; NSSize size; + windowFrame = [aWindow frame]; [menu_view sizeToFit]; menuFrame = [menu_view frame]; @@ -779,13 +781,20 @@ static NSString* NSMenuLocationsKey = @"NSMenuLocations"; { size.height += 23; [aWindow setContentSize: size]; + [aWindow setFrameTopLeftPoint: + NSMakePoint(NSMinX(windowFrame),NSMaxY(windowFrame))]; + windowFrame = [bWindow frame]; [bWindow setContentSize: size]; + [bWindow setFrameTopLeftPoint: + NSMakePoint(NSMinX(windowFrame),NSMaxY(windowFrame))]; [menu_view setFrameOrigin: NSMakePoint(0, 0)]; [titleView setFrame: NSMakeRect(0,size.height-23,size.width,23)]; } else { [aWindow setContentSize: size]; + [aWindow setFrameTopLeftPoint: + NSMakePoint(NSMinX(windowFrame),NSMaxY(windowFrame))]; } [aWindow display]; diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 57fc31c91..3c6c686ce 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -2772,18 +2772,21 @@ resetCursorRectsForView(NSView *theView) */ - (void) encodeWithCoder: (NSCoder*)aCoder { - BOOL flag; - id nxt = RETAIN([self nextResponder]); + BOOL flag; + NSPoint p; + id nxt = RETAIN([self nextResponder]); [self setNextResponder: nil]; [super encodeWithCoder: aCoder]; NSDebugLog(@"NSWindow: start encoding\n"); + [aCoder encodeRect: [[self contentView] frame]]; [aCoder encodeValueOfObjCType: @encode(unsigned) at: &style_mask]; [aCoder encodeValueOfObjCType: @encode(NSBackingStoreType) at: &backing_type]; + [aCoder encodePoint: NSMakePoint(NSMinX([self frame]), NSMaxY([self frame]))]; [aCoder encodeObject: content_view]; [aCoder encodeObject: background_color]; [aCoder encodeObject: represented_filename]; @@ -2839,6 +2842,7 @@ resetCursorRectsForView(NSView *theView) { NSSize aSize; NSRect aRect; + NSPoint p; unsigned aStyle; NSBackingStoreType aBacking; int anInt; @@ -2857,6 +2861,7 @@ resetCursorRectsForView(NSView *theView) defer: NO screen: nil]; + p = [aDecoder decodePoint]; obj = [aDecoder decodeObject]; [self setContentView: obj]; obj = [aDecoder decodeObject]; @@ -2915,6 +2920,7 @@ resetCursorRectsForView(NSView *theView) [aDecoder decodeValueOfObjCType: @encode(id) at: &_initial_first_responder]; + [self setFrameTopLeftPoint: p]; NSDebugLog(@"NSWindow: finish decoding\n"); }