mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 03:11:18 +00:00
* 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:
parent
0c982ef3eb
commit
c6f4518c9f
3 changed files with 19 additions and 26 deletions
|
@ -1,3 +1,12 @@
|
|||
2009-07-25 22:54-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* 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.
|
||||
|
||||
2009-07-25 20:54-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/NSAlert.m: Remove category for setAttachedSheet method.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -1893,10 +1893,11 @@ See -runModalForWindow:
|
|||
|
||||
[sheet setParentWindow: docWindow];
|
||||
[docWindow setAttachedSheet: sheet];
|
||||
|
||||
ret = [self runModalForWindow: sheet
|
||||
relativeToWindow: docWindow];
|
||||
|
||||
if ([modalDelegate respondsToSelector: didEndSelector])
|
||||
if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector])
|
||||
{
|
||||
void (*didEnd)(id, SEL, id, int, void*);
|
||||
|
||||
|
@ -1904,7 +1905,9 @@ See -runModalForWindow:
|
|||
didEndSelector];
|
||||
didEnd(modalDelegate, didEndSelector, sheet, ret, contextInfo);
|
||||
}
|
||||
|
||||
[docWindow setAttachedSheet: nil];
|
||||
[sheet setParentWindow: nil];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue