summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2009-04-23 21:57:11 (GMT)
committerhobbs <hobbs>2009-04-23 21:57:11 (GMT)
commitab2713cacab81ed220958f74e53cb5bd58413a90 (patch)
tree5fd4c95d2732552a31a3692c152e776a052cb89d
parentaa1fa8233abb4da93309331ac57df3eb64ae3a6d (diff)
downloadtk-ab2713cacab81ed220958f74e53cb5bd58413a90.zip
tk-ab2713cacab81ed220958f74e53cb5bd58413a90.tar.gz
tk-ab2713cacab81ed220958f74e53cb5bd58413a90.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]
-rw-r--r--ChangeLog6
-rw-r--r--win/tkWinDialog.c26
2 files changed, 22 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 2ecdfcf..90453b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * 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]
+
2009-04-15 Don Porter <dgp@users.sourceforge.net>
*** 8.5.7 TAGGED FOR RELEASE ***
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 06cceb2..0ac03bd 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.50.2.1 2008/04/14 20:59:51 patthoyts Exp $
+ * RCS: @(#) $Id: tkWinDialog.c,v 1.50.2.2 2009/04/23 21:57:11 hobbs Exp $
*
*/
@@ -36,6 +36,10 @@
#define BIF_VALIDATE 0x0020
#endif
+#ifndef BIF_NEWDIALOGSTYLE
+#define BIF_NEWDIALOGSTYLE 0x0040
+#endif
+
#ifndef BFFM_VALIDATEFAILED
#ifdef UNICODE
#define BFFM_VALIDATEFAILED 4
@@ -1661,10 +1665,6 @@ MakeFilter(
* - Not sure how to implement localization of message prompts.
*
* - -title is really -message.
- * ToDo:
- * - Fix bugs.
- * - test to see what platforms this really works on. May require v4.71 of
- * shell32.dll everywhere (what is standard?).
*
*----------------------------------------------------------------------
*/
@@ -1689,6 +1689,7 @@ Tk_ChooseDirectoryObjCmd(
TCHAR saveDir[MAX_PATH];
Tcl_DString titleString; /* UTF Title */
Tcl_DString initDirString; /* Initial directory */
+ Tcl_Obj *objPtr;
static CONST char *optionStrings[] = {
"-initialdir", "-mustexist", "-parent", "-title", NULL
};
@@ -1794,12 +1795,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
@@ -1900,8 +1908,6 @@ ChooseDirectoryValidateProc(
chooseDirSharedData = (CHOOSEDIRDATA *)lpData;
- TkWinSetUserData(hwnd, lpData);
-
if (tsdPtr->debugFlag) {
tsdPtr->debugInterp = (Tcl_Interp *) chooseDirSharedData->interp;
Tcl_DoWhenIdle(SetTkDialog, (ClientData) hwnd);