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:
fredkiefer 2007-07-23 16:29:29 +00:00
parent 1d62a78524
commit c2b80f256b
6 changed files with 49 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2007-07-23 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSCell.h,
* Source/NSCell.m,
* Source/NSActionCell.m (-setControlView:): Add MacOSX 10.4 method.
* Headers/AppKit/NSAlert.h,
* Source/NSAlert.m (+alertWithError:): Add MacOSX 10.4 method.
2007-07-18 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSPrintInfo.h,

View file

@ -33,12 +33,15 @@
#include <Foundation/NSObject.h>
@class NSArray;
@class NSError;
@class NSString;
@class NSMutableArray;
@class NSButton;
@class NSImage;
@class NSWindow;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
typedef enum _NSAlertStyle {
NSWarningAlertStyle = 0,
NSInformationalAlertStyle = 1,
@ -66,6 +69,9 @@ enum {
int _result;
}
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
+ (NSAlert *) alertWithError: (NSError *)error;
#endif
+ (NSAlert *) alertWithMessageText: (NSString *)messageTitle
defaultButton: (NSString *)defaultButtonTitle
alternateButton: (NSString *)alternateButtonTitle
@ -109,4 +115,5 @@ enum {
@end
#endif
#endif /* MAC_OS_X_VERSION_10_3 */
#endif /* _GNUstep_H_NSAlert */

View file

@ -441,6 +441,10 @@ enum {
- (void)setControlTint:(NSControlTint)controlTint;
- (NSControlTint)controlTint;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
- (void)setControlView:(NSView*)view;
#endif
//
// Editing Text

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>
*/