Added new MacOSX methods.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15105 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
FredKiefer 2002-11-26 00:18:33 +00:00
parent 4130929991
commit acd4047389
5 changed files with 105 additions and 50 deletions

View file

@ -1,3 +1,11 @@
2002-11-24 Fred Kiefer <FredKiefer@gmx.de>
* Headers/gnustep/gui/NSSavePanel.h
* Headers/gnustep/gui/NSOpenPanel.h
* Source/NSSavePanel.m
* Source/NSOpenPanel.m
Added new MacOSX methods.
2002-11-24 Fred Kiefer <FredKiefer@gmx.de> 2002-11-24 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSBezierPath.m * Source/NSBezierPath.m

View file

@ -40,7 +40,6 @@
@class NSString; @class NSString;
@class NSArray; @class NSArray;
@class NSMutableArray;
@interface NSOpenPanel : NSSavePanel <NSCoding> @interface NSOpenPanel : NSSavePanel <NSCoding>
{ {
@ -49,40 +48,46 @@
BOOL _canChooseFiles; BOOL _canChooseFiles;
} }
// Accessing the NSOpenPanel shared instance // Accessing the NSOpenPanel shared instance
+ (NSOpenPanel *)openPanel; + (NSOpenPanel *) openPanel;
// Filtering Files
- (BOOL)allowsMultipleSelection;
- (BOOL)canChooseDirectories;
- (BOOL)canChooseFiles;
- (void)setAllowsMultipleSelection:(BOOL)flag;
- (void)setCanChooseDirectories:(BOOL)flag;
- (void)setCanChooseFiles:(BOOL)flag;
- (NSArray *)filenames;
// Running an NSOpenPanel // Running an NSOpenPanel
- (int)runModalForTypes:(NSArray *)fileTypes; - (int) runModalForTypes: (NSArray *)fileTypes;
- (int)runModalForDirectory:(NSString *)path - (int) runModalForDirectory: (NSString *)path
file:(NSString *)name file: (NSString *)name
types:(NSArray *)fileTypes; types: (NSArray *)fileTypes;
#ifndef STRICT_OPENSTEP #ifndef STRICT_OPENSTEP
- (int)runModalForDirectory:(NSString *)path - (int) runModalForDirectory: (NSString *)path
file:(NSString *)name file: (NSString *)name
types:(NSArray *)fileTypes types: (NSArray *)fileTypes
relativeToWindow:(NSWindow*)window; relativeToWindow: (NSWindow*)window;
- (void)beginSheetForDirectory:(NSString *)path - (void) beginSheetForDirectory: (NSString *)path
file:(NSString *)name file: (NSString *)name
types:(NSArray *)fileTypes types: (NSArray *)fileTypes
modalForWindow:(NSWindow *)docWindow modalForWindow: (NSWindow *)docWindow
modalDelegate:(id)delegate modalDelegate: (id)delegate
didEndSelector:(SEL)didEndSelector didEndSelector: (SEL)didEndSelector
contextInfo:(void *)contextInfo; contextInfo: (void *)contextInfo;
- (NSArray *)URLs;
#endif #endif
- (NSArray *) filenames;
#ifndef STRICT_OPENSTEP
- (NSArray *) URLs;
#endif
// Filtering Files
- (BOOL) canChooseDirectories;
- (BOOL) canChooseFiles;
- (void) setCanChooseDirectories: (BOOL)flag;
- (void) setCanChooseFiles: (BOOL)flag;
#ifndef STRICT_OPENSTEP
- (void) setResolvesAliases: (BOOL)flag;
- (BOOL) resolvesAliases;
#endif
- (BOOL) allowsMultipleSelection;
- (void) setAllowsMultipleSelection: (BOOL)flag;
@end @end
#endif // _GNUstep_H_NSOpenPanel #endif // _GNUstep_H_NSOpenPanel

View file

