git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5600 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-12-21 16:48:34 +00:00
parent 6e788a64fa
commit a9ed03a643
2 changed files with 35 additions and 6 deletions

View file

@ -1,9 +1,11 @@
Mon Dec 20 15:28:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk> Mon Dec 20 16:45:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSView.m: Fix removal of view from window such that we reset * Source/NSView.m: Fix removal of view from window such that we reset
the windows first responder if any of the removed views in first the windows first responder if any of the removed views in first
responder (avoid crash iv views subsequently deallocated). responder (avoid crash iv views subsequently deallocated).
* Source/NSBundleAdditions.m: Removed excess release of bundle data. * Source/NSBundleAdditions.m: Removed excess release of bundle data.
* Source/NSPanel.m: Call ([-sizeToFit]) for fields in alert panels
so they are big enough for their contents.
Mon Dec 20 11:00:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk> Mon Dec 20 11:00:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>

View file

@ -420,12 +420,23 @@ static GSAlertPanel *gmodelAlertPanel = nil;
other: (NSString*)otherButton other: (NSString*)otherButton
{ {
NSView *content = [self contentView]; NSView *content = [self contentView];
float maxX = NSMaxX([content bounds]) - 5;
float diff;
NSRect bRect;
if (defaultButton) if (defaultButton != nil)
{ {
[defButton setTitle: defaultButton]; [defButton setTitle: defaultButton];
[defButton sizeToFit];
if ([defButton superview] == nil) if ([defButton superview] == nil)
[content addSubview: defButton]; [content addSubview: defButton];
bRect = [defButton frame];
diff = maxX - NSMaxX(bRect);
bRect.origin.x += diff;
[defButton setFrame: bRect];
maxX = NSMinX(bRect) - 10;
[self makeFirstResponder: defButton]; [self makeFirstResponder: defButton];
} }
else else
@ -434,11 +445,18 @@ static GSAlertPanel *gmodelAlertPanel = nil;
[defButton removeFromSuperview]; [defButton removeFromSuperview];
} }
if (alternateButton) if (alternateButton != nil)
{ {
[altButton setTitle: alternateButton]; [altButton setTitle: alternateButton];
[altButton sizeToFit];
if ([altButton superview] == nil) if ([altButton superview] == nil)
[content addSubview: altButton]; [content addSubview: altButton];
bRect = [altButton frame];
diff = maxX - NSMaxX(bRect);
bRect.origin.x += diff;
[altButton setFrame: bRect];
maxX = NSMinX(bRect) - 10;
} }
else else
{ {
@ -446,11 +464,18 @@ static GSAlertPanel *gmodelAlertPanel = nil;
[altButton removeFromSuperview]; [altButton removeFromSuperview];
} }
if (otherButton) if (otherButton != nil)
{ {
[othButton setTitle: otherButton]; [othButton setTitle: otherButton];
[othButton sizeToFit];
if ([othButton superview] == nil) if ([othButton superview] == nil)
[content addSubview: othButton]; [content addSubview: othButton];
bRect = [othButton frame];
diff = maxX - NSMaxX(bRect);
bRect.origin.x += diff;
[othButton setFrame: bRect];
maxX = NSMinX(bRect) - 10;
} }
else else
{ {
@ -458,9 +483,10 @@ static GSAlertPanel *gmodelAlertPanel = nil;
[othButton removeFromSuperview]; [othButton removeFromSuperview];
} }
if (message) if (message != nil)
{ {
[messageField setStringValue: message]; [messageField setStringValue: message];
[messageField sizeToFit];
if ([messageField superview] == nil) if ([messageField superview] == nil)
[content addSubview: messageField]; [content addSubview: messageField];
} }
@ -470,9 +496,10 @@ static GSAlertPanel *gmodelAlertPanel = nil;
[messageField removeFromSuperview]; [messageField removeFromSuperview];
} }
if (title) if (title != nil)
{ {
[titleField setStringValue: title]; [titleField setStringValue: title];
[titleField sizeToFit];
if ([titleField superview] == nil) if ([titleField superview] == nil)
[content addSubview: titleField]; [content addSubview: titleField];
} }