To: vim-dev@vim.org Subject: Patch 6.1.147 (extra) Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.147 (extra) Problem: MS-Windows: When a dialog has no default button, pressing Enter ends it anyway and all buttons are selected. Solution: Don't end a dialog when there is no default button. Don't select all button when there is no default. (Vince Negri) Files: src/gui_w32.c *** ../vim61.146/src/gui_w32.c Sun Jun 9 20:34:00 2002 --- src/gui_w32.c Sat Aug 3 21:50:26 2002 *************** *** 2282,2288 **** * accept the default value, some reason this is what we get. */ if (button == IDOK) ! EndDialog(hwnd, dialog_default_button); else EndDialog(hwnd, button - IDCANCEL); return TRUE; --- 2282,2291 ---- * accept the default value, some reason this is what we get. */ if (button == IDOK) ! { ! if (dialog_default_button > IDCANCEL) ! EndDialog(hwnd, dialog_default_button); ! } else EndDialog(hwnd, button - IDCANCEL); return TRUE; *************** *** 2422,2428 **** numButtons++; } if (dfltbutton >= numButtons) ! dfltbutton = 0; /* Allocate array to hold the width of each button */ buttonWidths = (int *) lalloc(numButtons * sizeof(int), TRUE); --- 2425,2431 ---- numButtons++; } if (dfltbutton >= numButtons) ! dfltbutton = -1; /* Allocate array to hold the width of each button */ buttonWidths = (int *) lalloc(numButtons * sizeof(int), TRUE); *************** *** 2640,2646 **** if (vertical) { p = add_dialog_element(p, ! ((i == dfltbutton || dfltbutton < 0) ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON) | WS_TABSTOP, PixelToDialogX(DLG_VERT_PADDING_X), PixelToDialogY(buttonYpos /* TBK */ --- 2643,2649 ---- if (vertical) { p = add_dialog_element(p, ! (i == dfltbutton ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON) | WS_TABSTOP, PixelToDialogX(DLG_VERT_PADDING_X), PixelToDialogY(buttonYpos /* TBK */ *************** *** 2652,2658 **** else { p = add_dialog_element(p, ! ((i == dfltbutton || dfltbutton < 0) ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON) | WS_TABSTOP, PixelToDialogX(horizWidth + buttonPositions[i]), PixelToDialogY(buttonYpos), /* TBK */ --- 2655,2661 ---- else { p = add_dialog_element(p, ! (i == dfltbutton ? BS_DEFPUSHBUTTON : BS_PUSHBUTTON) | WS_TABSTOP, PixelToDialogX(horizWidth + buttonPositions[i]), PixelToDialogY(buttonYpos), /* TBK */ *** ../vim61.146/src/version.c Sat Aug 3 21:22:36 2002 --- src/version.c Sun Aug 4 20:54:08 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 147, /**/ -- From "know your smileys": C=}>;*{)) Drunk, devilish chef with a toupee in an updraft, a mustache, and a double chin /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///