mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 21:17:03 +00:00
Also changed a bunch of <AppKit/*> imports to "*" imports. Reviewed by me.
47 lines
1.1 KiB
Plaintext
47 lines
1.1 KiB
Plaintext
|
|
@import "CPPanel.j"
|
|
|
|
|
|
@implementation CPOpenPanel : CPPanel
|
|
{
|
|
BOOL _canChooseFiles @accessors(property=canChooseFiles);
|
|
BOOL _canChooseDirectories @accessors(property=canChooseDirectories);
|
|
BOOL _allowsMultipleSelection @accessors(property=allowsMultipleSelection);
|
|
CPURL _directoryURL @accessors(property=directoryURL);
|
|
CPArray _URLs;
|
|
}
|
|
|
|
+ (id)openPanel
|
|
{
|
|
return [[CPOpenPanel alloc] init];
|
|
}
|
|
|
|
- (CPInteger)runModal
|
|
{
|
|
if (typeof window["cpOpenPanel"] === "function")
|
|
{
|
|
// FIXME: Is this correct???
|
|
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
|
|
|
|
var options = { directoryURL: [self directoryURL],
|
|
canChooseFiles: [self canChooseFiles],
|
|
canChooseDirectories: [self canChooseDirectories],
|
|
allowsMultipleSelection: [self allowsMultipleSelection] };
|
|
|
|
var result = window.cpOpenPanel(options);
|
|
|
|
_URLs = result.URLs;
|
|
|
|
return result.button;
|
|
}
|
|
|
|
throw "-runModal is unimplemented.";
|
|
}
|
|
|
|
- (CPArray)URLs
|
|
{
|
|
return _URLs;
|
|
}
|
|
|
|
@end
|