Add some 10.4 methods.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25348 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2007-07-23 16:29:29 +00:00
parent f83e9a7e81
commit 22f8170973
6 changed files with 49 additions and 1 deletions

View file

@ -269,6 +269,13 @@ static Class controlClass;
return _control_view;
}
/**
* Set the control view of the receiver.
*/
- (void) setControlView: (NSView*)view
{
_control_view = view;
}
- (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
{

View file

@ -37,6 +37,7 @@
#include <Foundation/NSDebug.h>
#include <Foundation/NSBundle.h>
#include <Foundation/NSError.h>
#include <Foundation/NSString.h>
#include "AppKit/NSAlert.h"
#include "AppKit/NSApplication.h"
@ -1384,6 +1385,20 @@ void NSBeginInformationalAlertSheet(NSString *title,
}
}
+ (NSAlert *) alertWithError: (NSError *)error
{
NSArray *options;
unsigned int count;
options = [error localizedRecoveryOptions];
count = [options count];
return [self alertWithMessageText: [error localizedDescription]
defaultButton: (count > 0) ? [options objectAtIndex: 0] : nil
alternateButton: (count > 1) ? [options objectAtIndex: 1] : nil
otherButton: (count > 2) ? [options objectAtIndex: 2] : nil
informativeTextWithFormat: [error localizedRecoverySuggestion]];
}
+ (NSAlert *) alertWithMessageText: (NSString *)messageTitle
defaultButton: (NSString *)defaultButtonTitle
alternateButton: (NSString *)alternateButtonTitle

View file

@ -1908,7 +1908,7 @@ static NSColor *shadowCol;
return _cell.control_tint;
}
/**<p>This method is used by subclasses to specified the control view.
/**<p>This method is used by subclasses to get the control view.
This method returns nil.</p>
*/
- (NSView*) controlView
@ -1916,6 +1916,13 @@ static NSColor *shadowCol;
return nil;
}
/**<p>This method is used by subclasses to specify the control view.</p>
*/
- (void) setControlView: (NSView*)view
{
// Do nothing
}
/** <p>This drawing is minimal and with no background,
* to make it easier for subclass to customize drawing. </p>
*/