diff options
author | sven <sven@noemail.net> | 2000-03-16 03:20:52 (GMT) |
---|---|---|
committer | sven <sven@noemail.net> | 2000-03-16 03:20:52 (GMT) |
commit | 6698c17485ef29b1a0907d444f08c7201a3c328c (patch) | |
tree | 11338106d65fdc0be6a5803a5fc2a0a6af0a25d2 | |
parent | 2928af95cfb2b27f0a10d928fada4b4c7e733aeb (diff) | |
download | tk-6698c17485ef29b1a0907d444f08c7201a3c328c.zip tk-6698c17485ef29b1a0907d444f08c7201a3c328c.tar.gz tk-6698c17485ef29b1a0907d444f08c7201a3c328c.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.
FossilOrigin-Name: dc3926ef9855139c4e030388f8777fa70576aac0
-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; |