summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorhobbs <hobbs>2009-04-23 22:01:29 (GMT)
committerhobbs <hobbs>2009-04-23 22:01:29 (GMT)
commitd9012c3aa93662df967bb77a7ee6386abf813dd1 (patch)
tree6f76ec17b2f580b5339262e98e5cebf42eed4233 /win
parentf75354b91860d456436d24bafb13c80b204f00d4 (diff)
downloadtk-d9012c3aa93662df967bb77a7ee6386abf813dd1.zip
tk-d9012c3aa93662df967bb77a7ee6386abf813dd1.tar.gz
tk-d9012c3aa93662df967bb77a7ee6386abf813dd1.tar.bz2
* win/tkWinDialog.c (Tk_ChooseDirectoryObjCmd): enable the new
style choosedir that has a "New Folder" button, with ::tk::winChooseDirFlags override for new behavior. [Bug 2779910]
Diffstat (limited to 'win')
-rw-r--r--win/tkWinDialog.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 4b75595..f8ffe13 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinDialog.c,v 1.61 2009/01/28 20:47:49 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinDialog.c,v 1.62 2009/04/23 22:01:29 hobbs Exp $
*
*/
@@ -37,6 +37,10 @@
#define BIF_VALIDATE 0x0020
#endif
+#ifndef BIF_NEWDIALOGSTYLE
+#define BIF_NEWDIALOGSTYLE 0x0040
+#endif
+
#ifndef BFFM_VALIDATEFAILED
#ifdef UNICODE
#define BFFM_VALIDATEFAILED 4
@@ -1691,6 +1695,7 @@ Tk_ChooseDirectoryObjCmd(
TCHAR saveDir[MAX_PATH];
Tcl_DString titleString; /* UTF Title */
Tcl_DString initDirString; /* Initial directory */
+ Tcl_Obj *objPtr;
static const char *const optionStrings[] = {
"-initialdir", "-mustexist", "-parent", "-title", NULL
};
@@ -1796,12 +1801,19 @@ Tk_ChooseDirectoryObjCmd(
}
/*
- * Set flags to add edit box (needs 4.71 Shell DLLs), status text line,
- * validate edit box and
+ * Set flags to add edit box, status text line and use the new ui.
+ * Allow override with magic variable (ignore errors in retrieval).
+ * See http://msdn.microsoft.com/en-us/library/bb773205(VS.85).aspx
+ * for possible flag values.
*/
bInfo.ulFlags = BIF_EDITBOX | BIF_STATUSTEXT | BIF_RETURNFSANCESTORS
- | BIF_VALIDATE;
+ | BIF_VALIDATE | BIF_NEWDIALOGSTYLE;
+ objPtr = Tcl_GetVar2Ex(interp, "::tk::winChooseDirFlags", NULL,
+ TCL_GLOBAL_ONLY);
+ if (objPtr != NULL) {
+ Tcl_GetIntFromObj(NULL, objPtr, &(bInfo.ulFlags));
+ }
/*
* Callback to handle events
@@ -1902,8 +1914,6 @@ ChooseDirectoryValidateProc(
chooseDirSharedData = (CHOOSEDIRDATA *)lpData;
- TkWinSetUserData(hwnd, lpData);
-
if (tsdPtr->debugFlag) {
tsdPtr->debugInterp = (Tcl_Interp *) chooseDirSharedData->interp;
Tcl_DoWhenIdle(SetTkDialog, (ClientData) hwnd);