summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDialog.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2014-11-20 02:34:09 (GMT)
committerKevin Walzer <kw@codebykevin.com>2014-11-20 02:34:09 (GMT)
commit02b543ede36c5f387093c576a915c0788628bedb (patch)
tree5a101e668abf73d28f52221e94951ca6a824c959 /macosx/tkMacOSXDialog.c
parent0e22d8ae3dcf3f15ae9df9bab55581868f8dbf5a (diff)
downloadtk-02b543ede36c5f387093c576a915c0788628bedb.zip
tk-02b543ede36c5f387093c576a915c0788628bedb.tar.gz
tk-02b543ede36c5f387093c576a915c0788628bedb.tar.bz2
Back out changes not pertaining to private API; those files should not have been updated.
Diffstat (limited to 'macosx/tkMacOSXDialog.c')
-rw-r--r--macosx/tkMacOSXDialog.c64
1 files changed, 3 insertions, 61 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index ea456a6..2f77203 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -1,4 +1,4 @@
-/*
+/*
* tkMacOSXDialog.c --
*
* Contains the Mac implementation of the common dialog boxes.
@@ -24,12 +24,12 @@ enum colorOptions {
static const char *const openOptionStrings[] = {
"-defaultextension", "-filetypes", "-initialdir", "-initialfile",
"-message", "-multiple", "-parent", "-title", "-typevariable",
- "-command", "-allbutton", "-allbuttontip", NULL
+ "-command", NULL
};
enum openOptions {
OPEN_DEFAULT, OPEN_FILETYPES, OPEN_INITDIR, OPEN_INITFILE,
OPEN_MESSAGE, OPEN_MULTIPLE, OPEN_PARENT, OPEN_TITLE,
- OPEN_TYPEVARIABLE, OPEN_COMMAND, OPEN_ALLBUTTON, OPEN_ALLBUTTONTIP
+ OPEN_TYPEVARIABLE, OPEN_COMMAND,
};
static const char *const saveOptionStrings[] = {
"-defaultextension", "-filetypes", "-initialdir", "-initialfile",
@@ -221,35 +221,6 @@ static const short alertNativeButtonIndexAndTypeToButtonIndex[][3] = {
}
@end
- @interface TKOpenDialog : NSControl
- @property(assign) NSOpenPanel *openPanel;
- @property(assign) NSMutableArray *openFileTypes;
- - (void)openUnrecognizedFiles:(id)sender;
- @end
-
- @implementation TKOpenDialog
- - (id)init {
- self = [super init];
- if (self) {
- _openPanel = nil;
- _openFileTypes = nil;
- }
- return self;
- }
-
- - (void)openUnrecognizedFiles:(id)sender
- {
- if ([sender state]) {
- self.openPanel.allowedFileTypes = [NSArray arrayWithObjects:@"public.data", nil];
- } else {
- self.openPanel.allowedFileTypes = self.openFileTypes;
- }
- [self.openPanel setDirectoryURL:self.openPanel.directoryURL];
- [self.openPanel validateVisibleColumns];
- }
-
- @end
-
#pragma mark -
/*
@@ -395,14 +366,11 @@ Tk_GetOpenFileObjCmd(
FilePanelCallbackInfo *callbackInfo = &callbackInfoStruct;
NSString *directory = nil, *filename = nil;
NSString *message, *title, *type;
- NSString *allbutton, *allbuttontip;
NSWindow *parent;
NSMutableArray *fileTypes = nil;
NSOpenPanel *panel = [NSOpenPanel openPanel];
NSInteger returnCode = NSAlertErrorReturn;
- allbutton = nil;
- allbuttontip = nil;
TkInitFileFilters(&fl);
for (i = 1; i < objc; i += 2) {
if (Tcl_GetIndexFromObjStruct(interp, objv[i], openOptionStrings,
@@ -469,14 +437,6 @@ Tk_GetOpenFileObjCmd(
case OPEN_COMMAND:
cmdObj = objv[i+1];
break;
- case OPEN_ALLBUTTON:
- allbutton = [[NSString alloc] initWithUTF8String:
- Tcl_GetString(objv[i + 1])];
- break;
- case OPEN_ALLBUTTONTIP:
- allbuttontip = [[NSString alloc] initWithUTF8String:
- Tcl_GetString(objv[i + 1])];
- break;
}
}
if (fl.filters) {
@@ -512,24 +472,6 @@ Tk_GetOpenFileObjCmd(
}
}
[panel setAllowsMultipleSelection:multiple];
-
- if (allbutton) {
- TKOpenDialog *tkDialog = [TKOpenDialog alloc];
- tkDialog.openPanel = panel;
- tkDialog.openFileTypes = fileTypes;
-
- NSButton *openPanelAccessoryView = [[[NSButton alloc] initWithFrame:NSMakeRect(0.0, 0.0, 224.0, 22.0)] autorelease];
- if (allbuttontip) {
- [openPanelAccessoryView setToolTip:allbuttontip];
- }
- [openPanelAccessoryView setButtonType:NSSwitchButton];
- [openPanelAccessoryView setBezelStyle:0];
- [openPanelAccessoryView setTitle:allbutton];
- [openPanelAccessoryView setAction:@selector(openUnrecognizedFiles:)];
- [openPanelAccessoryView setTarget:tkDialog];
- [panel setAccessoryView:openPanelAccessoryView];
- }
-
if (cmdObj) {
callbackInfo = ckalloc(sizeof(FilePanelCallbackInfo));
if (Tcl_IsShared(cmdObj)) {