@ -33,32 +33,29 @@
#ifndef _GNUstep_H_NSSavePanel #ifndef _GNUstep_H_NSSavePanel
#define _GNUstep_H_NSSavePanel #define _GNUstep_H_NSSavePanel
#include <Foundation/NSCoder.h>
#include <Foundation/NSSet.h>
#include <AppKit/NSBrowser.h>
#include <AppKit/NSButton.h>
#include <AppKit/NSForm.h>
#include <AppKit/NSFormCell.h>
#include <AppKit/NSPanel.h> #include <AppKit/NSPanel.h>
#include <AppKit/NSTextField.h>
@class NSString; @class NSString;
@class NSURL; @class NSURL;
@class NSBrowser;
@class NSButton;
@class NSForm;
@class NSTextField;
@class NSView;
enum { enum {
NSFileHandlingPanelCancelButton = NSCancelButton,
NSFileHandlingPanelOKButton = NSOKButton,
NSFileHandlingPanelImageButton, NSFileHandlingPanelImageButton,
NSFileHandlingPanelTitleField, NSFileHandlingPanelTitleField,
NSFileHandlingPanelBrowser, NSFileHandlingPanelBrowser,
NSFileHandlingPanelCancelButton,
NSFileHandlingPanelOKButton,
NSFileHandlingPanelForm, NSFileHandlingPanelForm,
NSFileHandlingPanelHomeButton, NSFileHandlingPanelHomeButton,
NSFileHandlingPanelDiskButton, NSFileHandlingPanelDiskButton,
NSFileHandlingPanelDiskEjectButton NSFileHandlingPanelDiskEjectButton
}; };
@interface NSSavePanel : NSPanel <NSCoding> @interface NSSavePanel : NSPanel
{ {
NSView *_accessoryView; NSView *_accessoryView;
NSView *_bottomView; NSView *_bottomView;
@ -100,6 +97,15 @@ enum {
- (void) setPrompt: (NSString *)prompt; - (void) setPrompt: (NSString *)prompt;
- (NSString *) prompt; - (NSString *) prompt;
#ifndef STRICT_OPENSTEP
/*
* Hidding extensions
*/
- (void) setCanSelectHiddenExtension: (BOOL) flag;
- (BOOL) isExtensionHidden;
- (void) setExtensionHidden: (BOOL) flag;
#endif
/* /*
* Setting Directory and File Type * Setting Directory and File Type
*/ */
@ -128,8 +134,6 @@ enum {
modalDelegate: (id)delegate modalDelegate: (id)delegate
didEndSelector: (SEL)didEndSelector didEndSelector: (SEL)didEndSelector
contextInfo: (void *)contextInfo; contextInfo: (void *)contextInfo;
- (NSURL *) URL;
#endif #endif
/* /*
@ -137,6 +141,10 @@ enum {
*/ */
- (NSString *) directory; - (NSString *) directory;
- (NSString *) filename; - (NSString *) filename;
#ifndef STRICT_OPENSTEP
- (NSURL *) URL;
- (BOOL) isExpanded;
#endif
/* /*
* Target and Action Methods * Target and Action Methods

View file

@ -46,6 +46,8 @@
#include <AppKit/NSApplication.h> #include <AppKit/NSApplication.h>
#include <AppKit/NSBrowser.h> #include <AppKit/NSBrowser.h>
#include <AppKit/NSBrowserCell.h> #include <AppKit/NSBrowserCell.h>
#include <AppKit/NSButton.h>
#include <AppKit/NSForm.h>
#include <AppKit/NSMatrix.h> #include <AppKit/NSMatrix.h>
#include <AppKit/NSOpenPanel.h> #include <AppKit/NSOpenPanel.h>
@ -537,6 +539,17 @@ static NSOpenPanel *_gs_gui_open_panel = nil;
[self close]; [self close];
} }
- (BOOL) resolvesAliases
{
// FIXME
return YES;
}
- (void) setResolvesAliases: (BOOL) flag
{
// FIXME
}
/* /*
* NSCoding protocol * NSCoding protocol
*/ */

View file

@ -31,6 +31,13 @@
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSException.h>
#include <Foundation/NSFileManager.h>
#include <Foundation/NSNotification.h>
#include <Foundation/NSPathUtilities.h>
#include <Foundation/NSUserDefaults.h>
#include <Foundation/NSURL.h>
#include <AppKit/NSApplication.h> #include <AppKit/NSApplication.h>
#include <AppKit/NSBox.h> #include <AppKit/NSBox.h>
#include <AppKit/NSBrowser.h> #include <AppKit/NSBrowser.h>
@ -42,16 +49,8 @@
#include <AppKit/NSImageView.h> #include <AppKit/NSImageView.h>
#include <AppKit/NSMatrix.h> #include <AppKit/NSMatrix.h>
#include <AppKit/NSSavePanel.h> #include <AppKit/NSSavePanel.h>
#include <AppKit/NSOpenPanel.h>
#include <AppKit/NSTextField.h> #include <AppKit/NSTextField.h>
#include <AppKit/NSWorkspace.h> #include <AppKit/NSWorkspace.h>
#include <Foundation/NSException.h>
#include <Foundation/NSFileManager.h>
#include <Foundation/NSUserDefaults.h>
#include <Foundation/NSURL.h>
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSNotification.h>
#include <Foundation/NSPathUtilities.h>
#define _SAVE_PANEL_X_PAD 5 #define _SAVE_PANEL_X_PAD 5
#define _SAVE_PANEL_Y_PAD 4 #define _SAVE_PANEL_Y_PAD 4
@ -1018,6 +1017,28 @@ selectCellWithString: (NSString*)title
[super setDelegate: aDelegate]; [super setDelegate: aDelegate];
} }
- (void) setCanSelectHiddenExtension: (BOOL) flag
{
// FIXME
}
- (BOOL) isExtensionHidden
{
// FIXME
return NO;
}
- (void) setExtensionHidden: (BOOL) flag
{
// FIXME
}
- (BOOL) isExpanded
{
// FIXME
return NO;
}
// //
// NSCoding protocol // NSCoding protocol
// //