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 Frith-MacDonald 1999-12-21 16:48:34 +00:00
parent 9c707e2a8d
commit e22b67aa73
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
the windows first responder if any of the removed views in first
responder (avoid crash iv views subsequently deallocated).
* 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>

View file

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