ResKnife/Cocoa/Classes/RKDocumentController.m

27 lines
963 B
Mathematica
Raw Normal View History

2003-04-03 15:38:42 +00:00
#import "RKDocumentController.h"
#import "ApplicationDelegate.h"
#import "OpenPanelDelegate.h"
2003-04-03 15:38:42 +00:00
@implementation RKDocumentController
- (NSInteger)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)extensions
2003-04-03 15:38:42 +00:00
{
// set-up open panel (this happens every time, but no harm done)
ApplicationDelegate *appDelegate = [NSApp delegate];
OpenPanelDelegate *openPanelDelegate = [appDelegate openPanelDelegate];
NSView *openPanelAccessoryView = [openPanelDelegate openPanelAccessoryView];
[openPanel setDelegate:openPanelDelegate];
[openPanel setAccessoryView:openPanelAccessoryView];
[openPanel setAllowsOtherFileTypes:YES];
[openPanel setTreatsFilePackagesAsDirectories:YES];
[openPanelAccessoryView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
// run panel
int button = [super runModalOpenPanel:openPanel forTypes:extensions];
if(button == NSOKButton)
[openPanelDelegate setReadOpenPanelForFork:YES];
return button;
2003-04-03 15:38:42 +00:00
}
@end