* Source/NSAlert.m: Offset color by less in -resetWindow. Remove

redundant logic for calling the "didEnd" method in the NSBeginSheet...
	functions.
	* Source/NSApplication.m: Add code to reset parent window in 
	beginSheet:... method.  Also added check to make sure the
	modalDelegate is not nil.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28411 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2009-07-26 02:56:56 +00:00
parent 9529d2cdb7
commit c58602f5f5
3 changed files with 19 additions and 26 deletions

View file

@ -976,9 +976,9 @@ setControl(NSView* content, id control, NSString *title)
colorUsingColorSpaceName: NSCalibratedRGBColorSpace]
getRed: &r green: &g blue: &b alpha: &a];
color = [NSColor colorWithCalibratedRed: r + 0.1
green: g + 0.1
blue: b + 0.1
color = [NSColor colorWithCalibratedRed: r + 0.05
green: g + 0.05
blue: b + 0.05
alpha: a];
[self setBackgroundColor: color];
}
@ -1547,21 +1547,16 @@ void NSBeginAlertSheet(NSString *title,
panel = getSomeSheet(&standardAlertPanel, defaultTitle, title, message,
defaultButton, alternateButton, otherButton);
// FIXME: We should also change the button action to call endSheet:
[NSApp beginSheet: panel
modalForWindow: docWindow
modalDelegate: modalDelegate
didEndSelector: willEndSelector
contextInfo: contextInfo];
[panel close];
if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector])
{
void (*didEnd)(id, SEL, id, int, void*);
didEnd = (void (*)(id, SEL, id, int, void*))[modalDelegate methodForSelector:
didEndSelector];
didEnd(modalDelegate, didEndSelector, panel, [panel result], contextInfo);
}
[panel close];
NSReleaseAlertPanel(panel);
}
@ -1593,14 +1588,7 @@ void NSBeginCriticalAlertSheet(NSString *title,
didEndSelector: willEndSelector
contextInfo: contextInfo];
[panel close];
if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector])
{
void (*didEnd)(id, SEL, id, int, void*);
didEnd = (void (*)(id, SEL, id, int, void*))[modalDelegate methodForSelector:
didEndSelector];
didEnd(modalDelegate, didEndSelector, panel, [panel result], contextInfo);
}
NSReleaseAlertPanel(panel);
}
@ -1634,14 +1622,7 @@ void NSBeginInformationalAlertSheet(NSString *title,
didEndSelector: willEndSelector
contextInfo: contextInfo];
[panel close];
if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector])
{
void (*didEnd)(id, SEL, id, int, void*);
didEnd = (void (*)(id, SEL, id, int, void*))[modalDelegate methodForSelector:
didEndSelector];
didEnd(modalDelegate, didEndSelector, panel, [panel result], contextInfo);
}
NSReleaseAlertPanel(panel);
}