mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 22:00:46 +00:00
Small changes for NSAlert.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21250 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
eb370a013c
commit
acd661c622
2 changed files with 54 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2005-05-23 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSAlert.m (-_setupPanel): New method.
|
||||||
|
(-runModal, -beginSheetModalForWindow:...contextInfo:) Use this
|
||||||
|
new method.
|
||||||
|
|
||||||
2005-05-22 Fred Kiefer <FredKiefer@gmx.de>
|
2005-05-22 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/NSView.m (-display)
|
* Source/NSView.m (-display)
|
||||||
|
@ -5,7 +11,7 @@
|
||||||
* Source/NSBrowserCell.m (-drawWithFrame:inView:)
|
* Source/NSBrowserCell.m (-drawWithFrame:inView:)
|
||||||
* Source/NSImageCell.m (-drawWithFrame:inView:)
|
* Source/NSImageCell.m (-drawWithFrame:inView:)
|
||||||
* Source/NSMenuItemCell.m (-drawWithFrame:inView:)
|
* Source/NSMenuItemCell.m (-drawWithFrame:inView:)
|
||||||
* Source/NSTableHeaderCell.m (-drawWithFrame:inView:)
|
* Source/NSTableHeaderCell.m (-drawWithFrame:inView:):
|
||||||
Removed check for window existence. This should already have been
|
Removed check for window existence. This should already have been
|
||||||
checked by a surrounding canDraw call. Fixes bug #13140.
|
checked by a surrounding canDraw call. Fixes bug #13140.
|
||||||
|
|
||||||
|
|
|
@ -1405,10 +1405,48 @@ void NSBeginInformationalAlertSheet(NSString *title,
|
||||||
return _delegate;
|
return _delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)_setupPanel
|
||||||
|
{
|
||||||
|
GSAlertPanel *panel;
|
||||||
|
NSString *title;
|
||||||
|
|
||||||
|
panel = [[GSAlertPanel alloc] init];
|
||||||
|
_window = panel;
|
||||||
|
|
||||||
|
switch (_style)
|
||||||
|
{
|
||||||
|
case NSCriticalAlertStyle:
|
||||||
|
title = @"Critical";
|
||||||
|
break;
|
||||||
|
case NSInformationalAlertStyle:
|
||||||
|
title = @"Information";
|
||||||
|
break;
|
||||||
|
case NSWarningAlertStyle:
|
||||||
|
default:
|
||||||
|
title = @"Alert";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
[panel setTitle: title];
|
||||||
|
// FIXME: Should also set the icon
|
||||||
|
[panel setTitle: _informative_text
|
||||||
|
message: _message_text
|
||||||
|
def: [[_buttons objectAtIndex: 0] title]
|
||||||
|
alt: [[_buttons objectAtIndex: 1] title]
|
||||||
|
other: [[_buttons objectAtIndex: 2] title]];
|
||||||
|
[panel sizePanelToFit];
|
||||||
|
}
|
||||||
|
|
||||||
- (int)runModal
|
- (int)runModal
|
||||||
{
|
{
|
||||||
// FIXME
|
int result;
|
||||||
return NSAlertFirstButtonReturn;
|
|
||||||
|
[self _setupPanel];
|
||||||
|
[NSApp runModalForWindow: _window];
|
||||||
|
[_window orderOut: self];
|
||||||
|
result = [(GSAlertPanel*)_window result];
|
||||||
|
DESTROY(_window);
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)beginSheetModalForWindow:(NSWindow *)window
|
- (void)beginSheetModalForWindow:(NSWindow *)window
|
||||||
|
@ -1416,7 +1454,13 @@ void NSBeginInformationalAlertSheet(NSString *title,
|
||||||
didEndSelector:(SEL)didEndSelector
|
didEndSelector:(SEL)didEndSelector
|
||||||
contextInfo:(void *)contextInfo
|
contextInfo:(void *)contextInfo
|
||||||
{
|
{
|
||||||
// FIXME
|
[self _setupPanel];
|
||||||
|
[NSApp beginSheet: _window
|
||||||
|
modalForWindow: window
|
||||||
|
modalDelegate: delegate
|
||||||
|
didEndSelector: didEndSelector
|
||||||
|
contextInfo: contextInfo];
|
||||||
|
DESTROY(_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)window
|
- (id)window
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue