diff options
author | sven <sven> | 2000-03-16 03:20:52 (GMT) |
---|---|---|
committer | sven <sven> | 2000-03-16 03:20:52 (GMT) |
commit | 8771a5acb27b38a6ee4de1e189447bb1404de659 (patch) | |
tree | 11338106d65fdc0be6a5803a5fc2a0a6af0a25d2 | |
parent | 9f533db5d1f2fc9f66f2f3582233301ef8bf24e8 (diff) | |
download | tk-8771a5acb27b38a6ee4de1e189447bb1404de659.zip tk-8771a5acb27b38a6ee4de1e189447bb1404de659.tar.gz tk-8771a5acb27b38a6ee4de1e189447bb1404de659.tar.bz2 |
* win/tkWinDialog.c: Changed the behavior for the
tk_chooseDirectory dialog under Windows. Instead of trying to
return the currently selected listbox entry (which didn't work in
case the user selected the initial directory anyway), we now
return the value shown in the entry. This seems to be in
accordance with the expected behavior for this dialog.
-rw-r--r-- | win/tkWinDialog.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index b35c1ef..0779b74 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -9,7 +9,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.6 2000/02/01 11:41:43 hobbs Exp $ + * RCS: @(#) $Id: tkWinDialog.c,v 1.7 2000/03/16 03:20:52 sven Exp $ * */ @@ -1147,7 +1147,7 @@ ChooseDirectoryHookProc( GetCurrentDirectory(MAX_PATH, cdPtr->path); if (idCtrl == lst2) { - if ((cdPtr->lastIdx < 0) || (cdPtr->lastIdx == thisItem)) { + if (cdPtr->lastIdx == thisItem) { EndDialog(hwnd, IDOK); return 1; } @@ -1267,18 +1267,13 @@ ChooseDirectoryHookProc( } } else if (idCtrl == IDOK) { /* - * The OK button was clicked. Return the path currently specified - * in the listbox. - * - * The directory has not yet been changed to the one specified in - * the listbox. Returning 0 allows the default dialog proc to - * change the directory to the one specified in the listbox and - * then causes it to send a WM_LBSELCHANGED back to the hook proc. - * When we get that message, we will record the current directory - * and then quit. + * The OK button was clicked. Return the value currently selected + * in the entry. */ - cdPtr->lastIdx = -1; + GetCurrentDirectory(MAX_PATH, cdPtr->path); + EndDialog(hwnd, IDOK); + return 1; } } return 0; |